# Interpreting frequency spectrum of periodic probabiltiy distribution

I'm not sure how to interpret the frequency spectrum produced from some discrete data below.

Below is a probability distribution for a simulation I'm running that varies with time (each point on the plot represents a time step). To me, both the blue and the orange data series seem to have a period of around ~38 steps. I ran the simulation for more steps to get a great frequency resolution and applied the matlab fast Fourier transform algorithm to get the frequency spectrum of the data. I converted the x axis into Hz using the Nyquist frequency (sample rate = 1 per step, n steps in simulation). The spectrum shows two clear peaks but neither directly corresponding to a period of ~38. Treating the periodic nature like beating caused by two waves of similar frequency (i.e finding the difference of the two waves) gives a period of around 10, which isn't correct.

Any light on interpreting the freq spectrum would be greatly appreciated.

• If your period is 38 samples, you would expect the peak to be at a normalized frequency of 1/38, no? $1/38 \approx 0.026$, where exactly is your peak? Otherwise, be careful with units. Your time signal is samples (not seconds) so your frequency cannot be Hertz, it can only be normalized frequency. If you want Hertz, you need to define your sampling interval ($t_0$) in seconds. Then your period is $38t_0$ (seconds) corresponding to a peak of $1/(38 t_0) = 1/38 f_s$. – Florian Apr 23 '17 at 10:31
• Ah yes, apologies about the units, my default plot label. The peak is at about 0.032 (normalised units) which corresponds to a period of around 31 samples. This is some way off what is shown in the first figure. Perhaps this is because of the second frequency component at about 0.47? I'm not sure how to quantify the effect of both frequency components together in the time domain. – Sean Apr 23 '17 at 10:44
• Hm, sure about the 38? If I follow your blue curve it has its third maximum very close to sample 94 and $94/3 \approx 31.33$... 38 would mean the third maximum would not even be visible within the first 100 samples. So it's clear that it must be less than 38. – Florian Apr 23 '17 at 10:55
• @Florian $3/94 \approx 0.032$. My estimate of the first frequency spike (counting pixels) is about $0.5 \times 27/433 \approx 0.031$ which seems very close – Henry Apr 23 '17 at 11:29
• I believe you are right. This then does correspond to the first peak in the frequency spectrum. Do you know what effect the second smaller peak has in the time domain? Thanks – Sean Apr 23 '17 at 11:34