Can anyone help me on implementing gaussian noise on an ecg signal? If you want i can share my code. The problem is gaussian noise is 0 always.

4 次查看(过去 30 天)
sig = 1/abs(Fs) for i = 1:L gauss(i) = exp(-(i*i)/(2*sig*sig))/(sig*sqrt(pi*2)); dist(i) = gauss(i)+ x(i); i end
subplot(2,1,2); plot(t(1:L),dist(1:L)) title('Dist ECG Signal')

回答(2 个)

Chunru
Chunru 2021-7-11
Fs = 1; L = 128;
x = zeros(L, 1); % This can be your original signal
sig = 1/abs(Fs); % std of Gaussian random noise
%{
for i = 1:L
% This is Gassian pdf function, not Gaussian distributed time series
gauss(i) = exp(-(i*i)/(2*sig*sig))/(sig*sqrt(pi*2));
dist(i) = gauss(i)+ x(i);
end
%}
y = x + randn(L,1) * sig; % signal + Gaussian noise (doc randn)
plot((1:L), y)
title('ECG Signal with Gaussian Noise added')

LO
LO 2021-7-11
I tried to fit some params,
you can use the function wgn (white gaussian noise, see documentation)
Fs = 20000;
sig = 1/abs(Fs) ;
L = 100;
x= rand(1,1000);
t=[1:1000];
for i = 1:L
gauss(i) = exp(-(i*i)/(2*sig*sig))/(sig*sqrt(pi*2));
dist(i) = gauss(i)+ x(i);
i
end
noise = wgn(1000,1,0);
subplot(2,1,1);
plot(t(1:L),noise(1:L))
title('white gaussian noise ECG Signal')
subplot(2,1,2);
plot(t(1:L),dist(1:L))
title('Dist ECG Signal')

类别

Help CenterFile Exchange 中查找有关 ECG / EKG 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by