Prediction: visualizing phase contours

Frank Koenig

Sophomore
Mar 7, 2011
187
0
16
Palo Alto, CA USA
www.dunmovin.com
Here's a bit more armchair audio. Prediction programs show us the spatial distribution of the magnitude of the sound pressure, which, generally, is what we want to know.

I got curious about how contours of constant phase might look. The possible practical value of this might be to find ways to arrange speakers so that non-collocated mains and subs might better combine over a larger listening area. (I know, this is probably a fool's errand, but it's what got me interested.)

So I wrote a VERY basic 2-D prediction program to have a look. The R code is included in its entirety below. The sources are all ideal point sources and there is no smoothing in space or frequency. The example images are for a typical end-fire sub array at the null frequency of 62.5 Hz, and for a split mono system, also at 62.5 Hz, with the sources separated by 40 ft.

Interesting to me are the phase discontinuities at the nulls in the pattern for the split case.

It would be cool, if not useful, for commercial prediction programs to let us see phase. The information is already computed -- it just needs to be displayed. (Danley/GPA??)

EndFire63Mag.jpgEndFire63Phase.jpgSplitMono63Mag.jpgSplitMono63Phase.jpg

Reinventing the wheel, as always,

--Frank
---------------------------------------------------------------------------------------
rm(list = ls())
X <- 100 #length of prediction (ft)
Y <- 100 #width of prediction (ft)
res <- 4 #spatial resolution (points/ft)

M <- X * res
N <- Y * res

x <- (1:M - M/2) / res
y <- (1:N - N/2) / res

f <- 62.5 #frequency (Hz)
omega <- 2 * pi * f #frequency (rad/s)
c <- 1130 #velocity (ft/s)
k <- omega / c #wave number (1/ft)

I <- 4 #number of sources used in this run

S <- matrix(nrow = 10, ncol = 4) #source parameters -- max of 10 sources allocated
S[1,1] <- 4.52 #x coord (ft)
S[1,2] <- 3 #y coord (ft)
S[1,3] <- 1 #sound pressure (relative)
S[1,4] <- .004 #delay (s)

S[2,1] <- 0
S[2,2] <- 1
S[2,3] <- 1
S[2,4] <- 0

S[3,1] <- 0
S[3,2] <- -1
S[3,3] <- 1
S[3,4] <- 0

S[4,1] <- 4.52
S[4,2] <- -3
S[4,3] <- 1
S[4,4] <- .004

d <- matrix(nrow = M, ncol = N) #distance to source at each point(ft)
p <- matrix(data = complex(1, 0, 0), nrow = M, ncol = N) #complex sound pressure at each point

for (i in 1:I){ #for each source
for (m in 1:M){ #for each x value
d[m, 1:N] <- ((x[m] - S[i,1])^2 + (y[1:N] - S[i, 2])^2)^.5
p[m, 1:N] <- p[m, 1:N] + complex(1, modulus = S[i,3] / d[m, 1:N], argument = k * d[m, 1:N] + S[i,4] * omega)
}
}

windows(7, 7) #plot magnitude
image(x, y, -20*log(Mod(p), 10), zlim = c(0, 42), col = rainbow(256, start = 0, end = .8))

windows(7, 7) #plot phase
image(x, y, Arg(p), zlim = c(-pi, pi), col = rainbow(256, start = 0, end = .8))
 
Re: Prediction: visualizing phase contours

Frank,

I'm no good in MatLab / R so it's very nice of you to post this example. My only question is, for relatively omnidirectional sources like subwoofers, the magnitude response plot is basically a direct image of the phase differences between sources, what does this help you see better than looking in the frequency domain?
 
Re: Prediction: visualizing phase contours

It is not as easy as people would like to make it out to be.

First of all-how many companies (besides Danley) even SHOW a phase response? There might be a reason--------------------------------------------

Second-exactly how do you determine what the "correct" phase response is? If you change the receive delay even just a small tad-the phase response (as shown on the display) will change quite a bit-especially at the higher freq.

So you can have displays that show very different phase responses-yet nothing has changed with the speaker-just with the way it is measured.

So what is correct? Why? Yes you can easily draw a "textbook" phase reponse-but in almost every case the speaker does not exhibit that response-ESPECIALLY if you move the mic to a different listening position. The worse the loudspeaker (in terms of driver offsets) the worse it will get.

So collecting the data is the first hard part-and then what do you do with it- is the next hard part. And how do you actually compare it to other products-that don't even provide the data.

