# Equalisation/Crossover - Best way to fit a curve?

#### bentoronto

##### Member
Paid Member
Just wanted to add, it's not just making one good FR, you need to get the two channels to track reasonably. That's more important than getting every bump massaged.

#### Dave Zan

##### Member
What I...mean... in that earlier post was that, rather than....lots of IIR filters...you can instead use a[n]....FIR filter that contains the complete amplitude and phase response of the EQ curve, and that only some finite number of filter taps would be required to do that to within a very small tolerance.
I expect the information content is the same between "lots" of PEQs each with essentially 2 parameters (Frequency and Q) and one FIR filter with lots of coefficients for lots of taps. So I am not convinced by your earlier post that the PEQ solution can't be solved directly while the FIR solution can.
I have read a bit more, apparently Norbert Wiener did the foundational work on deconvolution (and if I understand correctly, FIR equalisation) and actually transformed into the frequency domain to handle noise more conveniently.
Which is what I had in mind, I think...

Best wishes
David

#### Dave Zan

##### Member
Hey David - you sure sent this whole forum down a dead end with that talk about least squares fit.
You think this is the best way to open a discussion, likely to have you taken seriously?

The core question is....
No, that's not the core question I am interested in, in this thread.
The core question is exactly what I have already stated, how to best fit a curve, or, equivalently, find the poles and zeros.
I mentioned equalisation as an example, it's easier to think about the maths with an example in mind.

David

#### Dave Zan

##### Member
Theoretically, you could simply equate the response and its reciprocal (separately) to zero and obtain all the zeroes and poles (respectively)
I understand numerical solution of non linear equations when there is an explicit function.
I don't see how it applies when we have a collection of data points that we need to fit.
Can you explain or expand on your proposal?

Best wishes
David

#### mark100

