MATLAB: How to find the period or frequency of a signal

frequencysignal

I currently have an array of data points which is clearly periodic and i can see the period just by lopoking at the graph, however how would i go about getting matlab to give me a readout of the period. One problem with finding the distance between peaks is that they are faily noisey so was thinking of finding distance between the dips, but i am having trouble workiing out how i would go about doing that.

Best Answer

I would first detrend (link) your data, then use findpeaks (link) to identify the peaks and their locations. Use the location information to calculate the period and from that, frequency.