MATLAB: Generating baseline wandering noise

MATLAB

How to generate baseline wandering noise in matlab code?

Best Answer

Here is one way:
t = linspace(0,10*pi,1000);
s = sin(t);
sn = 0.3*cos(t./4);
figure(1)
subplot(2,1,1)
plot(t, s)
title('Signal with constant baseline')
grid
subplot(2,1,2)
plot(t, s+sn)
title('Signal with with wandering baseline')
grid