Professional Documents
Culture Documents
Experiment 1
Experiment 1
Experiment 1
DSP_FALL 2022 1
Convolution
A mathematical operator which
computes the “amount of overlap”
between two functions. Can be thought
of as a general moving average
Discrete domain:
DSP_FALL 2022 2
Convolution
Arbitrary discrete-time signal;
Reflected Signal,
y(n) = x(n-D) + w(n)
0 T
DSP_FALL 2022 6
Correlation
Auto Correlation:
rxx l x n x n l r l
n
xx l 0, 1, 2,
Cross Correlation:
rxy l x n y n l
n
l 0, 1, 2,
rxy l x n l y n
n
l 0, 1, 2,
DSP_FALL 2022 7
Correlation
clc;
clear all; for i=1:N1
close all; for j=1:N2
x=input('enter the 1st Y(i+j-1)=Y(i+j-
sequence'); 1)+(x(i)*H(j));
h=input('enter the 2nd end
sequence'); end
N1=length(x); disp(Y);
N2=length(h); Corr=xcorr(x,h);
H=fliplr(h); disp(Correlation');Corr
Y=zeros(1,N1+N2-1);
DSP_FALL 2022 8
Correlation of Signals
A=conv(x,y);
load gong;
B=xcorr(x,y);
x=y;
figure;subplot(2,2,1);grid on;
Fs1=Fs; plot(x);title('GONG SIGNAL');
player=audioplayer(x,Fs1); subplot(2,2,2);grid on;
play(player) plot(y);
load chirp; title('CHIRP SIGNAL');
player=audioplayer(y,Fs); subplot(2,2,3);grid on;
play(player) plot(A);
title('Convolved SIGNAL');
subplot(2,2,4);grid on;
plot(B);
DSP_FALL 2022 title('Correlated SIGNAL'); 9
Exp.2
Generate the signals
x(n) over the interval 100-300 with
amplitude ‘1’
y(n) over the interval 200-800 with
magnitude ‘1.5’
DSP_FALL 2022 10
DSP_FALL 2022 11
Exp.2
Generate a signal
Find the cross
with components
w1,w2,w3 as correlation
shown in figure between x(n) and
and plot their y(n).
auto-correlation
DSP_FALL 2022 12