Plot ECG based on heart rate
显示 更早的评论
Hi all,
I'm working on a function that returns a plot based on the heart rate of the user. Example: if the user's heart rate is 60 BPM, the plot will display 10 beats in 10 seconds or 20 beats in 10 seconds if it's 120BPM. I have an ecg.m function I downloaded from here that I'm using to create and replicate an ECG pattern. I'm having problems getting the plot to display in seconds rather than samples. I'm also hoping to do a live ECG view using dsp.timescope. If one or both of these could be solved that would great!
Best, Chris
4 个评论
Christopher Houk
2017-10-27
编辑:Christopher Houk
2017-10-27
Maitreyee Mordekar
2017-11-2
Hi Christopher,
Could you please share the ecg.m file? That will help us understand the issue better.
Regards, Maitreyee
Christoph F.
2017-11-2
编辑:Christoph F.
2017-11-2
ecg() is a MatLAB function. I think it is part of the signal processing toolbox.
Maitreyee Mordekar
2017-11-6
Hi Christoph F.,
I meant to ask if he is referring to a MATLAB shipping example or the following file exchange submission:
Anyways, thanks for answering his query :)
Cheers, Maitreyee
回答(1 个)
Christoph F.
2017-11-2
编辑:Christoph F.
2017-11-2
> I'm having problems getting the plot to display in seconds rather than samples.
It looks like your t vector is in samples instead of seconds.
Fs = heartRate/60;
x = ecg(2700);
...
t = linspace(0, 15999, 16000)/Fs;
The actual sampling rate is 2700*Fs, not Fs. Try
t = linspace(0, 15999, 16000)/(2700*Fs);
Side question: How is the "heart rate" of the user determined for this function? Is it a given value used for generating ECG test signals?
类别
在 帮助中心 和 File Exchange 中查找有关 Scopes and Data Logging 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!