Xsim-3D development... I could use some math help

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I've been working on a major revision of Xsim, to also include the effects of driver positioning and room boundary effects. The idea is that you can move the location of a virtual microphone (actually by holding the "mic" still and spinning the room in the GUI!) to get a simulation of the off-axis response of the speaker due to differing driver locations and off-axis driver responses. Because we can't just pretend that only the on-axis response matters.

(NOTE, I'm not trying to handle baffle edge diffraction, at least not for a while -- that's a bigger battle for another day.)

A lot of this is working (at least somewhat), but I've kind of run into a snag, and I don't know if it is something that can be recovered from. Someone is going to ask, so yeah, you can download it to play with it from http://libinst.com/Xsim/BetaTest/XSim3DSetup.exe . But please, limit or even resist making requests or telling me what you want this to do -- I REALLY don't want to be the programmer for something "designed by committee", I have enough trouble keeping up with my own plans for this! And it's also too early to be overwhelming me with buglists!
attachment.php


At present, XSim3D only handles drivers that can be modeled as circular pistions, using the well-known far-field pressure formula (easy to find via Google) to get their off-axis frequency responses. So far, so good, I get reasonable looking results for things like line arrays and D'Appolito configurations. I had intended to also include the possibility of using a series of FRD response files consisting of an array for horizontal and and array for vertical, to model things like horns or drivers that aren't symmetrical and don't resemble circular pistons. The idea was that I'd be able to interpolate between those curves for angles between, and be able to combine horizontal and vertical to get a decent estimated response at points that are off-axis both in the horizontal and the vertical.

That's where the problem at present comes in. I can (relatively) reasonably interpolate data from multiple for positions that are off-axis in only the horizontal or only the vertical. But I can't come up with a way to combine H and V for diagonal angles. I'm not even sure now that doing that makes any sense. If your eyes haven't clouded-over already up to now, they might for the following if you don't like playing with math, trig, and calculus, so -- fair warning. For those who are good at this, my apologies for any terminology I might get wrong. I'm decent at math, but no wizard, and am rusty on the stuff I might've understood decades ago.
__
It took a bit, but I realized about a month ago that multiple rotations of things, in straightforward 3D vector rotation matrix terms, depends on the order you do them in. If you rotate horizontally (on an axis that starts out as a vertical line through the rotated thing) then rotate vertically as well, you don't get the same result as you would if you rotated first vertically and then horizontally. For specifying angular positions at fixed distance from a "target" location, I needed a way that was defined by the final orientation of the thing rather than two processes it took to get there -- a function of two angles done in one swoop. I went with defining the "H" angle as the angle a rotated vector would make with the z axis if projected onto the xz plane (the z axis is paralle with the floor, from mic to "target"). Similar definition used for a "V" angle, with the yz plane. That way, if you pull the mic up H degrees and V degrees to the side, you get the same result no matter which order you do them in.

I can take the Piston pressure formula and modify it so that the sin(Theta) term is redefined in terms of the two H and V angles, to handle it accordingly. Just back calculate to find the single angle that specification makes with the z axis normal to the driver disk. What I can't get my head around is a way to combine off-axis responses. I can take the angle Theta and break it into the two H and V angles, and I can calculate off-axis responses for only H and V, substituting those for "Theta". If I measured an (ideal piston, in the farfield) driver off-axis at the H and at the V angles, those are the responses I'd get. But I see no way to combine those that nets me the response for "Theta" unless H and/or V are zero.

Is this not a feasible thing to do? A while ago I thought maybe my way of defining H and V for 3D is the problem, but now I'm thinking that the idea of transmogrifying frequency responses taken at two orthogonal angles to get one that resembles being off-axis in both angles (defined somehow) maybe isn't doable? Comments, ideas, correct my hurting brain?

Maybe I should skip the "from off-axis FRD files" option, or lock the simulation so only one angle off-axis can be done at a time?
 

Attachments

  • 3d pic.png
    3d pic.png
    50.4 KB · Views: 2,953
