How to plot ECG and more...
조회 수: 22 (최근 30일)
이전 댓글 표시
Hello, I have a lot of questions...My assignment is to plot ECG signal from .txt file.
After loading this file to MATLAB I can see, that in the first column is index of samples, the second and the third one are filled with ECG signal from two different samplings. I have to focus on the second column. So I do that:
x = load('c:/.../1.txt');
y = x(:, 2);
What should I do next? Becasue when I plot the 'y' it doesn't look right...I know that Fs for this ECG signal is 360Hz. Then I have to add a sinusoidal noise(50Hz) and try to use filters to clear signal.
I hope that somebody will help me...
댓글 수: 0
채택된 답변
Rick Rosson
2012년 1월 3일
1. Please try the following:
N = size(y,1);
Fs = 360;
dt = 1/Fs;
t = dt*(0:N-1)';
figure;
plot(t,y);
2. When you say "it doesn't look right", what specifically do you mean? What did you expect it to look like, and how does it differ from what you expected?
HTH.
Rick
댓글 수: 1
Timothy Dixon
2012년 5월 19일
Mr Rick, please i need your help, am working on a project to compare an ECG signal and EPsig signal. i could manage to generate and analyze the ECG signal but need help for matlab command for EPsig signal.
command needed: generating EPsig signal at a cut off frequency of 30Hz, add noise and use any filtering techniques
Thanks
추가 답변 (2개)
Rick Rosson
2012년 1월 4일
Hi Lukas,
- Please try using the Zoom tool from the figure window's toolbar to zoom in closer to the plot; I think you will see that it looks a lot more like an ECG when you zoom in to an appropriate scale than it does from the global view.
- It looks like there is a pretty significant distortion in the signal between t = 115 and t = 118. I would suggest that you discard the portion of the signal after t = 112 or so to eliminate the effect of this anomaly.
- Please try using the fft and fftshift functions to compute the Fourier spectrum, and then plot the magnitude response (using the abs function) versus frequency (in hertz). I think you will see that there is some low-frequency noise or interference superimposed on the signal-of-interest.
- If you have access to the Signal Processing Toolbox, you may want to create a High-Pass-Filter and then apply the filter to reduce the low-frequency noise.
HTH.
Rick
댓글 수: 1
Muhammad Anas
2017년 2월 7일
편집: Muhammad Anas
2017년 2월 7일
참고 항목
카테고리
Help Center 및 File Exchange에서 ECG / EKG에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!