# Signal amplitude and FFT's

Started by October 16, 2001
 I have a very simple problem. The answer might be complicated... :) I define a signal as: dx = 1000; x = -pi:dx:pi; y = A * sin(freq * x); now, I would like to look at the FFT of the signal: padding = 1000; ffty = fft(y,padding); If I plot: plot(abs(ffty).^2) I get two peaks (as I expected). Now, my problem is how to go from the HIGHT of the peaks in the Fourier domain back to the AMPLITUDE of my sinusoidal ("A" in this case). I can assume I know everything (number of points, limits, frequency) but the amplitude.
 Amir- On Tue, 16 Oct 2001, "Amir Give'on" <> wrote: >I have a very simple problem. The answer might be complicated... :) > >I define a signal as: > >dx = 1000; >x = -pi:dx:pi; >y = A * sin(freq * x); > >now, I would like to look at the FFT of the signal: > >padding = 1000; >ffty = fft(y,padding); > >If I plot: > >plot(abs(ffty).^2) > >I get two peaks (as I expected). Now, my problem is how to go from >the HIGHT of the peaks in the Fourier domain back to the AMPLITUDE of >my sinusoidal ("A" in this case). I can assume I know everything >(number of points, limits, frequency) but the amplitude. Divide linear magnitude values in FFT result by framesize, where framesize is actual number of input points to FFT, not counting zero-filled points (i.e. if there is no zero-filling, then framesize = FFT size). Also, if you apply a window to the frame in time-domain prior to FFT, then you need to further divide linear magnitude values by "window factor", which is calculated as sum w[n] for n=0 .. N-1 wf = ----------------------- N For a rectangular window (no window), wf = 1, for Hamming, Gaussian, Blackman, etc. wf < 1. Jeff Brower DSP sw/hw engineer Signalogic