adding noise to an ecg signal
    조회 수: 16 (최근 30일)
  
       이전 댓글 표시
    
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
댓글 수: 0
답변 (3개)
  Arturo Moncada-Torres
      
 2011년 7월 15일
        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
  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
      
      
 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
 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
 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
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 Single-Rate Filters에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!








