how to filter data by rate of change?

4 views (last 30 days)
I am trying to filter signal, where data of certain rate oif change is filtered out. I am not able to achieve my goals, for example with lowpass (tried for example lowpass(yTemp, 10, Fs2). below is plot with original signal to be filtered (blue) and with red, I have hand drawn what how I would like to filtered signal to behave. Of course it doesent need to be precisely like drawn, its just for example, to illustrate the point.
data is in attachment (x,y,Fs).
all help is appreciated

Accepted Answer

Mathieu NOE
Mathieu NOE on 6 Feb 2025
Edited: Mathieu NOE on 6 Feb 2025
hello
I was thinking that I could use the "baseline" correction approach, then apply a scale factor on the baseline compensated signal , add some smoothing then put back the base
and this is the result so far :
load('vars.mat')
% option # 1 : obtain the lower envelope data
N = 200;
[up1,down1] = envelope(yTemp,N,'peak');
% now apply smoothing on baseline corrected data and put back the baseline in
yc = yTemp - down1;
yscale_factor = 0.25; % apply only a fraction of yc (baseline corrected signal)
yTemps = smoothdata(yscale_factor*yc,'gaussian',2*N) + down1;
figure
plot(x,yTemp,x,down1,'--',x,yTemps,'linewidth',2)
legend('signal','lower envelope','smoothed');
  5 Comments
Sven Larsen
Sven Larsen on 7 Feb 2025
what is peak_stripping in your line:
[Baseline, stripping]=peak_stripping(S,n);
Mathieu NOE
Mathieu NOE on 7 Feb 2025
sorry, forgot to give you that function too
see attached :)

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!