0
$\begingroup$

I recently discovered that one may be able to further optimize an FIR filter processing time by skipping calculations of coefficients whose values are zero, providing that the filter is about halving the input signal frequency.

I gave it a try but the result was completely different, although there is some filtering happening, it's way closer to the original signal than the signal processed by a filter for which I don't skip these coefficients close to zero.

The original FIR filter I designed was as follows:

  • for a sampling rate of 44100Hz
  • cutoff frequency is 11025Hz
  • transition bandwidth is 441Hz
  • window type is Blackman
  • the number of resulting coefficients is 461

If that's of any importance, I designed it using the FIIIR! website.

What I've done to try that half-band trick is:

  • created a new array that 461 / 2 + 1, i.e. 231 coefficients
  • added every coefficient whose index is odd, e.g. 1, 3, 5, etc
  • inserted the middle coefficient at the middle of that array

The results are as follows:

  • orange is the sound unfiltered
  • blue is the sound filtered using the FIIIR! website coefficients (the expected result)
  • green is the sound filtered using that half-band optimization explained above (failed attempt)

enter image description here

There is something that is not right but I can't figure it out as I'm not exactly an expert in DSP.

Question:

Can you pinpoint where the problem is or does that half-band trick not applicable in my case?

For reference, where I learned about that half-band filtering trick:

$\endgroup$
3
  • 2
    $\begingroup$ If I understood correctly, you created a new filter with all non-zero coefficients of the half-band filter, but with just single delays between the coefficients. You can of course skip the multiplications with zeros, but you can't just throw away the extra delays between the coefficients. $\endgroup$
    – Matt L.
    Commented Jul 8, 2023 at 12:49
  • 2
    $\begingroup$ It looks like something is wrong either with your filter or implementation (which is my guess here). We can't really tell for sure unless we see you filter coefficients and your actual code. $\endgroup$
    – Hilmar
    Commented Jul 8, 2023 at 13:16
  • 1
    $\begingroup$ That worked, indeed the delays have to remain the same, thanks!!! 🥳 $\endgroup$
    – aybe
    Commented Jul 9, 2023 at 0:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.