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.



Length of output signal in autocorrelation will be N=L+M-1 where L and M are lengths of input signals.Right?
ReplyDeleteIn correlation, if signals are almost identical, then the magnitude of coefficient of correlation is close to unity.
ReplyDelete