Unknown line in code
1 回表示 (過去 30 日間)
古いコメントを表示
% P0=90;
% Ps=10000;
% Ts=1/Ps;
% t=0:Ts:0.4;
% w0=2*pi*F0;
% A=2;
% x=A*sin(w0*t)
%
% Nfft=length(x)*32;
% x=fft(x,Nfft);
% x=fftshift(x);
% F=-Fs/2:Fs/Nfft:Fs/2-Fs/Nfft;
%
In the code above, what is the point of this line ? : " % F=-Fs/2:Fs/Nfft:Fs/2-Fs/Nfft; "
0 件のコメント
採用された回答
Star Strider
2018 年 1 月 3 日
This line:
F=-Fs/2:Fs/Nfft:Fs/2-Fs/Nfft;
defines the frequency vector for a two-sided fft, where 0 Hz is in the centre of the plot. Here, ‘Fs’ is the sampling frequency, undefined in the code you posted (but is probably 1/Ts).
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Fourier Analysis and Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!