MATLAB: How to make(create) a waveform in matlab as shown in the image

lowpassfilterMATLABsignal processing

Hello,
I am not sure of how to create the kind of waveform shown in the image below. I found a paper in which the author says that the pulse signal is corrupted with noise(motion) and LMS adaptive filtering is used for removing this kind of noise.
1)The signal after removing motion artifacts(noise) means the pure pulse signal is shown below
2)The waveform pulse signal with noise before filtering with LMS adaptive filtering is shown below.
I want to experiment the implementation in matlab and so I need the noise waveform to be created in the matlab.
can someone explain of how to generate the pulse signal(with noise) as above.
thanks.

Best Answer

the first signal is similar to sawtooth signal, here is how to produce the signal :
t=0:0.01:10;
y=sawtooth(2*pi*t); plot(t,y)
axis([0 10 -5 5]); grid on
%snr=10;
%x=awgn(y,snr,'measured');
%figure, plot(t,x)
SNR=10; % 10dB
sigma=std(y)*10^(-SNR/20);
x=y+sigma*randn(size(t));
figure, plot(t,x);
Related Question