how can i remove Baseline wander of an ECG signal by two-stage moving-average filter?

18 views (last 30 days)
Np
Np on 7 Dec 2021
Commented: Star Strider on 7 Dec 2021
i have an ECG siganl
fs = 360Hz
the first and second-stage averaging window
lengths are set to be 1/3 and 2/3 of the length of the
input signal in samples.

Accepted Answer

William Rose
William Rose on 7 Dec 2021
At each point, you replace the original signal with the orignal signal minus the moving average of the signal in that neighborhood.
If x(k)=original signal, k=1..N, and h(k)=moving average filter, k=1..M (where M is odd and M<N),
then you can make a new signal y(k):
y(k)=x(k)-sum{j=-(M-1)/2...+(M-1)/2 of h(j)*x(k+j)}
You'll have to do something at the edges to avoid issues.
  4 Comments
Star Strider
Star Strider on 7 Dec 2021
Thank you!
I removed it because it didn’t address the ‘moving average’ issue. (It exists plentifully elsewhere, since that’s my usual approach to these problems.)
Also, @Naor p needs to Accept your Answer because it correctly addreses the baseline filtering problem using the requested approach. (That’s the other reason I reomoved mine.) I’m voting for it in the interim.
.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!