1
$\begingroup$

I am using some bandpass filters to detect a certain freq of the sampled audio series in noisy environment. Everything is OK except this: I found that for many bandpass filters I tried(butterworth, window based FIR etc.) The audio signals' beginning points(about 50~100) always distort after the filter. For example: [![enter image description here][1]][1]

I am new to DSP so maybe I didn't express in an scientific way... What I mean by "distortion" is that in some cases these beginning points should have been filtered out but they were not, and in other cases vice versa.After these distorted points, everything becomes fine... Could u plz help me on this issue? Thank you very muchenter image description here

To make this question more clear, below is a plot consists of 2 waveforms, the blue one is the original audio signal sampled, and the brown one is the sampled signal passed butterworth filter.It doesn't like filter delay stuff.enter image description here

$\endgroup$
1
$\begingroup$

That's the filter's output transient, whose length is dependent on the effective length of the filter impulse response. If you are performing block based filtering, then only the very first block should exhibit it and later subsequent blocks should not display this transient, due to properly set initial values.

$\endgroup$
  • $\begingroup$ Thank u, u pointed a right direction for me...is there a way to eliminate the transient effect?(or minimize it) cuze' ideally I wanna keep every point in my sampled signal $\endgroup$ – WSL Sep 7 '17 at 21:20
  • $\begingroup$ a short transient requires a short impulse response. You cannot completely eliminate it, especially when the signal is suddenly applied. But as I said, only the first block will have it and later blocks will be ok. $\endgroup$ – Fat32 Sep 7 '17 at 21:26
  • $\begingroup$ 2 ways (at least) to remove initial transient: Start sampling that much earlier, before you need data, and discard transient portion after filtering. Filter the data backwards in time. $\endgroup$ – hotpaw2 Sep 8 '17 at 0:14
  • $\begingroup$ @hotpaw2 thanks for reminding the methods. The first is a practical one (that several variants of it can be used). I was more inclined on an explanation of what was happening at the beginnning portion of the filter output. There's still a transient there but it's not what we care practically. The forward backward (zero phase) filtering requires a noncausal (offline) application if its not a matter. In addition the magnitude response should be carefully designed to match the original filter's response. The transient is not eliminated but the central portion of the output is taken. $\endgroup$ – Fat32 Sep 8 '17 at 0:54
  • $\begingroup$ Thank you for u 2, actually my filtering is real-time, so I have to give up IIR and use FIR instead? ( Real-time means that after a block of sampled data comes, I need to do an immediate filtering and do other calculations when I am waiting for another block of data to come) $\endgroup$ – WSL Sep 8 '17 at 0:59

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.