How do I find the period or frequency of a signal?

311 次查看(过去 30 天)
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.

采纳的回答

Star Strider
Star Strider 2018-3-7
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.
  5 个评论
jb4earth
jb4earth 2019-9-19
@Xu you are correct
PEAK period should be calculated as:
peak_wave_period = max(diff(your_time_vector(peaks)))
DoubleO7
DoubleO7 2019-10-15
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.

请先登录,再进行评论。

更多回答(1 个)

Dmitry Grigoryev
Dmitry Grigoryev 2020-10-14
编辑:Dmitry Grigoryev 2020-10-14
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.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by