Digital Signal Processing - How it affects phase and time domain

Can anyone recommend some resources that aren't too math intensive and written like a textbook on finite impulse response? Something like FIR for Dummies?

Currently I have IIR, and can only tolerate a small amount of latency compared to video.

That's the problem, people do not want to learn the mathematics that it takes to understand these things.

Fortunately, FIR filters are suitable for dummies as they're (like I said before) just lists of numbers. However, the longer the list the higher would be the associated delay. Moving to FIR and that too of higher taps would only make more delay when compared to the IIR filters.
Also, from what I understand Hypex gives you the option of 1500 taps per output channel, or 4500 globally both at 93.75khz.

Hypex has limited your taps and now you're struggling to somehow fit it in there, that's marketing.
 
Now that'ss where I call you honest !! FIR is simply 'convenient' to many people allowing them to be lazier than ever before. IIR requires some work and knowledge. This is because an FIR filter is just a list of numbers, csv or whatever format.

Maybe this is just typical for my stupidity, but I can't say I found the classical papers about FIR filter optimization of Parks, McClellan and Rabiner and of Wilkinson an easy read.
 
  • Like
Reactions: Dmitrij_S
Fortunately, FIR filters are suitable for dummies as they're (like I said before) just lists of numbers. However, the longer the list the higher would be the associated delay. Moving to FIR and that too of higher taps would only make more delay when compared to the IIR filters.

This would only be true if the FIR is linear phase which necessitates a symmetric IR and consequently gives a delay of half the number of taps. For a min-phase FIR the delay depends on the coefficients, not the number of taps.
 
  • Like
Reactions: lrisbo
there is probably a convenience factor for FIR filters. It’s very easy to generate a filter using inverse FFT: just draw a frequency response and inverse FFT and voila you have the filter.

The classical pit fall with that method for loudspeaker EQ is that long FIRs have an enormous degrees of freedom (DOF) (one per coefficient) and the speaker response it self can accurately be modelled with a much fewer DOFs. This means that the inverted FIR is now correcting for all artifacts and noise components of the mesurement used. This is obviously problematic.
 
Maybe this is just typical for my stupidity, but I can't say I found the classical papers about FIR filter optimization of Parks, McClellan and Rabiner and of Wilkinson an easy read.
I said 'convenient' because I'm quite sure that most people who use FIR based EQ don't care how these work. What they do is generate one filter for the entire band, according to their measured loudspeaker response and load it into their equipment. Now, this can be done using IIR or analogue filters but the number of biquads (and possible parameter combinations) could be numerous, making FIR more convenient to the common man.

This would only be true if the FIR is linear phase which necessitates a symmetric IR and consequently gives a delay of half the number of taps. For a min-phase FIR the delay depends on the coefficients, not the number of taps.

According to what I understand, the associated delay of an FIR filter has two parts: the filter delay (from the coefficients) and the computational delay from the hardware.

The structure of an FIR filter requires that all multiplications involving all coefficients be carried out for every sample output from the filter. In other words, irrespective of symmetric coefficients (linear phase), there are as many coefficients as there're taps and as many multiplications to be carried out before each output sample is ready, making the computational delay of the FIR filter directly dependent on the tap count (filter length).

Yes, the filter delay for an asymmetric FIR (non-linear phase) can be similar to that of an IIR filter, but the computational delay is still going to be higher. Now, since the latter depends on hardware capabilities like clock frequency, bit-depth / precision etc. it may not be possible to say who gets how many milliseconds, but wouldn't the IIR filter with just 5 coefficients end up being faster when run on the same hardware ?
 
It's the same thing, hence the word 'array'. An FIR filter is as simple as saying h[n] = {1,2,3,4} that is, a finite-length impulse response as opposed to an infinite one that cannot be listed. You may equivalently specify the coefficients of the frequency response, which is all the same thing !!

Yes, i know that whether a FIR file is a wav, or txt, etc, that they are the same thing. The only reason I mentioned i use txt, is that you had highlighted I present a special case 'wav' file. I had no idea why you said wav, and not simply FIR. That said, the3 reason i use txt is because I've learned if a wav file ever has a coefficient above 1 (clipped from bad design), wav's sometimes can give very weird results, whereas txt stay stable (just clipped). But hey, good FIR files never clip, so shouldn't ever matter.


Inversion of a transfer function interchanges poles and zeroes. An FIR filter cannot invert an all-pass filter transfer function, as it does not have poles. Moreover, this would imply violating causality. If a large delay is introduced to prevent this violation, then even an IIR filter could do it !!
here's an example of where we practical users (like myself) get corrected by those however they were trained in signal processing, math, etc.
Like said earlier, I don't understand poles and zeroes at all....and frankly see no need to.

