【问题标题】:How to measure the period between the peaks or lows of waves?如何测量波峰或波谷之间的周期?
【发布时间】:2015-10-22 13:05:15
【问题描述】:

我想测量图中显示的相邻波的峰值/低点之间的周期。

这是细胞中钙浓度的振荡行为。峰值不一样,因此我需要计算每个波的峰值/低点获取与峰值/低点相关的相应时间,以及找出相邻峰值/低点之间的差异。我已经存储了每次“0.01”的钙浓度值。

谁能建议我应该如何编码?我更喜欢使用更小的代码行。

【问题讨论】:

    标签: matlab period


    【解决方案1】:

    查看内置的findpeaks 函数,该函数可以返回信号中的峰值索引。

    您还可以通过首先对信号进行平方来找到信号中的低点。这样的东西可以工作(我没有在 MATLAB 中尝试过,所以可能存在一些语法问题):

    % Square the signal so that the lows become peaks
    signal = signal .^ 2;
    
    % Get the location of the peaks in terms of t (your time vector)
    [~, peaksAndLows] = findpeaks(signal,t)
    
    % Find the difference between consecutive peaks/lows
    periodsBetweenPeaksAndLows = diff(peaksAndLows);
    

    【讨论】:

    • findpeaksdiff 就像一个魅力。非常感谢@Sam
    • 不用担心,很高兴它有帮助!
    猜你喜欢
    • 2019-09-11
    • 2012-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多