Dc off-set Analysis - Maatlab code

1 reply · 2K views · last reply
Hzaqa
Messages
15
Reaction score
0
Hi,

I am trying to use Matlab to analyse this raw signal by introducing Dc-offset analysis:
MATLAB plot of a noisy blue signal: near zero, then a block of dense high-amplitude fluctuations between about 50 and 200 on the y-axis, then back to zero.


I used the following code :
a = [1 , -0.98]; b = [1,-1];
y = filtfilt(b,a,x);
figure
plot(y)

And the result :

MATLAB plot of a signal over time: flat near zero, then a dense burst of blue oscillations spanning roughly -80 to 100 on the vertical axis, then back to zero.



But, I am trying to get a final result similar to the last graph,
Can you please tell methe exact code to achieve this:

Blue MATLAB plot of a noisy signal: values scatter between about 50 and 200 on the y-axis from the start until near the end, then drop sharply to about 0 and stay flat.


Thank you very much
 
Attachments
  • MATLAB plot of a noisy blue signal: near zero, then a rectangular burst of dense high-amplitude fluctuations between about 50 and 200, then back to zero. Y-axis ticks 0 to 250.
    11.png
    5.1 KB · Views: 456