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!