• 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!

DIY 3D Speaker Scanner - the Mathematics and Everything Else

This also seems interesting:


It has a viewer:
DAFFViewer_ScreenShot.png


Same university as ITA toolbox.
 
For some reason unknown to me the expansion term matrices (the Ψ matrices) for my first test case (100 Hz, should be easy) has very low ranks, and they are not going to return acceptable fitting results. I have not encountered this problem before. The Ψ matrices are dependent only on the measurement coordinates and frequency, and not on the measured pressure amplitudes. Will need more time to figure out what the cause is.

This also seems interesting:


It has a viewer:
DAFFViewer_ScreenShot.png


Same university as ITA toolbox.
I'll take a look after I figure out what is cause the problem with the measurement data.
 
As if all measurements were taken at the same point? Or 'equivalent' points w.r.t. the spherical harmonics?

I'll see if I have these (hidden?) problems too or that I've changed things.
 
As if all measurements were taken at the same point? Or 'equivalent' points w.r.t. the spherical harmonics?

I'll see if I have these (hidden?) problems too or that I've changed things.
I think it is possible that the separation of the measurement points need to be larger. Since the wavelength of a 100 Hz wave is 3.43 m (and longer for lower frequencies), a separation distance of a few cm may not be sufficient to accurately resolve the phase differences (and to calculate the direction of travel of the wave).

I am going to experiment with simulating different sizes of cylindrical measurement grids, and see how it affects the rank (or condition number) of the Ψ matrix. Unfortunately I am going to be busy with a move this month, and may not have a lot of free time to work on this.
 
conditionNumber.png
Order = 1

For Order=8 it starts at 10^30 at 20Hz and goes linearly down to 100 at 100Hz.

I don't understand enough of what I just computed to say anything about it...
 
Last edited:
The condition number is an indicator of how "well conditioned" a matrix is. If it is >>1, the matrix is ill conditioned, which means that the solution is very sensitive any kind of input errors (i.e. tiny errors can lead to large changes in the solution), including numerical round-off errors in the computations.
 
Wikipedia (https://en.wikipedia.org/wiki/Spherical_harmonics) says this:

..

I kinda expected that that would have meant that whether you fit it with N=1 or N=2, the N=1 coefficients would be the same. They are not. Am I mistaken, or is something else going on?

The spherical harmonics are not orthogonal on the surface (and grid) you are using. You can still get meaningful results but indeed your lower order coefficients will depend on the highest order used for the fit. For the sphere there are mathematically convenient Lebedev grids (and weights) which gives you the orthogonality you are expecting.
 
This seems interesting too, although, again, a bit over my head.

Estimation of the Optimal Spherical
Harmonics Order for the Interpolation
of Head-Related Transfer Functions
Sampled on Sparse Irregular Grids
 

Attachments

  • frsip-02-884541.pdf
    2.2 MB · Views: 87
Another comment: When you solve the linear system (probably with regularization if it is underdetermined) you can plot the rows of the matrix inverse on your grid. You can think of each row as integration weights for each basis function (spherical harmonic). If the system is well conditioned these weights should be smoothly varying, and kind of look like the spherical harmonic evaluated on the grid. If you instead get very large weights with alternating signs then the method is unstable for some reason, and the fit will be strongly affected by noise.
 
Another comment: When you solve the linear system (probably with regularization if it is underdetermined) you can plot the rows of the matrix inverse on your grid. You can think of each row as integration weights for each basis function (spherical harmonic). If the system is well conditioned these weights should be smoothly varying, and kind of look like the spherical harmonic evaluated on the grid. If you instead get very large weights with alternating signs then the method is unstable for some reason, and the fit will be strongly affected by noise.
I'll try to understand what you're saying and report back.
 
I'll try to understand what you're saying and report back.
:) Sorry, I will try to do better.
You are getting your fitting coefficients from solving a linear system. If it's a least square fit it will look something like this (sorry for different notation, I will have a look at how your Psi is defined):

c =[(A'A)^-1A']x

where c is a vector of fitting coefficients and x is the measurement. The rows of the matrix [(A'A)^-1A'] can be plotted on your measurement grid to see how much each individual measurement affects each fit coefficient.
 
I'm planning another set of measurements. NTK already mentioned that a bit more distance between the two measurement point cylinders might be good. I'm thinking of putting the hole setup on a speaker stand in a large barn to start off with a less 'echoic' situation. Gating the measurement may also allow only fitting without SFS.

IMG_20230318_163649415.jpg

Any thoughts, wishes, ...?
 
Matlab/Octave have the mldivide function which does the fitting. I tried to use your (@Ulf ) formula:

n.b. the variable orders are not really the orders. The orders 0 and 1 are shown. First 0 outgoing, next to the left 0 incoming, next to the left N=1, M=-1 outgoing, ...

function plot_measurement_influence(r, theta, z, PSI_mat) [x, y, z] = cyl2cart(r, theta, z); A = PSI_mat; B = A'*A; C = B^-1; D = C*A'; orders = size(D, 1); rows = ceil(sqrt(orders)); figure for ind = 1:orders subplot(rows, rows, ind) % scatter(theta, z, [], abs(D(ind,:)), 3, 'filled') scatter3(x, y, z, 3, abs(D(ind,:)), 'filled'); axis equal; colormap jet end endfunction

This gives the following:
measurement_influence.png


measurement_influence_more_orders.png


Is this to be expected? What can we learn? ...?
 
Last edited:
Is this to be expected? What can we learn? ...?
Yes, I think it looks quite nice. It would be better to use the same colormap range on all the plots, and add a colorbar, but even now you can see (I think?) that the edges of the cylinder are often weighted strongly. With a colorscale we could see how big the coefficients are, and see if they grow very fast for higher orders.
 
I take the absolute value as the weight are complex. Is that to be expected?

Wait.... that might also be the reason it doesn't depend on the angle. I remember something like that in plotting the sperical harmonics.
 
I take the absolute value as the weight are complex. Is that to be expected?

Wait.... that might also be the reason it doesn't depend on the angle. I remember something like that in plotting the sperical harmonics.
Ah, of course. Well, then the phase can also be interesting. But overall the absolute value shows you that the grid is a bit unbalanced and some points contribute much more than others. If you go to higher orders or more ill conditioned problems you should see that the absolute values grow a lot.
 
Back
Top Bottom