In practical applications, the FIR generators I've encounter, I've seen a variety of terms used to describe an all-pass that had phase rotation opposite that of a normal all-pass. Terms such as maximum phase all-pass, inverted all-phase, phase flipped all-pass, etc.
Maybe those definitions don't pass rigorous academic accuracy. Don't know, don't care. To me they all pragmatically mean an inverse all-pass.

Now that'ss where I call you honest !! FIR is simply 'convenient' to many people allowing them to be lazier than ever before. IIR requires some work and knowledge. This is because an FIR filter is just a list of numbers, csv or whatever format.

🙂 Hey, I've been honest in all my comments. And yes, I'm as lazy as I can get....or I should say i try to maximize resutlt vs effort and resources.
Because I want audible and measurable RESULTS, totally repeatable results as easy to implement as possible.

Which to me means, why on earth should I struggle struggle with IIR, which takes far more work, leading to results that might end up being as good as what I can easily get with FIR? Just to prove I'm not lazy and can learn harder stuff????

Unless I can logically see or audibly hear, a reason to take the harder path, seems to me I'd have to be nuts to do so

That's the problem, people do not want to learn the mathematics that it takes to understand these things.
Ok, last reply...I'm getting too repetitive...sorry.

Who cares what the math is past a good basic understanding.
Once we go beyond a good basic understanding, I think that going further / digging deeper into the math has it's own set of intrinsic rewards which are very nice in their own right.....but I've found those rewards seldom help me produce better audible results and measurements.
Seems those rewards are more about making technically correct posts, than building excellent speakers.

For me, keeping an eye on the audio ball, ....means what do I do next, what will have the greatest marginal impact in making yet better sound.
Honestly, less thinking and more observation/experimentation/measurements, have worked best for me. To each our own, eh?
Which is why I was making the IIR vs FIR comparisons/experiments mentioned earlier in this thread.

My thinking mind before the experiments said I know what I'll find, little if any difference other than for very low frequency work (it was right).
Observing mind said after the experiments, wow IIR is one huge pain in the you-know-where....
why did I try this comparison yet again, I've done it before.....why do I keep being influenced by IIR advocates and having doubts ? lol
 
  • Like
Reactions: Zoji6645
That's the problem, people do not want to learn the mathematics that it takes to understand these things.

Over the years, I have met very intelligent people that are socially awkward, that fail at everyday tasks. I value my time as I get older, and with many competing interests I have no desire to read dry text books to ' understand ' the math.

Results matter. You can be a theorist your entire life and do little with it.
 
there is probably a convenience factor for FIR filters. It’s very easy to generate a filter using inverse FFT: just draw a frequency response and inverse FFT and voila you have the filter.

The classical pit fall with that method for loudspeaker EQ is that long FIRs have an enormous degrees of freedom (DOF) (one per coefficient) and the speaker response it self can accurately be modelled with a much fewer DOFs. This means that the inverted FIR is now correcting for all artifacts and noise components of the mesurement used. This is obviously problematic.
Yes, the convenience factor is enormous.

And double amen yes ! re the classic pitfall. FIR is often too powerful, and too convenient for it's own good.
Especially true for high taps counts with fine frequency resolution.

To avoid overcorrections, I've focused on learning what minimum phase corrections can be validly embedded into a FIR filter (for good on-and off-ax response).
Transfer function measurements have worked pretty well for that. Lots of spatial averaging work though. But hey, that's necessary for IIR too.

Currently trying to reduce further FIR overcorrection potential from noise and reflections. Doing this by using impulse responses directly, where various filtering/ window techniques can be applied. Seems promising so far.

And then, there's always the last resort in avoiding overcorrections....just don't have many damn taps!!! hahaha
But seriously, knowing what can and can't be corrected, and how to correct, is the name of the game imo. (and true for both FIR and IIR)
 
  • Like
Reactions: lrisbo
... I have no desire to read dry text books to ' understand ' the math.
It is highly unlikely that there's a book on 'finite impulse response' that's not math intensive.
Who cares what the math is past a good basic understanding.
Well, as far as I can see, at least Vance Peate wanted some 'scientific' insight ...
...but I've found those rewards seldom help me produce better audible results and measurements.
You think, but I'm fairly sure that a person with a better understanding would make much better use of your expensive gear than you can.
Seems those rewards are more about making technically correct posts, than building excellent speakers.
What we get to see is their posts, but people who're knowledgeable also do a lot of other work besides writing on the forum !! 🙂

Lets stick to the delay from the transfer function. Booth IIR and FIR can do minimum phase filters.
Yes they both can.
 
  • Like
Reactions: lrisbo
Seems H(z) is either N(z)/D(z) for IIR,
or N(z) for FIR.
Whether there is a denominator or not makes for a fundamental difference, I think.
Just noticed this thread, so I'll do a "drive-by-posting".

If the transfer function of a FIR filter is
[b0 + b1*z^(-1) + ... + bnz^(-n)] / 1,
then you can multiply by "(z^n)/(z^n)". This results in
[b0z^n + b1z^(n-1) + ... + bn] / (z^n).
It follows that a FIR filter has "n" poles at z=0.
 