So without others to compare to-you have to real "reference" as to whether a speaker is good or bad-as compared to another.
 
Re: Prediction: visualizing phase contours

Frank,

I'm no good in MatLab / R so it's very nice of you to post this example. My only question is, for relatively omnidirectional sources like subwoofers, the magnitude response plot is basically a direct image of the phase differences between sources, what does this help you see better than looking in the frequency domain?
Bennett,

I'm not sure that this exercise has any use beyond being yet another way
of automatically generating psychedelic pictures. It does show a
snapshot of the wave, irrespective of amplitude, at a particular
frequency (sinusoidal steady state).

I agree that the magnitude of the frequency response, at every point in
the listening area, is what's perceptually important. In particular, I
think, and correct me if I'm wrong, we want to know where the spacing of
the cancellation frequencies (zeros) exceeds the critical bandwidth. And
that really is a data representation problem (how fashionable!). Maybe a
suckout and combing map of some sort? The "Suck Map" :)

If anyone has any ideas on representing these sorts of data, speak up. Maybe I, or someone, can code it up.

--Frank
 
Re: Prediction: visualizing phase contours

It is not as easy as people would like to make it out to be.

Ivan,

Indulge me here, I'm about the last guy to think that anything is "simple", in audio or any other field. (In my life as an engineer I learned to take it as a warning whenever anyone told me something was simple.) I do, however, value models to help with the understanding of complex physical systems. It's not much of a stretch to say that models are the basis of engineering.

Few of us would say that Dick Small's (and others) work on vented boxes is useless, just because no real woofer behaves exactly as the model says. The model has predictive power and teaches us about some of the available trade-offs. More refined models get closer to reality.

I fiddle around with little programs to cultivate my intuition and for the challenge of getting it to work. At the very least it makes me appreciate what the real practitioners in the field, like you, do. I said at the outset it was armchair audio.

This weekend I'm going to hoist several hundred pounds of speakers in the air and make noise in front of the public. Maybe that should be called folding chair audio.

Best regards,

--Frank
 
Re: Prediction: visualizing phase contours

I'm not sure that this exercise has any use beyond being yet another way
of automatically generating psychedelic pictures.

Frank, this is the best description of acoustic prediction software I have ever heard.

P.S. I think the magnitude domain is less important than many make it out to be, and many effects heard in the "magnitude domain" are actually obvious because of our ear/brain's sensitivity to the time domain. The bump in magnitude there belies an issue that we're really hearing elsewhere. Obviously gross cancellations and additions due to phase are important and A Big Deal™, but getting perfect frequency response smoothness is not as important for great sound as it appears.
 
Frank, this is the best description of acoustic prediction software I have ever heard.

P.S. I think the magnitude domain is less important than many make it out to be, and many effects heard in the "magnitude domain" are actually obvious because of our ear/brain's sensitivity to the time domain. The bump in magnitude there belies an issue that we're really hearing elsewhere. Obviously gross cancellations and additions due to phase are important and A Big Deal™, but getting perfect frequency response smoothness is not as important for great sound as it appears.

Or maybe it is a case of fix the timing and magnitude will take care of itself.

Or there are s couple of parts on an Audi that can be fixed with s hammer but that doesn't mean all mechanical problems should be fixed with s hammer.

Eq is often used as an audio hammer.
 
Re: Prediction: visualizing phase contours

Frank, this is the best description of acoustic prediction software I have ever heard.

P.S. I think the magnitude domain is less important than many make it out to be, and many effects heard in the "magnitude domain" are actually obvious because of our ear/brain's sensitivity to the time domain. The bump in magnitude there belies an issue that we're really hearing elsewhere. Obviously gross cancellations and additions due to phase are important and A Big Deal™, but getting perfect frequency response smoothness is not as important for great sound as it appears.

I think magnitude response is most important but agree being well behaved is more important than being ruler flat. The problem with trying to perfect magnitude response with conventional measurement systems is that magnitude is a one dimensional measurement (or two with level vs time), but sound in a 3 dimensional space is more complex than that. We are all familiar the automatic EQ functions that sound like crap despite flat response for some measurement point.

Phase response errors that cause bumps or notches, have caused magnitude errors. The cillia in our ears wiggle in response to magnitude not phase or arrival time. That is a post processing matter inside our grey machinery.

All else equal phase should be managed too (after amplitude). I think one of the more promising things about the Danley speakers is their attention to how drivers combine with each other, promising both good amplitude and phase response.

JR