# Frequency of a periodic signal with distortions

I would like to evaluate frequency of some unstable periodic signal coming from a detector:

The signal is registered continuously and may or may not be present (i.e. be periodic). The frequency and amplitude of the periodic signal can change but stays in some certain range. The shape of the periodic signal is more or less the same as shown on the second image. It may sometimes have distortions of higher amplitude and frequency.

I need to check 1) if there is a periodic signal and 2) what frequency it has.

Is there any good way to do it?

## Edit 1:

I am not sure if FFT is reliable in this case. What do you think?

Frequency spectrum for all data points:

Spectrum with last 512 points

The spectra were calculated using Octave (online) based on example from Matlab site

N = 512; % length(all_data)
x = all_data(1:N);
Fs = N;
xdft = fft(x);
xdft = xdft(1:N/2+1);
psdx = (1/(Fs*N)).*abs(xdft).^2;
psdx(2:end-1) = 2*psdx(2:end-1);
freq = 0:Fs/length(x):Fs/2;
plot(freq,10*log10(psdx));

-
try to fourier transform it and see if there is a stronger harmonic or it has different contributions of the same amplitude – Jorge Jan 17 '13 at 9:49
Yes, that was my first idea too, but it doesn't look so good (see updated question). I could probably get better spectrum knowing signal frequency range... – Andrei Jan 17 '13 at 10:43
There seem to be some frequency components in the range 20-60 on your first plot. You could try a bit of frequency domain averaging to see if it makes them any clearer. – twistor59 Jan 17 '13 at 12:53
Lookup "peridogram" – daaxix Jan 18 '13 at 20:34