Untitled
clc clear all close all xn=[1,1,2,0] hn=[1,2,0,0] n=4 m1=fft(xn,n) m2=fft(hn,n) m=[m1].*[m2] p=ifft(m,n) N=0:n-1 subplot(2,1,1) stem(N,m) disp(p) xlabel('Time') ylabel('Magnitude') title('Linear Convolution using DFT') subplot(2,1,2) stem(N,p) xlabel('Time') ylabel('Magnitude') title('Linear Convolution and IDFT')