Skip to main content

Convolution and Correlation


DSPP EXPERIMENTS

This blog discusses a few simple experiments to analyse signals. I am going to going to explain a few experiments along with their codes.

1. Experiment 1 : Part A : Linear Convolution and Circular Convolution

 Convolution is a formal mathematical operation. It takes two signals as input and produces a third signal. In linear systems, convolution is used to describe the relationship between three signals of interest: the input signal, the impulse response, and the output signal.
This is what I have done in this experiment. 

Linear Convolution


My first input signal was x[n] which is an L point sequence. My second input signal was h[n] which is an M point signal. I entered the value of L and the values for input signal x[n]. Then I entered the value of M followed by values for signal h[n]. The function Linear_conv() will calculated the the convolution of these two signals and store the values for output signal in y[n] which is a N point sequence. The value of N for the output sequence is calculated using this N=L+M-1. If both the input signals are causal (A causal signal is zero for t<0) then the linearly convolved output signal will also be causal.  


Circular Convolution 

Circular convolution is valid only when all the samples are real. My first input signal was x[n] which is an L point sequence. My second input signal was h[n] which is an M point signal. I entered the value of L and the values for input signal x[n]. Then I entered the value of M followed by values for signal h[n]. The value of N for the output sequence is calculated using N=Max (L,M). Then Circular Convolution was done on the input signals. The circularly convolved signal was stored and displayed as y[n]. Circular Convolution gives aliased output.


Linear Convolution using Circular Convolution



My first input signal was x[n] which is an m point sequence. My second input signal was h[n] which is an n point sequence. Then I entered the values for input signal x[n] and impulse response (second signal) h[n]. For Linear convolution using Circular Convolution N >=m+n-1 , otherwise aliasing effect will corrupt the output signal. The result of convolution was stored in y[n] and displayed as shown.

 







Part B : Discrete Correlation

Correlation is used to find the degree of similarity between two signals.

Auto-Correlation                                                                 

The first case was to find the correlation between an m point sequence and its copy. The result showed that the output of auto-correlation gives an even signal as shown in the picture. Energy of the signal is given by the magnitude at instant zero (i.e. n=0). 




The second case was to find auto-correlation of delayed input signal. The result showed that the output was same as that of case 1. My first input signal was delayed x[n] i.e. x[n-1] and the second input signal was also x[n-1]. Then the result of correlation was calculated using a c language code.







The last case was to calculate cross correlation between two signals. 




Comments

  1. Length of output signal in autocorrelation will be N=L+M-1 where L and M are lengths of input signals.Right?

    ReplyDelete
  2. In correlation, if signals are almost identical, then the magnitude of coefficient of correlation is close to unity.

    ReplyDelete

Post a Comment

Popular posts from this blog

Chebyshev Filter Design

Chebyshev Filter Design Having designed a filter by Butterworth design method previously, designing filter by Chebyshev Method requires calculation of a lot more parameters than butterworth method. We designed Chebyshev 1 filter and simulated its magnitude and frequency response using Scilab .  The order of the filter and the Transfer Function were calculated after entering the values of various parameters like : Pass band Attenuation (Ap), Stop Band Attenuation (As), Passband frequency, Stopband frequency. The obtained frequency response was very close to the ideal response. From the obtained characteristics, we verified that, for a Chebyshev 1 filter Pass band : Equiripple Stop band: monotonic No ripples in Passband Lesser transition width, slow roll-off at high frequencies Scilab simulation software made the process of computing Transfer Function of higher order filters and plotting the magnitude and frequency response easier and efficient.    ...