How do I find the period or frequency of a signal?
60 views (last 30 days)
Show older comments
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.

0 Comments
Accepted Answer
Star Strider
on 7 Mar 2018
5 Comments
jb4earth
on 19 Sep 2019
@Xu you are correct
PEAK period should be calculated as:
peak_wave_period = max(diff(your_time_vector(peaks)))
DoubleO7
on 15 Oct 2019
I was wondering if anyone could expand upon this answer. What do you mean by time vector? Would an example of a time vector be:
tv = 1:100;
Is writing the following code correct for displaying the period?
[pks,locs] = findpeaks(data,tv)
period = max(diff(locs))
I appreciate your input.
More Answers (1)
Dmitry Grigoryev
on 14 Oct 2020
Edited: Dmitry Grigoryev
on 14 Oct 2020
Start by substracting the sliding average from the raw signal.
Then shift the signal by rougly 1 period and use autocorrelation to find the exact period value.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!