Offset removal from a sinusoidal wave
Mostrar comentarios más antiguos
Hello Everyone,
I have an input waveform as shown in the figure in blue. It is a sinusoidal wave but due to different offests during positive and negative half cycles, it looks distorted. Basically, there is a big jump whenever signal changes direction from positive to negative and vice versa. So, I want to remove offsets from individual half cycles. I want an output which looks as red in the figure, which is just shifting of top and bottom parts of the waveform, taking zero as the baseline, excluding the big jumps. I have attached the input csv file as well. If anyone has any idea, how to approach it, please let me know, I will be thankful.

Respuesta aceptada
Más respuestas (1)
darova
el 18 de Feb. de 2021
I have an idea
clc,clear
x = linspace(0,20,100);
y = sin(x);
ind = -0.5<y & y<0.5;
x1 = x(~ind);
y1 = y(~ind);
y1 = y1 - sign(y1)*0.3;
plot(x,y)
hold on
plot(x1,y1,'.r')
hold off

1 comentario
Mohammad Zulqarnain
el 19 de Feb. de 2021
Categorías
Más información sobre Waveform Generation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

