I have implemented digital high pass filter with below specs:

Sampling frequency = 5333 Hz
Cutoff frequency = 10 Hz
Order = 3

We are facing problem like below:result of high pass filter

As per result shown above signal gets attenuation after $1000$ data points. How can solve this kind of issue?

Any help/ suggestion would be great and appreciable! Thanks in advance.

  • 2
    $\begingroup$ Please show us the unfiltered data and then the filtered data. $\endgroup$ – Ben Nov 2 '20 at 14:20
  • 1
    $\begingroup$ Also, what is the filter transfer function ? $\endgroup$ – Ben Nov 2 '20 at 14:21
  • $\begingroup$ If the filter you are using has a long impulse response, it will take a large number of samples to essentially fill/enter the filter before it becomes effective. Additionally, if the frequency content in the first 1000 samples is in the passband of the filter, then it wouldn't be much. $\endgroup$ – David Nov 2 '20 at 14:30
  • $\begingroup$ @Ben Unfiltered Data Filtered Data $\endgroup$ – Ankit Chudasama Nov 4 '20 at 11:07
  • $\begingroup$ Transfer Function: $$ y = {(0.9883 s^3 - 2.965 s^2 + 2.965 s - 0.9883)} / {(s^3 - 2.976 s^2 + 2.953 s - 0.9767)} $$ $\endgroup$ – Ankit Chudasama Nov 4 '20 at 11:12

Any filter with such a low cutoff (as compared to the sample rate) will lots of time domaing ringing.

The best way of adressing this is to properly initialize the state of the filter using known properties of your system & signal, but that's fairly tricky.

In your case, there may be a shit cut though: I'm guessing that you have a large bias or DC offset in your original signal. Just subtract the mean (or maybe the mean over the first samples or so, if the bias is drifting). This should subtantially reduce the ringing.

  • $\begingroup$ Can you please bit more explain about initialize the state of the filter? Thank you for your solution which reduce the ringing effect. $\endgroup$ – Ankit Chudasama Nov 4 '20 at 13:25
  • $\begingroup$ That's probably a topic for a seperate question. In short, all filters have state variables, which are the delay buffers . The content depends a lot on the topology of the filter (Direct Form I, Direct Form II) etc. Typically they are initialized to zero at the beginning of the signal. If you have a priori knowledge about the signal you may be able to initialize them to something more "intelligent:". $\endgroup$ – Hilmar Nov 5 '20 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.