In part 1 of this article series (here), I laid out a few guiding principles regarding Finite Impulse Response (FIR) filters. Here’s a quick review:
1) With FIR filters I can have very steep LP and HP filters, such as might be used in a crossover network, that have linear group delay (same delay for all frequencies).
2) The magnitude and phase response of a FIR filter can be adjusted independently. In an Infinite Impulse Response (IIR) filter they are interdependent – you can’t change one without changing the other.
3) WAV impulse responses by definition are FIR filters, since they are fixed in length and cannot (theoretically) decay for infinity. Any IR you measured can potentially be used as a filter.
So, let’s create some FIRs.
Creating The FIR Filter
I created my FIR filters in software, using the freeware rePhase to define a high-pass filter (HPF) and low-pass filter (LPF) based on a few input variables (Figure 1). You’ll want to add rePhase to your toy box for investigating FIRs. (I’ll show some other FIR-creation tools in future installments of this series.)
I’ll create a 1 kHz brickwall HP filter. FIR filters are defined by the number of “taps.” This is a way of specifying the length of the impulse response. The number of taps is equal to the number of samples.
Basically, the more taps, the more samples, the longer the time length, and the greater the precision. The greater the precision, the greater the “sharpness” that can be attained in the frequency domain. Just as you need a long time window to resolve low frequencies when performing acoustical measurements, you need a lot of taps (long IRs) for detailed low frequency FIR filters.
Let me demonstrate. Figure 2 shows the response of a 60 tap, 1 kHz HPF, the response of a 600 tap HPF, and the response of a 6000 tap HPF. Clearly, the 6000 tap filter can be described as “brickwall.” That’s the one we want, right? This is audio, and you never get something for nothing.
The latency through an FIR is one-half the number of taps, so the signal through this filter will be delayed by 3000 samples. At 44.1 kHz, that’s a bit over 60 milliseconds (ms). While that might be acceptable in a home playback system, it might as well be next week for live sound. I’m going to stay with this to illustrate the concept, but in the real world we’d have to give back some of the precision to reduce the latency.
I created a 1 kHz LP filter in the same manner. Since these brickwall filters essentially do not overlap, I don’t have to worry about how they interact. Filter interaction is a main concern for analog and IIR digital filters.
These are “brickwall” filters that produce no frequency-dependent delay. Note how wacky the phase response gets in the stop band. That’s because the magnitude response is down about 80 dB. If there is no magnitude response (i.e., no signal output from the filter), then the phase is meaningless and looks like garbage.
rePhase allows the filters to be saved in multiple formats, including WAV files (Figure 3). They can be convolved with any audio signal in real time or as a post process.