It’s a little hard to make such comparison without mastering how to design optimal IIR filters. One bad example does not preclude that a pristine example exists.

What do you mean by mastering how to design optimal IIR filters?

I don't design them...I just implement them.
Turn on real-time transfer function measurement. Gonna do some simple "knob twisting".
On a driver-by-driver basis, use IIR EQ's in processor to smooth out magnitude response, assuming the response variations are minimum phase. Get mag and concomitantly phase, as flat at zero as possible thru pass-band and out-of-band summation regions.
Make polar measurements to confirm/deny which EQ's addressed valid minimum phase issues. If EQ's work well both on and off-ax, I consider them valid.

Bonus from a direct implementation procedure like this:
Don't need to verify drivers' software filter designs/recommendations, with final acoustic measurements. Measurement's rule, and are already done!

Crossovers aren't an issue being linear phase, and have no bearing on IIR filters needed for previous driver corrections.

So I use direct observed measurement to design IIR. Pain in the butt really, compared to the ease of a good auto FIR generator.
Do you think there's a better way to design IIR than the above, one that would give better final measured results?
 
It’s very easy to generate a filter using inverse FFT: just draw a frequency response and inverse FFT and voila you have the filter.

A response that I posted on COMP.DSP, way back in 2010:

"Ah, the perils of designing in the frequency domain. It's so much easier to get
that frequency response 'just right' when you don't have to worry about the time
domain.

"Consider that frequency response is a steady-state concept. That is to say,
when you specify the response of a filter at a certain frequency, you tacitly
assume that a signal of constant amplitude at that frequency was applied an
infinitely long time ago, and will continue for an infinite time to come.

"But we live in the time domain. Signals start, stop, and change. Those starts,
stops, and changes trigger time-domain responses from filters. And the
time-domain responses can be very unattractive when the filters are designed in
the frequency domain. It is a fundamental give-and-take; to optimize something
in the frequency domain almost always means to 'un-optimize' something else in
the time domain, and vice-versa."
 
That's rather condescending, and not constructive or helpful.
Thanks diyuser, I felt the same.

Hey newvirus, pls don't think the processor I use is all that expensive....that $$ are part of the formula that makes FIR work for me.
I grew up with FIR starting with miniDSP's 8ch DA-8, and some OpenDRCs. I put more money into those, than the Qsys processor i'm now using.

In fact, the schematic shown earlier is running on a killer 510i processor that I got for less than a new miniDSP SHD.

You do have to watch the market and be patient, but good deals inevitably pop up for folks on budgets (like this retired old dude)
 
"But we live in the time domain. Signals start, stop, and change. Those starts,
stops, and changes trigger time-domain responses from filters. And the
time-domain responses can be very unattractive when the filters are designed in
the frequency domain. It is a fundamental give-and-take; to optimize something
in the frequency domain almost always means to 'un-optimize' something else in
the time domain, and vice-versa."
Hi Greg,
By filters having problems with time domain phenoms, what do you mean? PEQ's/shelves ? Or hp/lp? Or maybe both?

Another question: If we achieve flat mag and phase, and of course an associated clean impulse/step response,
haven't we optimized both the frequency domain and the time domain together? What problems remain?

((( I simply can't understand why we make filters so complicated...
(i often think IIR crossover phase rotations, and trying to eliminate them, are at the root of all unnecessary complication)...)))
 
By filters having problems with time domain phenoms, what do you mean? PEQ's/shelves ? Or hp/lp? Or maybe both?
If you design a filter entirely in the frequency domain, then you have to "settle for whatever you get" in the time domain. And vice-versa. For example: you could (try to) design an ideal lowpass filter in the frequency domain, but what you'd get in the time domain is a sinc of infinite extent. Probably not what you had in mind.

If we achieve flat mag and phase, and of course an associated clean impulse/step response,
haven't we optimized both the frequency domain and the time domain together? What problems remain?
Only if your flat response extends from DC to infinity. All practical audio responses are bandpass by necessity. That means there is an associated impulse response that is not a true impulse. The designer's problem is to decide where and how to compromise between frequency and time responses. "Can I tolerate pre-ring?" "How much pre-ring?" "Can I tolerate delay?" "How much delay?" "Can I tolerate deviation from perfectly flat magnitude response?" "How much deviation?" "Can I tolerate nonlinear phase response?" "How much nonlinearity?" And so on.

In addition, what is flat magnitude and phase on-axis may not be (probably won't be) flat magnitude and phase off-axis. What sums perfectly mathematically does not always sum perfectly acoustically.

And then, of course there is the problem of the room ...

I simply can't understand why we make filters so complicated...
It's a complicated subject. In order to simplify a complicated subject, we have to ignore some aspects that may be important. We can make a simple subject complicated, but we can't make a complicated subject simple without assuming-away some parts of it.