Matlab code for unit impulse signal generation: Matlab code for unit ramp signal generation: Matlab code for unit step (delayed step) signal generation: Matlab code for exponentially grow…Full description
Correlation Of Two Signals Experiment No: 03 AIM: To write a Matlab program to find the correlation between two signals. Procedure: 1.Open the Matlab 2.Open the new m file 3.Type the program and save it in current directory 4.Compile and run the program 5.For the output see the command window and figure window Program code: Correlation function[]=shyamcorrs(x,h) l=length(x); m=length(h); n=m+l-1; for i=-max(m,l):max(m,l) y=zeros(1,l); for k=1:l if((k-i)<=m&&(k-i)>0) y(k)=x(k)*h(k-i); end end c(i+n)=sum(y); end c
stem(c) xcorr(x,h) End
Program Code: Correlation using convolution function[y]=shyamcorrss(x,h) m=length(x); l=length(h); g=fliplr(h); n=m+l-1; for t=1:n; y(t)=0; for k=max(1,t-(m-1)):min(t,m); y(t)=y(t)+x(k).*g(t-k+1); end end stem(y) xcorr(x,h) Result: Correlation using convolution and correlation are displayed and wave form ploted. Output Wave form: 1. Correlation