##### Member
I have no experience with any of it except curiosity (#). Some 27 years ago I had the wild idea that one could make a current output amplifier that would determine the pole locations of a loudspeaker from its impedance and automatically equalize it, either to have the exact same small-signal response as under voltage drive or an improved response (sort of automatic Linkwitz transform). I never designed or built it, though.

<snip>

Regarding your question, it would seem logical to measure the response under current drive if you want to correct the response under current drive, but as said I have no experience with it.

(#): Actually, some 22 years ago, I did experiment with a current-driven loudspeaker with motional feedback using a second voice coil, but I just manually fitted a lumped model to the measurements.
Thx for the reply,......,sounds like some interesting experimentation you had going on !

A pre release version of REW has some interesting new features in the trace arithmetic section that make it more suitable to produce practical inversion filters on it's own, including target matching and dip limiting.

Thx for the heads up. Those trace arithmetic enhancements appear like they will really help to make REW's impulse inversion process quite useful for generating FIR filters....and certainly much safer.

Dave Gunnes is famous for having an EQ procedure called Temporal EQ or Gunness Focusing that can correct many acoustic anomalies with loudspeakers that must be at least semi automated. Its applied through an FIR filter but the procedure for generating the filter seems quite secret.

Ok, here's an example where I would love to know how the match works, albeit it's for FIR filter math.....

Temporal EQ makes it appear there is a "preconditioning filter" that addresses horn discontinuity reflections that go backwards into the throat/CD phase plug, and then to bounce back out thru the horn and become part of the overall response. So an EQ in time....

These horn discontinuity reflections will of course arrive at listener/mic later than the direct response, and can be seen as "tails" or wiggles in the impulse response right after the direct primary response peak.

So here is my math question:
let's say i isolate/gate the tail's impulse response (the horn discontinuity reflections) from the overall impulse response, and invert that isolated tail impulse.
To be used as a 'preconditioning filter'.
With that filter in place and properly time aligned, take a new impulse that hopefully has removed the horn reflections, and use that new impulse for direct primary response inversion/correction.
Convolve the two impulse inversions for a final single filter.

Iow, a two stage approach to isolate the factors in time, and invert each individually .....the direct primary response and subsequent reflections.
(Perhaps the order of the two stages doesn't matter.)

????? Does the two stage process produce any mathematical difference, compared to a simple one stage process of inverting the entire impulse response, containing both the direct response and subsequent reflections tail ????
My gut says both techniques should give the same result....but my gut lies alot, and numbers don't, lol...

Hope that was clear... thx...

#### kipman725

##### Member
Paid Member
This kind of technique is used in RF engineering to remove the effect of connectors. I don't know if you will be able to read this but here is one article: https://ieeexplore.ieee.org/document/1706292 its called 'time gating'. One limitation I can think of is that its still subject to the Gabor limit and so the duration of the gate will affect frequency resolution.

#### TBTL

##### Member
The captured impulse must have rung out within the time gate to be representative.

#### gberchin

##### Member
If all that you need is transfer function, which can be converted to poles and zeroes, and you don't mind working in the z domain instead of the Laplace domain, then this often works: Precise Filter Design.

1 user

#### newvirus2008

##### Member
I don't see how it applies when we have a collection of data points that we need to fit.
What I meant is:

If you have a function of frequency, it is possible to find exactly where the function has poles or zeroes. But, since measured response is just an array of complex numbers (constants) and not a function of anything, you would have to fit a function to the said response and then analyse that function for poles and zeroes (which should be straightforward).

Thus, if you can somehow "fit a function" to match a measured response, I could easily show you the poles and zeroes on your screen.

Can you explain or expand on your proposal?
For the time being, let's just assume that you've somehow managed to find (or fit) a function that tracks the measured response. And, just as sweeping across the frequency range would give its Bode plot, sweeping across the "complex frequency range" would give clear visual indications for all its poles and zeroes.

For example, if F(s) = (s+1000) / (s+2000), please see attached picture.

#### Attachments

• Untitled-1.jpg
43.9 KB · Views: 9

#### Dave Zan

##### Member
What I meant is:

....you would have to fit a function to the said response and then analyse that function for poles and zeroes
Yes, but how to "fit a function to the said response" is exactly the problem!
Once I have fitted a rational polynomial then the poles and zeroes can easily be determined.

If all that you need is transfer function, which can be converted to poles and zeroes...in the z domain instead of the Laplace domain, then this often works: Precise Filter Design.
Thank you very much, that looks like it may be what I wanted, based on my first quick look,
I will read it more carefully, in the meantime, how did you come up with this?

Best wishes
David

Last edited:

#### TNT

##### Member
Paid Member

Temporal EQ makes it appear there is a "preconditioning filter" that addresses horn discontinuity reflections that go backwards into the throat/CD phase plug, and then to bounce back out thru the horn and become part of the overall response. So an EQ in time....

These horn discontinuity reflections will of course arrive at listener/mic later than the direct response, and can be seen as "tails" or wiggles in the impulse response right after the direct primary response peak.

So here is my math question:
let's say i isolate/gate the tail's impulse response (the horn discontinuity reflections) from the overall impulse response, and invert that isolated tail impulse.
To be used as a 'preconditioning filter'.
.....
Isnt this possible for just one single impulse - I mean, when you have music, how can you identify an onset from an instrument apart from a played long tone with the same frequency? Temporal... whats the reference for timing?

To me, its sounds impossible to do...

//

#### krivium

##### Member
Paid Member
But the results are there: there is exchangeability between every coax based models in the Fulcrum range, which is a 'tour de force'.
I suggest to all to give a listen to Presonus Sceptre 8 which use the horn/filter M.Gunness developed. I bet they manage same sound quality in their PA range.

#### gberchin

##### Member
Thank you very much, that looks like it may be what I wanted, based on my first quick look,
I will read it more carefully, in the meantime, how did you come up with this?

If you mean "How did I know about the existence of the document?"; I wrote it.

If you mean "How did I come up with the idea in the first place?"; I just put together bits of knowledge from here and there.

#### Dave Zan

##### Member
Isnt this possible for just one...impulse -.. Temporal... whats the reference for timing?

To me, its sounds impossible to do...
If I may jump in, it's not impossible if the system is linear and doesn't vary over time., so called Linear Time Invariant (LTI).
Then each impulse response train overlaps the next impulse response train but because the system is linear and doesn't vary they can all be mathematically separated.
It's called deconvolution, there's a wiki entry as a place to start.

Best wishes
David

#### Dave Zan

##### Member
If you mean "How did I know about the existence of the document?"; I wrote it.

If you mean "How did I come up with the idea in the first place?"; I just put together bits of knowledge from here and there.
I first asked "how did you find this", until I realised you wrote it and then edited to "how did you come up with" it, so I meant it in the second sense.
Nice work, I had in mind to stay in the Laplace domain, so your chapter is not quite exactly what I need, but you have provided sufficient information for me to work out the details.
Do you still have a copy of your thesis and the conference papers? I'd very much like to read them.

Best wishes and thanks
David

#### gberchin

##### Member
Nice work, I had in mind to stay in the Laplace domain, so your chapter is not quite exactly what I need, but you have provided sufficient information for me to work out the details.
Do you still have a copy of your thesis and the conference papers? I'd very much like to read them.

Thank you.

There is a Laplace version of the algorithm called "TF", by H. McCue at Lawrence Livermore National Labs. Last time I searched for it on the Internet, I found virtually nothing. I have a brief description of it in my thesis; that may be the only remaining reference for it. It doesn't work nearly as well as the z-domain version.

Both versions fall completely apart if there is excessive phase delay in the measurements.

I have my thesis and conference papers in PDF ... somewhere. Send a message to gjberchin (at) charter (dot) net, and I'll get them to you if I can find them. Just remember that they were written more than thirty years ago. I can also send Matlab code that implements the algorithm, if you wish.

Same goes for anyone else who is interested.

Last edited:
1 user

#### newvirus2008

##### Member
Yes, but how to "fit a function to the said response" is exactly the problem!
Once I have fitted a rational polynomial then the poles and zeroes can easily be determined.
It was for that purpose that I first suggested iterative PEQs, but now I think you can try the z-domain method written by gberchin.

1 user

#### DonVK

##### Member
How about curve fitting the measured response in Octave (Matlab) using the "invfreqs" (signal processing toolbox). This will give a poly (S-domain) and it allows setting the poly order and sample weighting. The correction will be its inverse. It might not be OCD flat but it may be sufficient. Then use a "bilinear" (or another like it) to get the Z-domain correction filter.

1 users

#### newvirus2008

##### Member
How about curve fitting the measured response in Octave (Matlab) using the "invfreqs" ....?
That would work as long as the source code for the invfreqs() function is freely available for people to use. I do not know about Octave (as I'm Windows) but in most cases, the choice of MATLAB (or therabouts) is limited to the easy initial learning of a method, only to implement it using a language of your choice, say C++ a little later. But I must say that I wasn't aware of this function, thanks anyway.

The MATLAB documentation for "invfreqs" has a short explanation of the algorithm and a couple of citations:

https://in.mathworks.com/help/signal/ref/invfreqs.html

Last edited:
1 user

#### DonVK

##### Member
Octave is free, and runs on Windows, Linux and Mac. It's mostly syntax compatible with Matlab Octave