Adding Noise To An ECG Signal

19 views (last 30 days)
Tugce koc
Tugce koc on 7 Dec 2022
Answered: Walter Roberson on 7 Dec 2022
Hi. I m trying to add noise to this ecg signal but ı could'nt understand what is the mistake of my code. How can I add noise to this ecg signal?
clear
signal = load ('ecgsignals.txt');
plot(signal);
xlabel('Samples');
ylabel('Electrical Activity');
title('ECG Signal Values in 100 Hz');
hold on;
noiseSignal = randn(1, signal);
newSignal = noiseSignal + signal ;
plot(newSignal);

Answers (1)

Walter Roberson
Walter Roberson on 7 Dec 2022
signal = load ('ecgsignals.txt');
plot(signal);
xlabel('Samples');
ylabel('Electrical Activity');
title('ECG Signal Values in 100 Hz');
hold on;
noiseSignal = randn(size(signal));
newSignal = noiseSignal + signal ;
plot(newSignal);

Categories

Find more on ECG / EKG in Help Center and File Exchange

Tags

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!