0
$\begingroup$

I am evaluating how to implement 25Hz low-pass / 25Hz high-pass filter with flat phase response (i.e. FIR). Apparently straightforward FIR filter would require insane number of taps (>8192) which makes it too heavy for all but the most advanced DSP systems.

What are the shortcuts possible to simplify numerical complexity of the task without measurable degradation of quality (i.e. going to IIR filters is probably not an option)? Would it be a feasible strategy to down-sample signal by a factor of ~x64? Is it practical then to get high-pass part by subtracting up-sampled low-pass filtered signal from original?

$\endgroup$
9
  • 2
    $\begingroup$ IIRs are very commonly used for this. The non-flat phase and group delay generally not audible at these frequencies (depending a bit on how aggressive the filter is). Dan has a great way of implementing long FIR but one concern here is latency. That's ok for offline processing, but typically not for any real time or "life" processing system. They also create a lot of pre-ringing which can be problematic to deal with and is IMO perceptually more of a problem than the IIR phase distortion. $\endgroup$
    – Hilmar
    Commented May 25 at 21:18
  • 1
    $\begingroup$ If the application is "high-quality" audio I would put a lot of weight on what Hilmar is saying (he knows this space!), and specifically how an IIR may make a lot more sense. My solution provided here is the way to go if linear phase is absolutely necessary (which shouldn't be the case for audio). Note that in the link I referenced, Hilmar has demonstrated there what the IIR solution would look like in comparison when linear phase is not necessary. $\endgroup$ Commented May 25 at 21:41
  • $\begingroup$ You can definitely do this with an IIR filter of reasonably low order if you don't mind some non-linear phase around the cutoff frequency. That can also be solved with what are called Truncated IIR filters which are actually FIR filters that have recursion. The simplest example is a sliding average filter done efficiently. There is a way you can do a form of filtfilt() in real time, but it's a little messy. Some delay and buffering and overlap-add. All time-domain. Another possibility is what you're doing with a long FIR, but do "fast convolution" with the FFT. $\endgroup$ Commented May 25 at 22:35
  • 1
    $\begingroup$ For a subwoofer channel you can down sample the living daylights out of the signal. They typically top out at a 120 Hz, so even a sample rate of 500 Hz would be plenty (after proper low-pass filtering). The tricky part is to maintain proper time alignment with the other channels since, so latency and delay should be carefully monitored with an overall system perspective. $\endgroup$
    – Hilmar
    Commented May 25 at 23:03
  • 1
    $\begingroup$ @robertbristow-johnson: for band splitters I actually prefer odd order Butterworth. They also recombine to flat but the cross over point is at -3 dB (not -6dB) and the recombined path tends to have less group delay distortion (if you choose the correct sign for the recombination, that is). $\endgroup$
    – Hilmar
    Commented May 26 at 11:55

1 Answer 1

2
$\begingroup$

The approach and suggestions outlined below assume that a linear phase filter is required as stated in the question, and thus this answer outlines a very efficient approach to make linear phase FIR filters with very low cutoff to sampling rate ratios. As Hilmar and RBJ point out in comments, other solutions using IIR approaches would likely be preferable for audio solutions where linear phase is not necessarily preferred.

Yes to both of the OP's suggestions. This is a great application for decimation and then filtering at a lower rate (and then interpolate back to the higher rate if the input / output rate must be 96 KHz). Yes you can subtract the lowpass filter implemented this way from a delay to get the complementary highpass.

The efficient approach is to use polyphase decimation structures. Rather than repeat all the details, please see my answer to DSP.SE #79400 where I have detailed this very approach, including making the high pass and showed the significant reduction in processing required to implement the linear phase FIR filter with a very low frequency cut-off to sampling frequency ratio.

The implementation diagram from that post is copied below, which is equivalent to a 5534 tap FIR filter running at the full rate (in this case it was 48 KHz).

polyphase decimator

I detail these approaches in my "DSP for Wireless Communications Course" which runs routinely through https://dsprelated.com/courses and https://ieeeboston.org/courses/. This course is starting in June 2024 through dsprelated.com with a significant early registration discount for sign-ups before June 5.

$\endgroup$
2
  • $\begingroup$ Dan, I don't think that if the task is just one band-split at around 25 Hz, that the OP needs to go through all the polyphase stuff. They just need a good high-pass filter that they can use subtraction if they want a residual signal that's the DC component and can be sampled at a much lower rate (and maybe imbedded into the metadata if they want to send the DC down the signal path, but encoded in the LSB). $\endgroup$ Commented May 25 at 23:04
  • $\begingroup$ @robertbristow-johnson this would be the approach I would suggest if a linear phase filter is required with such a low cutoff to sampling rate ratio. But agreed if that wasn’t the requirement other IIR solutions would be a good option. $\endgroup$ Commented May 25 at 23:35

Your Answer

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

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