fft matlab, scaling amplitude problem
古いコメントを表示
Hi I've faced a problem in my homework coding. please help me to solve it.
I wrote a code for a problem, which i have its results. but after taking fft function from input, the amplitude of output is twice more than expected result.
what are the reasons that might be caused this?
I really appreciate it.
回答 (2 件)
Wayne King
2013 年 5 月 30 日
You should always show your code:
fs = 1000;
t = 0:1/fs:1-1/fs;
L = length(x);
xdft = fft(x)/L;
plot(abs(xdft))
Exactly as I expect two peaks with amplitude 0.5
Or
xdft = 2*fft(x)/L;
xdft = xdft(1:length(x)/2+1);
plot(abs(xdft))
4 件のコメント
Bob GH
2013 年 5 月 30 日
Wayne King
2013 年 5 月 30 日
Again, you're not showing your code (not sure why). If you are using the fft() for amplitude estimation, you want to divide by the length of the input signal.
Bob GH
2013 年 5 月 30 日
Bob GH
2013 年 5 月 30 日
Azzi Abdelmalek
2013 年 5 月 30 日
0 投票
That means that, before calculating the fft, you've made some errors, which we can't find, because you have not posted the code.
2 件のコメント
Bob GH
2013 年 5 月 30 日
Wayne King
2013 年 5 月 30 日
編集済み: Wayne King
2013 年 5 月 30 日
Does 10++ mean 12 lines? If it is a reasonable number, please post it all. Did you look at the code I posted below?
カテゴリ
ヘルプ センター および 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!