Welcome, Guest
Username: Password: Remember me
This is the optional Forum header for the Suggestion Box.

TOPIC:

Re:Linkwitz transform 11 years 2 months ago #3661

  • devteam
  • devteam's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9138
  • Thank you received: 1430
Charlie,

I am planning to copy out all the other calcs from knuisje's spreadsheet


I know it's not bad intended, but it doesn't sound that good on a post without some context. Asking for Knuisje's & other NL DIYers authorization's (and giving them Credits) when doing so would make sense since these guys did spend a lot of time refining this spreadsheet :-)

FYI, reading some basic "EQ cookbook by RBJ" should set you up in understanding everything you need to build your custom biquad.

DevTeam
miniDSP, building a DSP community one board at a time.

Please Log in or Create an account to join the conversation.

Re:Linkwitz transform 11 years 2 months ago #3663

  • CharlieLaub
  • CharlieLaub's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 113
  • Thank you received: 8
I really, really don't understand why there is a problem. knuisje posted the spreadsheet; anyone can download it. What's the difference whether I use it as is, or copy some formulas from it to my own personal spreadsheet on my computer? This is for my personal DIY use...

I did send him a personal Email through this system a day or two ago, but I have not gotten a response. I was only trying to appeal to more seasoned people who have done more programming of digital biquads to just throw me the answer because I am in a rush to get this working for a speaker that I have planned to bring to Burning Amp, which is taking place in 3 days.

-Charlie

Please Log in or Create an account to join the conversation.

Re:Linkwitz transform 11 years 2 months ago #3667

  • knuisje
  • knuisje's Avatar
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 48
  • Thank you received: 4
I'm back from my holiday. :) I guess everything is solved now?

Please Log in or Create an account to join the conversation.

Re:Linkwitz transform 11 years 2 months ago #3668

  • dreite
  • dreite's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 1667
  • Thank you received: 739
Charlie,

I will most likely be at the Burning Amp festival this year. If you find me we can touch base and maybe I can help you with miniDSP-related items.

Dave.

Please Log in or Create an account to join the conversation.

Re:Linkwitz transform 11 years 2 months ago #3671

  • CharlieLaub
  • CharlieLaub's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 113
  • Thank you received: 8
Hi Dave,

Luckily I'm not really having any issues. Using all the filter types on knuisje's spreadsheet, I was able to implement a slightly different version of my crossover using the programmable biquads. Please stop by. I'll be in the Tesla room. I'd love to chat. I might even bring a computer along and I can show you the crossover design spreadsheets...

Here's a thread about the speakers, on the PE TechTalk forum:
Charlie's big 3-way 4-cube tower of fun

-Charlie

Please Log in or Create an account to join the conversation.

Last edit: by CharlieLaub.

Re: Linkwitz transform 10 years 11 months ago #4190

  • Crumboo
  • Crumboo's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 144
  • Thank you received: 14
Hi,

Thank you guys so much for the excel file for calculating biquad parameters. I look for a way of calculating the frequency and phase response from an arbitrary biquad filter (with choosen biquad coefficient).
In the excel file the following expression is used for calculating frequency respons:

10*LOG10( (b0+b1+b2)^2 + ( b0*b2*phi - (b1*(b0+b2) + 4*b0*b2) )*phi ) -
10*LOG10( (1+a1+a2)^2 + ( 1*a2*phi - (a1*(1+a2) + 4*1*a2) )*phi)

with phi = 4*SIN(w/2)^2 and w = 2*PI()*f / f_s

I am not sure how the above expression is derived from the biquad function, H(z)=(b0+b1*z^-1+b2*z^-2) / (a0+a1*z^-1+a2*z^-2). Can anyone out there please show the corresponding expression for H(s), with s being the complex frequency, as a function of the biquad coefficient? The absolute number (IMABS) of H(s) should generate the same curve as the expression used in the excel file, and the phase response should be obtained as the argument (IMARGUMENT) of H(s). I have been trying to derive this myself, but for some reason the result is not correct. :unsure:

The reason why I want the expression for H(s) is for being able in a simple way to combine biquad filters and evaluate the resulting filters frequency and phase response. I would be very thankful if someone can help me with this. :)

Please Log in or Create an account to join the conversation.

Last edit: by Crumboo.

Re: Linkwitz transform 10 years 11 months ago #4191

  • CharlieLaub
  • CharlieLaub's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 113
  • Thank you received: 8
You can calculate the magnitude and phase responses versus frequency in Excel. Here is how to do it:
1. Calculate z^-1 versus frequency
2. use the biquad coefficients to calculate the transfer function using Excel's complex number functions. See "digital crossovers" in the Applications menu on this web site for info on the IIR transfer function
3. Calculate the magnitude (use IMABS) and phase (IMARGUMENT) of the transfer function for each z^-1

I do this in a loudspeaker crossover design spreadsheet that I have recently put together, which I will be releasing early next year in order to plot the response of the filters for the MiniDSP and compare them to analog filter functions.

-Charlie
The following user(s) said Thank You: Crumboo

Please Log in or Create an account to join the conversation.

Re: Linkwitz transform 10 years 11 months ago #4195

  • Crumboo
  • Crumboo's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 144
  • Thank you received: 14
Thank you,

I think that it is the first step that is wrong in my calculations. How do you express z^-1 vs. frequency?

I have used z=exp(j*2*PI*f/f_sample). I believe the frequency should be corrected for frequency warping, but the result I get is wrong I'm afraid. :unsure:

Interesting about your spreadsheet, are you releasing it for free? :)

Please Log in or Create an account to join the conversation.

Re: Linkwitz transform 10 years 11 months ago #4196

  • CharlieLaub
  • CharlieLaub's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 113
  • Thank you received: 8
