Finding Accurate Amplitude Using FFT
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!