Improving the Resolution in FFT
3 views (last 30 days)
Show older comments
I need to get an output like below.

But this is the output I get as a result of the code I wrote.
clc
clear all
close all
N = 5;
n = -N-2: 1 : N+2;
u = unit(n+N/2)-unit(n-N/2);
subplot(2,1,1);
stem(n,u);
grid
title('x(t)');
X = fftshift(fft(u));
subplot(2,1,2)
plot(n,abs(X))
grid
title('|X(w)|')

How can I do this, thank you very much for your help.
0 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!