【问题标题】:Beat Signal Plot Matlab节拍信号图 Matlab
【发布时间】:2016-05-24 16:02:07
【问题描述】:

我是 Matlab 的新手,我正在尝试从包含多个心跳的 .wav 文件中提取单个心跳。我已经设法显示整个 .wav 文件,但我不知道如何检测心跳,尤其是绘制它。这就是我所做的:

[y,fs] = audioread('myfile.wav');
y = y(:,1);
    dt = 1/fs;
    N = length(y);
    t = linspace(0, N/fs, N);
    plot(t,y); xlabel('Seconds'); ylabel('Amplitude');

    threshold = 0.6; 
    if(max(y) > threshold) % Here I tried to dectect the first heartbeat but it doesn't work
        plot(t1,y); % t1 should be the duration of one heartbeat
    end

关于如何解决这个问题的任何想法?我试过了,但我认为 Matlab 版本有问题:http://labrosa.ee.columbia.edu/projects/beattrack/

【问题讨论】:

标签: matlab


【解决方案1】:

使用 matlab 内置的findpeaks 函数。这里有一个reference 说明如何使用它。

【讨论】:

  • 谢谢,但现在我有一个高峰,我想知道如何“放大”单个心跳,但我不知道如何用 plot 来做到这一点。
  • 一旦你找到你的心跳,你就可以只绘制你选择的感兴趣的范围。因此,如果您在坐标 x 处找到峰值,这样您的最大峰值在 heartbeat(x) 处,您可以执行 plot(heartbeat(x-range:x+range),您可以在其中适当地定义范围以“缩放”你的巅峰
猜你喜欢
  • 2015-02-26
  • 2015-07-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-08-01
  • 2014-05-21
  • 2013-05-20
  • 1970-01-01
相关资源
最近更新 更多