what is wrong with my code(FFT)?
显示 更早的评论
% code
clc;
clear all;
close all;
f1 = 4*1000 %f1=4kHz
t1 = linspace(-1/f1, 1/f1, 100*1000); %t1=(-1/f1,1/f1)
x_c1=sinc(2*pi*f1*t1);
FT_x_c1 = fft(x_c1);
plot(FT_x_c1)
and result is

It is obvious that FFT of sinc function in time domain is rect function in frequency domain.
But as you see, there's something wrong with the result.
What should I do to solve this situation?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 스펙트럼 측정값 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!