Last edited:
diyAudio Moderator
Joined 2008
Paid Member
I can (relatively) reasonably interpolate data from multiple for positions that are off-axis in only the horizontal or only the vertical. But I can't come up with a way to combine H and V for diagonal angles. I'm not even sure now that doing that makes any sense.
Perhaps the trick lies in the (H vs V) transition angle not being 45 degrees for shapes that are not symmetrical. Have you considered deriving this by drawing from the centre of the shape to one of the 'virtual' corners? As for an assymetrical diamond shape, a line passing through both the middle of the shape and the middle of one of the sides. Also I'm considering it as a (eg) dome portion of a plane (representing the normal -90 - +90) rotated continually between vertical and horizontal and weighted between the two.
 
Last edited:
diyAudio Moderator
Joined 2008
Paid Member
to combine off-axis responses. I can take the angle Theta and break it into the two H and V angles, and I can calculate off-axis responses for only H and V,
Sorry if I'm trying hard to follow. You're taking any position in space in front of a circular piston and want the angle from the Z axis, or are you trying to use this to combine an H/V pair (which I would expect to be the same)?
 
He is wanting to determine response at a combined horizontal and vertical off-axis angle for a radiator that has different vertical and horizontal directivity. I know there are solutions for rectangular and elliptical pistons, but I believe he is interested in the more general case so he could use measured data for vertical sweep at horizontal angle = 0, and horizontal sweep at vertical angle = 0 to determine response at any combination of horizontal and vertical angle.
 
Last edited:
Perhaps the trick lies in the (H vs V) transition angle ...

Allen, Earl,

Thanks for replying. Sorry, I didn't explain this very well, and this might not be much better, but I'll try. The situation is this:

I have a math model for radiation from a disk at various angles relative to its normal (shown as the Z axis in this diagram). It's the usual pr() equation involving Bessel function and 1/R. So I can multiply that complex value (at each frequency) with a measured on-axis complex response value (at same each frequency) to get a not-completely-inaccurate estimate of the off-axis response of the driver, assuming that it can be reasonably modeled as a circular piston. [Edit: the original response would have to be delay adjusted to make it's source be at (0,0,0) for that to have a chance.] Here is a diagram of said disk, with a microphone looking at it from a distance along a vector that is at an angle "Theta" relative to a normal vector at the disk center:

658475d1516747633-xsim-3d-development-math-help-3d-angles-sketch-png

For rotating the "scene", and for later attempts at estimating off-angle responses from a driver that might not be Horizontal/Vertical symmetrical (terminology??), I break the value of the off-axis angle down into H and V components defined using the projection of the direction vector on the xz and yz planes (all axes defined as shown for a disk source). It's easy to get back and forth from the H and V angles to the value Theta for something symmetrical and known by a formula using the angle Theta.

But for a source that doesn't act like a symmetrical disk, and for which I don't have a mathematical equation, I wanted to use a series of frequency responses on lists (a table, or an array of complex values) measured from the actual source from off-axis horizontal and vertical angles. Like the diagram above, but with the disk replaced by, say, a horn or a ribbon. I was hoping to come up with the equivalent (for each sim frequency) of a 2D map of complex values, each being the complex response at the point (H,V).

