adding noise to an ecg signal

45 次查看(过去 30 天)
Katherine
Katherine 2011-7-15
评论: MD 2023-8-10
Hi,
I am trying to add 50Hz noise to an ECG signal (imported from ASCII file) so that I can test my 50Hz notch filter. I have plotted my ECG data and have designed my '50Hz noise sinusoid' but how do I go about adding the noise to the signal?
I am a novice at MATLAB so any help would be great.
PS - I have tried +, and plotting together but the problem seems to be about the matrices not matching?
Thanks in advance
Katherine

回答(3 个)

Arturo Moncada-Torres
I would do something like this:
% Sampling
fs = 1000;
Ts = 1/fs;
% Time vector
t = 1:Ts:10-Ts;
% Signal
f = 1; % Frequency [Hz]
a = 1; % Amplitude
signal = sin(2*pi.*t.*f); % Sample sinusoidal signal. Your ECG signal goes here.
% Noise
fNoise = 50; % Frequency [Hz]
aNoise = 0.25; % Amplitude
noise = aNoise*sin(2*pi.*t.*fNoise);
% Signal + Noise
signalNoise = signal + noise;
% Plots
figure();
subplot(3,1,1);
plot(t, signal);
xlabel('Time [s]');
ylabel('Amplitude');
title('Original signal');
subplot(3,1,2);
plot(t, noise);
xlabel('Time [s]');
ylabel('Amplitude');
title('Noise');
subplot(3,1,3);
plot(t, signalNoise);
xlabel('Time [s]');
ylabel('Amplitude');
title('Original signal + Noise');
The trick is that your noise signal must have the same length than your ECG signal. If you do it this way, you can warranty that. Try it and let me know if it works ;-)
  9 个评论
Aparna Gupta
Aparna Gupta 2017-6-25
Dear @Walter Roberson sir, Sir can u help me with my queries??
Ganesh Makkapati
Ganesh Makkapati 2020-5-29
actually a sinusoidal signal is adding to other sinusoidal signal
but the same not working instead same ecg signal is appearing
what could be the reason

请先登录,再进行评论。


Fangjun Jiang
Fangjun Jiang 2011-7-15
You must have you ECG signal data. You need to know the time step of the data,i.e. what is the elapsed time between the first data and second data. Then you need to know the length of your ECG signal, i.e. how many total time does your ECG signal last. Then you need to generate your noise signal use the same time step and generate the signal with the same length. Then you can simply add them together.
Do you have Simulink? If you do, it's much easier doing this in Simulink. You can use the FromWorkspace block to import your ECG signal, then add a periodical sinusoid noise. You don't need to worry about the length of the noise signal because it simply repeats again and again.
  1 个评论
MD
MD 2023-8-10
what is procedure for adding noise in ecg signal?. i use from file block to load ECG signal but i have d'not idea which block i introduce for noise and how i use filter for removing that noise ? if you any idea then please help me.

请先登录,再进行评论。


Umesh Pande
Umesh Pande 2016-6-1
Hello sir i am working on project to remove 50hz noise from ECG signal using TVLMS algorithm in Matlab can you guide me

类别

Help CenterFile Exchange 中查找有关 Single-Rate Filters 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by