1
$\begingroup$

I would like to roughly estimate the mean amplitude over a frequency range (2-3hz). My impression was that I could transform the data using FFT, and just take the mean of the sub part of the output (absolute values).

However, the input I provide to numpy.fft.fft is in the range -1.5 to 2.5, while the output (absolute values) are in the range of about 0-6500. Do I need to scale the y-values somehow?

Any other suggestions on how to roughly estimate the mean amplitude of a frequency range?

Update:

The problem is that I am doing peak detection and want to discriminate out (as noise) all peaks that are smaller than 10% of the rest of the peaks. The majority of the peaks are expected to have rather equal amplitudes, and it is 10% of this amplitude that all peaks must at least be.

$\endgroup$
  • $\begingroup$ Hi, welcome to dsp stack exchange. Why don't you share your actual code and your test data? The fft should return complex numbers where the magnotude represent the amplitude integral. Also, you could use some other approach like power estimation at the output of a bandpass filter. Goertzel algorithm may also interest you, but to guide you right, we would need you to explain your problem, not what you think is the solution to your problem (evaluating mean amplitude). $\endgroup$ – Pier-Yves Lessard Jan 14 '18 at 20:46
  • $\begingroup$ Thanks, updated the question with a brief explanation of the problem. $\endgroup$ – user237948 Jan 14 '18 at 22:33
  • $\begingroup$ It sounds like your peak detection works off of the relative amplitudes, so why would you need to scale? Is the issue that you are confused why some of the FFT samples have magnitudes such much greater than any of the input samples? $\endgroup$ – AnonSubmitter85 Jan 15 '18 at 2:18
  • $\begingroup$ You might find this helpful too. $\endgroup$ – A_A Jan 15 '18 at 8:52
1
$\begingroup$

The Discrete Fourier Transform is a summation :

$$ X_k =\sum_{n=0}^{N-1}x_ne^{-j2\pi kn/N} $$

Which means, the more data you have, the bigger the output mangitude. What you can do is normalizing your output by dividing the magnitude of the result by the number of samples in your signal.

I would invite you to check this question for more details.

On a side note, you may want to consider zero padding for better peak detection accuracy. Also, if you intend to filter out the noise by suppressing the peaks that you consider noise and then do an inverse FFT, you will gain to read this other question

We could most likely help you more if you gave more details about your problem as I suggested in my comment.

Hope that helps.

$\endgroup$
1
$\begingroup$

Working in the frequency domain doesn't like a good idea because there is no direct relation between the amplitude of the harmonics and the height/position of the peaks.

It should be much better to consider an histogram of the peak amplitudes (in the signal domain) and estimate the mode.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.