After thinking about it more and playing around with some just-guesses math functions, I'm pretty sure that isn't a reasonable expectation. I can multiply the complex values (of a frequency response at a frequency) together and the magnitude result isn't terrible when one of the angles isn't far from zero, but delay is a complete mess so it won't work very well for summation of responses. (This checked using the disk radiation equation comparing with combined values calculated from the "component" H and V angle responses using the same equation. I'm suspecting that the only reasonably valid approach would really be to model non-disk drivers using a bunch of point sources arranged in the right shape (that wouldn't work for a horn though, would it?) and I don't think that could work with measured response data unless the points model were somehow fit to the measured curves. That, or to measure at a LOT of off-axis (both H and V together) to make a map and "pick the complex resp
closest point"? -- Though I can't imagine anyone would go to the trouble of making that many measurements.

But if anyone sees a way to do something like this, please speak up! Otherwise, all my clever off-axis and boundary reflection simulations won't work with anything other than radiating round pistons... :(
 

Attachments

  • 3d angles sketch.png
    3d angles sketch.png
    39.3 KB · Views: 2,152
Last edited:
He is wanting to determine response at a combined horizontal and vertical off-axis angle for a radiator that has different vertical and horizontal directivity. I know there are solutions for rectangular and elliptical pistons, but I believe he is interested in the more general case so he could use measured data for vertical sweep at horizontal angle = 0, and horizontal sweep at vertical angle = 0 to determine response at any combination of horizontal and vertical angle.

Thanks, bolserst. that's what I meant.

Though, now that you said it, it occurs to me that even the simpler case where H<>0 and V=0 (assuming i have a set of curves for different H) might not e doable either. For instance, how would I interpolate complex values between data at H=20 degrees and for H=40 degrees to estimate the values at H=30 degrees? For just magnitudes, it's easy, as done on those colored polar graphs, but something that works with delay??? I don't think so.

I do think I'm way over my head on this, though...
 
...Otherwise, all my clever off-axis and boundary reflection simulations won't work with anything other than radiating round pistons... :(
You could expand to include ribbons and ESLs without too much effort, using rectangular piston directivity.
I have found the attached formula to match well with measurements and brute force distributed point summation calculations.
With vertical angle set to 0, the horizontal directivity is that of a line source(ie sinc function) with line length = piston width, similar in the vertical direction using line length=piston height. This formula may provide some ideas of how to approach combining disparate H & V directivities. I'm still cogitating on it...:scratch:

BTW, the rectangular piston formula in Beranek Acoustics is just the product of the horizontal and vertical line source directivities and does not match as well.
 

Attachments

  • Rectangular_Piston_Directivity.png
    Rectangular_Piston_Directivity.png
    62.2 KB · Views: 340
I have found the attached formula to match well with measurements and brute force distributed point summation calculations.
With vertical angle set to 0, the horizontal directivity is that of a line source(ie sinc function) with line length = piston width, similar in the vertical direction using line length=piston height. This formula may provide some ideas of how to approach combining disparate H & V directivities. I'm still cogitating on it...:scratch:

BTW, the rectangular piston formula in Beranek Acoustics is just the product of the horizontal and vertical line source directivities and does not match as well.

Isn't the attached equation the same thing? (product of the horizontal and vertical line source directivities). I don't have the Beranek reference you mention..
 
The attached Beranek equation uses horizontal width(d1) and horizontal angle(theta1) to calculate the horizontal line directivity, d2 and theta2 for vertical line directivity and then multiplies them together.

The previous equation uses angle theta as angle relative to the piston normal, and phi as projected angle relative to the x-axis.(ie if vertical angle = 0 and then phi = 0deg, if horizontal angle = 0 then phi = 90deg)
 

Attachments

  • Rectangular_Piston_Directivity_Beranek.png
    Rectangular_Piston_Directivity_Beranek.png
    10.8 KB · Views: 269
Last edited:
Thinking out loud, here.... Maybe do some sort of weighted average (weight by cosines of the H and V angles?) of Mag/angle formatted values, with the angles first unwrapped?

I meant the angles of the complex result (arrayed by frequency) being "phase unwrapped". To avoid the issue of periodicity of phase values. I'll play with that a bit, see if there's any hope for that.
 
Another thought -- maybe to interpolate on group delay (with polarity) for the phase component? Or phase delay (from unwrapped frequency starting at 0 or 180degree at LF)?
I'll have to hack into the code and do somethings in different order to even try such things -- I currently do each frequency separately and combine, but to get these, I'd have to go through all frequencies per driver (and per reflection!) first do then get delay or unwrapped phase. Messy, but I don't want to give up, at least not yet.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.