# Finding out frequency of peaks using the Fourier transform

I have a signal that varies in time as shown below. I have just shown a 5 s interval of data (from 97 s to 102 s). The sampling frequency is 1000 Hz.

My goal is to find out the frequency of the downward peaks in the signal. I used a peak-finding algorithm to detect the peaks in the signal and it turned out that there were about 33 peaks in the 5-second interval – i.e. approx 6.6 every second.

How do I get this information using the Fourier transform? When I plot the power spectral density, I get a peak at 0. Looks like I am doing something wrong. Should I apply some sort of a smoothing function to get rid of noise? Or is there a frequency associated with the system at all?

You seem to conflate the following two concepts typically denoted as frequency:

• The inverse of the period of a periodic signal or component. I refer to this as frequency in the following.

• The number of events (here, dips) per time. I refer to this as rate in the following.

These two are only identical if the events in question are periodic.

How do I get this information using FFT?

You don’t. The Fourier transform tells you something about the frequency of periodic components within the signal. As your dips aren’t periodic, there is no periodic component whose frequency reflects the rate you are looking for.

At best, the Fourier transform can tell you what frequency an underlying periodic signal causing the dips (of which you do not see all for whatever reason) would have, but that would mean that you also take into account dips you are not seeing.

If you want to determine the rate of dips, it is much better to write a routine that detects the dips (as you did). This is not only more robust, but also most likely faster than the FFT.