Yep, free.

You can read all about it here:
www.diyaudio.com/forums/multi-way/201963...er-design-tools.html

The LT is one of the filter types that you can implement as a "biqudratic filter" section. But there isn't a need to go in to all the details about it if you use my crossover design tools.

After designing the loudspeaker crossover using the Excel tools, you just copy and paste the transfer coefficients (already formatted for import in to the MiniDSP "advanced biquad" input window) to implement the crossover functions using a MiniDSP product with the "advanced" plug-in. I've tested it out with a couple of systems that I am working on and it works great.

I'll get back to you later about how to calculate z, z^-1, etc. and will post a follow-up.

-Charlie

Please Log in or Create an account to join the conversation.

Re: Linkwitz transform 10 years 11 months ago #4197

  • Crumboo
  • Crumboo's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 144
  • Thank you received: 14
Hi and thanks again CharlieLaub,

I just had a quick look at the link you posted. Looks very nice indeed! I have a few suggestions for your excel-file (maybe the features is already there?):
  • Plotting the total response of several cascaded biquad filters
  • Define the distances of the different speakers in a loudspeaker and plot the combined response in different angels (or even polar plots?)
  • Import measured data (.frd for example) and apply filters on this data

There is a solver add-in in excel (at least in some versions) that can be used for curve-fitting, for example fit a biquad function to a defined "target" curve by adjusting the biquad parameters.

I will be happy to have a look on your spreadsheet if you interested. :)

And yes, I would be grateful for information on calculating z, z^-1 etc. :)

Please Log in or Create an account to join the conversation.

Re: Linkwitz transform 10 years 11 months ago #4198

  • CharlieLaub
  • CharlieLaub's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 113
  • Thank you received: 8
Well 2 out of 3 ain't bad... My design tools already do these:
* Plotting the total response of several cascaded biquad filters
* Import measured data (.frd for example) and apply filters on this data

The tools are designed to work from measurements made at a single point in space, or extrapolated there, e.g. somewhere on the listening axis. There is no need to input location information for the driver, because you determine the acoustic offset from a set of three measurements and then the tools incorporate the phase response resulting from the group delay in to the overall response. No more guesstimating where the acoustic center of your driver is located like in some other programs!

Thanks for mentioning the Excel solver - good idea. I have been thinking of how I can implement it as an add-on to my spreadsheet tools, and it probably is doable. I am currently writing a simulated-annealing based solver that will be implemented (hopefully) in a OpenOffice Calc add-on, since my tools also work under OO Calc. It should be much more versatile at multi-dimensional minimization/optimization compared to the Excel solver, since it can avoid getting stuck in local minima. It's based on an algorithm that I developed a few years back.

-Charlie

Please Log in or Create an account to join the conversation.

Re: Linkwitz transform 10 years 11 months ago #4207

  • CharlieLaub
  • CharlieLaub's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 113
  • Thank you received: 8
Here is how to computer the filter response, given the "biquad coefficients":

First, define the digital frequency (omega) as w = 2*pi*f*T

where f is the frequency in Hertz, and T is the sampling interval, T = (sampling frequency)^-1

Then z = EXP( 0 + iw )

where i is (-1)^0.5. Note that z is a complex number.

To get other powers of z, use exponentiation. For instance in Excel:

z^-1 = IMPOWER(IMEXP(COMPLEX(0,w)),-1)
z^-2 = IMPOWER(IMEXP(COMPLEX(0,w)),-2)

In the above Excel formulas, I have inserted "w" in place of a cell reference to w.

After computing these quantities, use the definition of the transfer function, the coefficients of each term, and Excel's complex number functions IMDIV, IMSUM, and IMPRODUCT to compute the quantity H(z) shown below:



Finally, compute the magnitude and phase response from the transfer function using IMABS And IMARGUMENT, noting that the phase angle computed by IMARGUMENT will be in radians.

-Charlie
The following user(s) said Thank You: Crumboo

Please Log in or Create an account to join the conversation.

Last edit: by CharlieLaub.

Re: Linkwitz transform 10 years 11 months ago #4209

  • Crumboo
  • Crumboo's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 144
  • Thank you received: 14
Hi again,

As for specifying the distance between speakers I meant in the vertical direction (not the "depth"). While measured data is needed for the actual filter calculations, it could be useful to simulate the combined response in different directions as well. The tools you are developing will be very useful! :)

Please Log in or Create an account to join the conversation.

Re: Linkwitz transform 10 years 11 months ago #4210

  • Crumboo
  • Crumboo's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 144
  • Thank you received: 14
I followed the steps you wrote in order to calculate the response, and I now get the correct result! :) Thank you so much CharlieLaub!

Please Log in or Create an account to join the conversation.

Re: Linkwitz transform 10 years 11 months ago #4211

  • CharlieLaub
  • CharlieLaub's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 113
  • Thank you received: 8
If you really want to calculate the off-axis response of a loudspeaker, you need to know the positions in space for all the drivers, not just the x,y position on the baffle, but also the z position (distance in front of or behind the baffle plane, or from some reference point/plane).

There are some tools that you can use to calculate off-axis responses, such as the Baffle Response Simulator . Doing these calculations correctly is not trivial, because you need to use a good directivity model of the driver. If you download and try out the BRS, you will see that it takes some time to calculate the response. In the end, it's still a model of a rigid piston, and off axis measurements would be more accurate.

The approach that I have taken with my crossover design tool is intended to keep things simple. You start with the on-axis response using measurements taken there. If you want to know the off-axis response, you need to supply different measurements, or at least change the acoustic delays in each driver response spreadsheet to reflect the different pathlengths to the off-axis position(s).

-Charlie

Please Log in or Create an account to join the conversation.

Moderators: devteam