When I generate a *.Frd file with an IIR high pass filter(boost) and a FIR low pass crossover (125 hz) even with a high tap count. The low frequency is truncated instead of boosted. I thought the tap count is irrelevant for IIR filters. The same number of taps with just the FIR filter matches the crossover transfer function perfectly.
Using FIR for low pass will always require a high(er) number of taps. Especially that low.with an IIR high pass filter(boost) and a FIR low pass crossover (125 hz)
A little more context would help.
Do you mean that you're creating a peaked highpass IIR filter? What cutoff frequency and how much boost? What filter order?
Fixed point? How many bits?
Floating point? Single-precision or double-precision?
High-Q IIR filters at very low frequencies can suffer from problems with coefficient precision.
Do you mean that you're creating a peaked highpass IIR filter? What cutoff frequency and how much boost? What filter order?
Fixed point? How many bits?
Floating point? Single-precision or double-precision?
High-Q IIR filters at very low frequencies can suffer from problems with coefficient precision.
Even low-Q IIR filters have issues with precision. First: poles and zeros will land at only certain frequencies because incrementing a limited precision word by a single bit will shift them by a considerable amount. Second: lowpass IIRs have gain roughly proportional to the square of (sampling frequency divided by corner frequency), which for a given word length decreases resolution by that amount.
Say you're working in 24 bit words, as Motorola DSPs have, and you design an IIR with a 48 Hz corner at a sample rate of 48 kHz. The gain will be (48000/48) squared, or about a million. Now the 24 bit word has a range of about +-8 million, so to keep the filter internal nodes from saturating you need to downscale the input by the aforementioned million, which reduces the range to +-8, or about 4 bits. Not ideal.
You can go to 32 bit integers so your dynamic range is increased to 12 bits, or 64 bit double precision where the mantissa is 52 bits so error becomes inconsequential. Alternately, in fixed point if you can access the lower half of the accumulator then noise shaping becomes possible.
Say you're working in 24 bit words, as Motorola DSPs have, and you design an IIR with a 48 Hz corner at a sample rate of 48 kHz. The gain will be (48000/48) squared, or about a million. Now the 24 bit word has a range of about +-8 million, so to keep the filter internal nodes from saturating you need to downscale the input by the aforementioned million, which reduces the range to +-8, or about 4 bits. Not ideal.
You can go to 32 bit integers so your dynamic range is increased to 12 bits, or 64 bit double precision where the mantissa is 52 bits so error becomes inconsequential. Alternately, in fixed point if you can access the lower half of the accumulator then noise shaping becomes possible.
I have a miniSHARC and it has 9600 tap capability. My crossover points are 125 Hz and 3000Hz. By using rePhase I have determined that the best compromise for the taps was 2048 taps for Low Pass (0-125 Hz), 2490 for the midrange taps (125-3000 Hz) and 512 taps for High Pass(3000-24kHz Hz). Is there a better tap distribution? Is it better to have the number of taps a power of 2?
If the FIR filter is implemented as a convolution, then it doesn't matter. If the convolution FIR filter is linear phase, then it's better to have the number of taps be odd, so that there is an integer number of samples in the resulting delay. If the FIR filter is being implemented via FFT/IFFT, then it's sometimes better to have the FFT size be a power of two, depending upon how the algorithm is implemented. But a power-of-two FFT does not necessarily imply a power-of-two number of taps in the filter because of necessary zeropadding.Is it better to have the number of taps a power of 2?
If the FIR filter is implemented as a convolution, then it doesn't matter.
So FFT is a convolution. Or am I misunderstanding the concept of convolution?If the FIR filter is being implemented via FFT/IFFT,
By "convolution", I mean direct implementation via the convolution sum https://people.eecs.ku.edu/~perrins/class/F14_360/lab/labnotes4.pdf
The FFT/IFFT "implements" a convolution indirectly, by means of transformation into the frequency domain, where convolution is replaced by multiplication.
The FFT/IFFT "implements" a convolution indirectly, by means of transformation into the frequency domain, where convolution is replaced by multiplication.
There's a particular type of IIR filter I've used in a commercial product which is much more immune to precision errors at LF. Dis beach bum will have to dig up his old notes to find it but the Great Barrier Reef is calling.Even low-Q IIR filters have issues with precision. First: poles and zeros will land at only certain frequencies because incrementing a limited precision word by a single bit will shift them by a considerable amount. Second: lowpass IIRs have gain roughly proportional to the square of (sampling frequency divided by corner frequency), which for a given word length decreases resolution by that amount.
You can design a second-order IIR filter section such that it looks like a second-order multibit sigma-delta modulator, with the only requantizer at the place where the quantizer would be in a sigma-delta modulator. The requantization error then gets noise shaped. You may still have issues with coefficient accuracy, though. Is that what you meant?
Might have been state-space form. I've never used it myself.There's a particular type of IIR filter I've used in a commercial product which is much more immune to precision errors at LF.
Commonly used to help prevent limit cycles in IIR filters.The requantization error then gets noise shaped ...
The FFT simply maps from discrete time samples to discrete frequency values.So FFT is a convolution. Or am I misunderstanding the concept of convolution?
A FIR filter is a convolution. You can implement a FIR filter by doing FFT, then multiplying by a (complex) frequency response, then doing IFFT. In other words a convolution in the time domain is the same as complex multiplication in the frequency domain. There is devil in the details for doing this on a continuous sample stream as the FFT blocks have to overlap and be combined in just the right way. There is more trickery needed to get low-latency convolution using FFT/IFFT...
For large FIR filters (thousands to hundreds of thousands of points), FFT-based convolution (aka fast convolution) is way more efficient than naive FIR application. For instance a digital reverb uses low-latency fast convolution to apply a particular acoustic impulse response to a signal). You can simply record the response of some room to a transient sound and load that into the reverb to emulate the room - that recording could be several seconds long, so >100,000 points is commonplace for this.
And don't forget that FIR filter coefficients can also be complex, as can the signals upon which they operate! In fact, there is a whole array of wonderful, non-intuitive signal manipulations that become available when complex arithmetic is allowed.In other words a convolution in the time domain is the same as complex multiplication in the frequency domain.
Got any links to how to dis digital ju ju in real time? I'm a pre10 digital guru from da previous Millenium 😊There is more trickery needed to get low-latency convolution using FFT/IFFT...
For large FIR filters (thousands to hundreds of thousands of points), FFT-based convolution (aka fast convolution) is way more efficient than naive FIR application. For instance a digital reverb uses low-latency fast convolution ... several seconds long, so >100,000 points is commonplace for this.
https://torger.se/anders/brutefir.html#howfastGot any links to how to dis digital ju ju in real time?
Thanks for this gberchin.
This is a great overview of fast convolution. I haven't read all of it in detail but it seems the minimum latency is 3ms which is 3 ft. Somewhat disappointing for 'real time'. 😢
Equivalent to 132-sample FIR filter at 44.1 kHz. That is to say, any FIR filter longer than 132 samples (or symmetric filter longer than 264 samples) will have more latency than that. Not bad.... it seems the minimum latency is 3ms ...
Last edited:
At that level, I would use a small IIR with MUCH less latency. See Simple Arbitrary IIRs - Richard LeeEquivalent to 132-sample FIR filter at 44.1 kHz. That is to say, any FIR filter longer than 132 samples (or symmetric filter longer than 264 samples) will have more latency than that. Not bad.
- Home
- Design & Build
- Software Tools
- Minimum Phase IIR filters require a large number of taps to be realized for low frequencies?