• 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

mwmkravchenko

Active Member
Joined
Nov 20, 2018
Messages
181
Likes
195
Location
Perth Ontario
“Should have thought of that myself..."

Nah…that’s what audio friends are for! Bummer the option is not part of Octave.

Few
Maybe there's an alternate method to do it? Just thinking.

Mark
 

Tom Kamphuys

Member
Joined
Feb 15, 2024
Messages
9
Likes
23
Yeah, I hacked together a function: round(in*10^N)/10^N. Don't know if thats good enough, but the program didn't complain about round anymore.

There are however some more problems. I guess I have to wait for NTK. I'll see if I can understand his docs.
 

Tom Kamphuys

Member
Joined
Feb 15, 2024
Messages
9
Likes
23
It seems that Octave crashes when the nr of measurements is >500 (roughly).

I've been playing a bit with the software and reading the documentation. Both are very impressive.

Currently the number of modes are predetermined. If my memory doesn't fail me, the fact that spherical harmonics are orthogonal functions means that every mode can be determined in isolation. Adding another node in de fit should not alter the already calculated coefficients. Just like with adding (co)sines with higher frequencies to fit e.g. a square wave and unlike polynomial fitting. Does that also hold when there is noise on the measurements and you're doing a least squares fit?

I was wondering if we could keep adding modes and see the residue go down until and stop when the solution starts diverging. If that works, one could do that per frequency as for low frequencies it is unlikely that you need a lot of modes.
 

Tom Kamphuys

Member
Joined
Feb 15, 2024
Messages
9
Likes
23
Is what @NTK does a spherical harmonic transform? There are lots of papers online and (efficient) implementations of that. I don't necessarily need to go faster (yet), but if spherical harmonic transform is the term for what we need, we have a new term to search on the internet.

from 9:00
 

Attachments

  • Efficient Spherical Harmonic Transforms aimed at pseudo-spectral numerical simulations.pdf
    205.1 KB · Views: 18
Last edited:

mwmkravchenko

Active Member
Joined
Nov 20, 2018
Messages
181
Likes
195
Location
Perth Ontario
It seems that Octave crashes when the nr of measurements is >500 (roughly).

I've been playing a bit with the software and reading the documentation. Both are very impressive.

Currently the number of modes are predetermined. If my memory doesn't fail me, the fact that spherical harmonics are orthogonal functions means that every mode can be determined in isolation. Adding another node in de fit should not alter the already calculated coefficients. Just like with adding (co)sines with higher frequencies to fit e.g. a square wave and unlike polynomial fitting. Does that also hold when there is noise on the measurements and you're doing a least squares fit?

I was wondering if we could keep adding modes and see the residue go down until and stop when the solution starts diverging. If that works, one could do that per frequency as for low frequencies it is unlikely that you need a lot of modes.
Low frequency will be where you have the greatest room interactions. That may need more measurements than you might think to iron out the difference between the source signal and the measured results. There could even be a check between a resonable expectation of the mic results versus the input signal. That may be what is done in the Klippel software?
 
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,703
Likes
5,956
Location
US East
Yeah, I hacked together a function: round(in*10^N)/10^N. Don't know if thats good enough, but the program didn't complain about round anymore.

There are however some more problems. I guess I have to wait for NTK. I'll see if I can understand his docs.
I haven't touched the code for years, and am trying to refamiliarize myself with it. May take a day or two (or more).
 

Few

Member
Joined
Oct 27, 2020
Messages
91
Likes
95
It looks to me like the spherical harmonic transform is the same as the fit to the angular components of the sound field. it doesn’t include the radial component, or the field separation. At least that’s my impression.
Few

edit: Maybe posted prematurely. I now see that later in the video he introduces radial components, hence the “3-d” spherical harmonic transform I had missed previously.
 
Last edited:

Few

Member
Joined
Oct 27, 2020
Messages
91
Likes
95
For those interested in using Python, I just found this source of spherical harmonics tools. I’m not sure if they do anything NTK hasn’t already worked out.
Few
 
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,703
Likes
5,956
Location
US East
For the 2-D simplification, I think the 2-D [Edit] polar cylindrical approximation is more appropriate. The polar cylindrical approximation assumes the sound radiation is axisymmetric to the axis of the driver (the radiated sound is a function of r and θ only). There are a number of papers by R. Aarts and A. Janssen (modeling a speaker as a spherical cap on a rigid sphere) that explained the mathematics in details.

spherical cap.png


Below is Janssen's home page at Technical University Eindhoven. Paper 179 (Sound radiation from a resilient spherical cap on a rigid sphere) summarizes their math pretty well.

[Edit] Polar, not cylindrical :facepalm:
 
Last edited:

Tom Kamphuys

Member
Joined
Feb 15, 2024
Messages
9
Likes
23
I already hacked your code to try 2D. I posted at diyaudio. It's not really handy to have two threads :)

1708627514607.png
 

Tom Kamphuys

Member
Joined
Feb 15, 2024
Messages
9
Likes
23
I'm not sure. Maybe this thread can focus more on your code. The other thread is quite active, which is good, but also sidesteps quite a lot, which is not so good.

@NTK Is it ok to put your code on GitHub so we can collaborate? I can do it on mine if that's easier for you. But you're the author, so I'll let you decide.
 
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,703
Likes
5,956
Location
US East
@NTK Is it ok to put your code on GitHub so we can collaborate? I can do it on mine if that's easier for you. But you're the author, so I'll let you decide.
Please go ahead. I released my work with the CC0 license (public domain), so anyone should feel free to do what they want with it.
 

Tom Kamphuys

Member
Joined
Feb 15, 2024
Messages
9
Likes
23
I created a GitHub repo for NTK's Matlab/Octave code. If should be publicly accessable. I can change the name of the repo. Anyone can contribute to this nice piece of software. Let's take this to the next level together!


I also created a feature/2D branch with my first baby steps towards 2D. Still in a very hacky state...
 
Top Bottom