fft definition in matlab doc puzzling
古いコメントを表示
Hi all,
I'm a bit puzzled with the definition of fft in the documentation :
The definition at the very end in "more about" states the fft as a projection on positive frequency (from 0 to Fs/N) while the examples suggest a "two sided" spectrum ie. with positive frequencies and negative ones (-Fs/2 to Fs/2).
To make my question more precise :
the definition in the doc is :
Given that the fft results in both positive and negative frequencies, I woumld have guess a defintion like :

Am I missing something ?
thanks in advance for your help,
Francois.
2 件のコメント
Walter Roberson
2019 年 2 月 17 日
?? I do not see the word "projection" at all in that documentation ??
françois anquez
2019 年 2 月 19 日
採用された回答
その他の回答 (1 件)
Your second definition only makes sense if you define the indexing in Y(k) to be modulo-n. Otherwise, it is not clear what it means for a vector Y to be indexed at negative k.
If you are defining Y(k) to be modulo n, then the two IFFT definitions are equivalent because Y(k) and W_n(j-1)(k-1) are then both n-periodic with respect to k. Therefore any sum over n successive indices k gives the same result.
4 件のコメント
françois anquez
2019 年 2 月 21 日
françois anquez
2019 年 2 月 21 日
The test code should be as below. The main problem with your implementation is that in the first version of the coefficient calculation, you are putting the time origin at X(1) whereas in the second version, you are putting the time origin at X(N/2). Thus, the second version is really the transform of a phase-shifted version of X.
function [coef1,coef2]=essaiFFT_Matt(X,k)
N=numel(X);
WN=exp(-1i*2*pi/N);
coef1=0;
for j=1:N
coef1=coef1+X(j)*power(WN,(j-1)*(k-1));
end
coef2=0;
for j=(1:N) - floor(N/2) %floor() handles odd N
index=mod(j-1,N)+1; %modulo N transform for 1-based indexing
coef2=coef2 + X(index)*power(WN,(j-1)*(k-1));
end % for jj
end % function
カテゴリ
ヘルプ センター および File Exchange で Correlation and Convolution についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


