Extracting a signal with highest peak values

2 views (last 30 days)
As shown in the image, I have two signals, one is smaller (blue) and the other is a bigger (red). I found the max peaks for both, and then set a conditional statement to find only peaks of the bigger red signal. Now I was to get rid of this signal entirely, so I only have the blue signal left. How do i do this?
Here's my code
n = length(val);
Ts = 1000;
t = (0:n-1)*Ts;
plot(t, val);
xlabel('Time(seconds)')
ylabel('Amplitude (mVolts)')
title('ECG Signal')
axis tight
hold on
[pk, loc] = findpeaks(val,t);
plot(t, val, loc, pk, 'o')
figure()
n = length(val);
Ts = 1000;
t = (0:n-1)*Ts;
plot(t, val);
xlabel('Time(seconds)')
ylabel('Amplitude (mVolts)')
title('ECG Signal')
axis tight
hold on
minValue = min(val);
val(val < 50) = minValue;
[pk, loc] = findpeaks(val,t);
plot(t, val, loc, pk, 'o')

Answers (0)

Community Treasure Hunt

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

Start Hunting!