Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
316 B
1
Indexable
Never
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')