Log in
Register
Home
Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
News
Members
Current visitors
New profile posts
Search profile posts
Features
Log in
Register
Search
Search titles only
By:
Search titles only
By:
New posts
Search forums
Menu
Install the app
Install
Reply to thread
Home
Forums
Off Topic
The Basement
Prediction: visualizing phase contours
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Frank Koenig" data-source="post: 8249" data-attributes="member: 416"><p>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.</p><p></p><p>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.)</p><p></p><p>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.</p><p></p><p>Interesting to me are the phase discontinuities at the nulls in the pattern for the split case.</p><p></p><p>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??)</p><p></p><p>[ATTACH]158389[/ATTACH][ATTACH]158390[/ATTACH][ATTACH]158391[/ATTACH][ATTACH]158388[/ATTACH]</p><p></p><p>Reinventing the wheel, as always,</p><p></p><p>--Frank </p><p>---------------------------------------------------------------------------------------</p><p>rm(list = ls())</p><p>X <- 100 #length of prediction (ft)</p><p>Y <- 100 #width of prediction (ft)</p><p>res <- 4 #spatial resolution (points/ft)</p><p></p><p>M <- X * res</p><p>N <- Y * res</p><p></p><p>x <- (1:M - M/2) / res</p><p>y <- (1:N - N/2) / res</p><p></p><p>f <- 62.5 #frequency (Hz)</p><p>omega <- 2 * pi * f #frequency (rad/s)</p><p>c <- 1130 #velocity (ft/s)</p><p>k <- omega / c #wave number (1/ft)</p><p></p><p>I <- 4 #number of sources used in this run</p><p></p><p>S <- matrix(nrow = 10, ncol = 4) #source parameters -- max of 10 sources allocated</p><p>S[1,1] <- 4.52 #x coord (ft)</p><p>S[1,2] <- 3 #y coord (ft)</p><p>S[1,3] <- 1 #sound pressure (relative)</p><p>S[1,4] <- .004 #delay (s)</p><p></p><p>S[2,1] <- 0</p><p>S[2,2] <- 1</p><p>S[2,3] <- 1</p><p>S[2,4] <- 0</p><p></p><p>S[3,1] <- 0</p><p>S[3,2] <- -1</p><p>S[3,3] <- 1</p><p>S[3,4] <- 0</p><p></p><p>S[4,1] <- 4.52</p><p>S[4,2] <- -3</p><p>S[4,3] <- 1</p><p>S[4,4] <- .004</p><p></p><p>d <- matrix(nrow = M, ncol = N) #distance to source at each point(ft)</p><p>p <- matrix(data = complex(1, 0, 0), nrow = M, ncol = N) #complex sound pressure at each point</p><p></p><p>for (i in 1:I){ #for each source</p><p> for (m in 1:M){ #for each x value</p><p> d[m, 1:N] <- ((x[m] - S[i,1])^2 + (y[1:N] - S[i, 2])^2)^.5</p><p> 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)</p><p> }</p><p>}</p><p></p><p>windows(7, 7) #plot magnitude</p><p>image(x, y, -20*log(Mod(p), 10), zlim = c(0, 42), col = rainbow(256, start = 0, end = .8)) </p><p></p><p>windows(7, 7) #plot phase</p><p>image(x, y, Arg(p), zlim = c(-pi, pi), col = rainbow(256, start = 0, end = .8))</p></blockquote><p></p>
[QUOTE="Frank Koenig, post: 8249, member: 416"] 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??) [ATTACH=CONFIG]158389.vB5-legacyid=7691[/ATTACH][ATTACH=CONFIG]158390.vB5-legacyid=7692[/ATTACH][ATTACH=CONFIG]158391.vB5-legacyid=7693[/ATTACH][ATTACH=CONFIG]158388.vB5-legacyid=7690[/ATTACH] 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)) [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
Off Topic
The Basement
Prediction: visualizing phase contours
Top
Bottom
Sign-up
or
log in
to join the discussion today!