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.
조회 수: 7 (최근 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')
댓글 수: 0
답변 (2개)
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')
댓글 수: 0
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')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Measurements and Feature Extraction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!