• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Latency, FIR and IIR filters

Koeitje

Major Contributor
Joined
Oct 10, 2019
Messages
2,306
Likes
3,965
So I'm looking into finally taking the dive into some form of room correction. But I am worried about latency, because I also watch a lot of movies in my stereo setup. Can somebody explain to me what the latency differences are between FIR and IIR filters? I know FIR filters are more powerful, but they also introduce more latency? How low can I get that? Are IIR filters worth it?
 

levimax

Major Contributor
Joined
Dec 28, 2018
Messages
2,399
Likes
3,531
Location
San Diego
So I'm looking into finally taking the dive into some form of room correction. But I am worried about latency, because I also watch a lot of movies in my stereo setup. Can somebody explain to me what the latency differences are between FIR and IIR filters? I know FIR filters are more powerful, but they also introduce more latency? How low can I get that? Are IIR filters worth it?

If you have the computational power FIR filters are usually preferred because of equal latency across frequency and stability but both will work and often times are combined together especially for LF corrections (FIR filter take a lot of computational power for LF filters compared to IIR). Both types of filters will screw up your video sync so you will need playback software that can allow for this. Most playback software can but if your system can't sync audio and video you need to get that sorted out before you start on room correction or you will not be happy. (My room correction FIR filters introduce about 2 seconds delay but that is easily allowed for in KODI when I watch video.)
 

andreasmaaan

Master Contributor
Forum Donor
Joined
Jun 19, 2018
Messages
6,652
Likes
9,408
Latency is generally negligible for IIR filters. If you're aiming for lowest possible overall latency, go with IIR.

FIR filters can have pretty high latency. It depends on the length of the filter, which in turn will depend on the frequency range on which it operates (lower = longer) and the Q (higher = longer).

For room correction, you'll be targeting lower frequencies, so FIR filter lengths are likely going to need to be quite high.

Are you planning to do the room correction yourself, or use something that automates it? If the former, you may have more control over striking a balance between accuracy and speed.

In any case, IME there is rarely a need for FIR filters for room correction, as most of the phenomena you're correcting will likely be more or less minimum-phase.
 

pos

Addicted to Fun and Learning
Forum Donor
Joined
Feb 13, 2018
Messages
574
Likes
720
FIR can be done with zero latency, both in its processing (direct convolution) and its response (minimum-phase).
The question is probably more linear-phase vs minimum-phase, and then linear-phase on what frequency range.
 

mitchco

Addicted to Fun and Learning
Audio Company
Joined
May 24, 2016
Messages
643
Likes
2,408
So I'm looking into finally taking the dive into some form of room correction. But I am worried about latency, because I also watch a lot of movies in my stereo setup. Can somebody explain to me what the latency differences are between FIR and IIR filters? I know FIR filters are more powerful, but they also introduce more latency? How low can I get that? Are IIR filters worth it?

If you are looking to use "purpose built for room correction software" that has time domain correction (highly recommended), linear phase FIR filters is how it is packaged so that the magnitude and excessphase correction can be applied independently. Examples of purpose built RC software with time domain correction are Acourate and Audiolense.

I watch movies in JRiver with long FIR filters and JRiver compensates for the audio delay so the lipsync is perfect. Both Acourate and Audiolense can produce minimum phase filters that I use when I watch Netflix or YouTube for example. Lipsync is not an issue and sounds almost as good :)

Wrt to rooms and room correction, there is indeed non-minimum phase behaviour at low frequencies as John Mulcahey, author of REW illustrates in his article on minimum phase.
 

levimax

Major Contributor
Joined
Dec 28, 2018
Messages
2,399
Likes
3,531
Location
San Diego
FIR can be done with zero latency, both in its processing (direct convolution) and its response (minimum-phase).
The question is probably more linear-phase vs minimum-phase, and then linear-phase on what frequency range.

Hello @pos..... love rephase.... how do you go about getting zero latency when generating a room correction .wav file for convolution software? I don't want to hi-jack thread but OP was asking how to minimize latency.... everything I read is more taps equals more latency.
 

digitalfrost

Major Contributor
Joined
Jul 22, 2018
Messages
1,540
Likes
3,168
Location
Palatinate, Germany
I use convolution to fix my audio on the PC. I also game on the system, so linear phase filters are out of the question for me. I get about 700ms of latency with 65535 taps. If you can deply the video, it doesn't matter, but let's say you play a game and all sound is delayed by almost a second, that doesn't work.

I've experiemented with minimum vs. linear phase filters, and I have to say, I can't hear a difference.
 

dc655321

Major Contributor
Joined
Mar 4, 2018
Messages
1,597
Likes
2,236
Hello @pos..... love rephase.... how do you go about getting zero latency when generating a room correction .wav file for convolution software? I don't want to hi-jack thread but OP was asking how to minimize latency.... everything I read is more taps equals more latency.

In the most general way, @pos has given the recipe for minimizing latency when using FIR filters:
1) use direct convolution, as opposed to batch or bulk convolution
2) use minimum-phase FIR filters, as opposed to linear phase FIR filters

1) minimizes computational latency and 2) minimizes latency incurred in the form of group delay (at the expense of having group delay be frequency dependent).
 

pos

Addicted to Fun and Learning
Forum Donor
Joined
Feb 13, 2018
Messages
574
Likes
720
Hello @pos..... love rephase.... how do you go about getting zero latency when generating a room correction .wav file for convolution software? I don't want to hi-jack thread but OP was asking how to minimize latency.... everything I read is more taps equals more latency.
Stick with minimum-phase EQ and set centering option to 0.
You can additionally generally linearize the phase of the crossovers (ie not the high pass of the system) with pretty short additional latency, often shorter than a TV input lag for example. In that case you will need to increase centering (ie latency) until you get a response curve that matches the target close enough.
 

levimax

Major Contributor
Joined
Dec 28, 2018
Messages
2,399
Likes
3,531
Location
San Diego
Stick with minimum-phase EQ and set centering option to 0.
You can additionally generally linearize the phase of the crossovers (ie not the high pass of the system) with pretty short additional latency, often shorter than a TV input lag for example. In that case you will need to increase centering (ie latency) until you get a response curve that matches the target close enough.

Thank you
 
OP
K

Koeitje

Major Contributor
Joined
Oct 10, 2019
Messages
2,306
Likes
3,965
Thanks for all the input, think I'm just going to try some stuff with REW and see what the latency is like on my tv. Then I will know what a stand-alone minidsp box will do in my system.
 
Top Bottom