Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Frequency resolution using Zero Padding | DFT | MATLAB

Codes used in the video:
1)
DFT as sampled version of DTFT:
clc
clear all
close all
n=-20:21;
xn=cos(2*pi*0.2*n);
w=0:0.01:pi;
for i=1:length(w)
    xw(i)=sum(xn.*exp(-1i*w(i)*n));
end
plot(w,abs(xw));
hold on;
N=42;
y=fft(xn,42);
y=y(1:(N/2)+1);
k=0:N/2;
stem(2*pi*k/N,abs(y));

2)
Zero padding concept:
clc
clear all
close all
n=-20:21;
xn=cos(2*pi*0.2*n);
N=512;
y=fft(xn,N);
y=y(1:(N/2)+1);
k=0:N/2;
plot(2*pi*k/N,abs(y));

No comments

Popular Posts