How can I lower to 0 the base of a window signal?

1 visualización (últimos 30 días)
Roxana Maria DRAGHICI
Roxana Maria DRAGHICI el 26 de Mayo de 2022
Comentada: Walter Roberson el 12 de Jun. de 2022
L.E.: signal.*abs(signal)/max(abs(signal)) worked for me if anyone else comes across this issue
Hi! I have this signal, obtained by smoothing the absolute an ECG signal.
I need to create these windows. For that, I have to set the base to 0. Can anyone help me, please?
  1 comentario
Walter Roberson
Walter Roberson el 12 de Jun. de 2022
signal.*abs(signal)/max(abs(signal))
is not going to solve the problem you asked about. In the below, notice that your formula leaves negative values (instead of changing the base to zero), and your formula distorts values near 0.
x = linspace(0, 4);
signal1 = 10 * exp(-(x-1).^2*5) - 2;
signal2 = 7 * exp(-(x-3).^2*5) - 3;
signal = signal1 + signal2;
figure
plot(x, signal1, x, signal2, x, signal);
legend({'pulse1', 'pulse2', 'sum'});
title('original');
signal2 = signal.*abs(signal)/max(abs(signal));
figure
plot(x, signal2); title('scaled')

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 26 de Mayo de 2022
subtract min(signal) from signal
  1 comentario
Roxana Maria DRAGHICI
Roxana Maria DRAGHICI el 26 de Mayo de 2022
Hello!
Thank you very much for the answer! I tried what you told me, but nothing happened, unfortunately. I tried (signal-min (signal)). Or did you mean something else?

Iniciar sesión para comentar.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by