Finding Accurate Amplitude Using FFT
古いコメントを表示
Greetings,
I have been working on code to use the FFT to find the amplitude of a signal. However, despite my best efforts to window I seem to get incorrect amplitudes. When I manually find Amplitude by inspecting the signal I get A = 63.7. When I use the following code I get A = 54.8. This is causing significant errors in my Bode plot.
I tried using a flat top window to maximize amplitude accuracy. My signal does not seem significantly noisy. I expected an amplitude much closer to the true value.
function Amplitude = Gaindb(x)
if size(x, 2) > 1
x = x';
end
x = x - mean(x);
N = length(x);
win = flattopwin(N);
x = fft(x.*flattopwin(N));
Amplitude = 2*max(abs(x))/N;
end
Regards, Andy
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Spectral Measurements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!