Modeling/Simulations
Sinusoidal Phase Modulation
Animation of modeled 10 speaker array playing single sine wave with phase of each speaker varying sinusoidally over time:
Mathematica Source:
pointAudioSource[x0_, y0_, z0_, f_, phase_, amplitude_, x_, y_, z_, time_] := amplitude*Cos[f*(phase + time + (Sqrt[((x - x0)^2 + (y - y0)^2 + (z - z0)^2)]/v))*(2*\[Pi])]/((x - x0)^2 + (y - y0)^2 + (z - z0)^2)
field3[x_, y_, z_, time_, theta_] :=
pointAudioSource[0.1, 0, 0, freq, -1.20906 Sin[1.5708 - theta], 1, x, y, z, time] +
pointAudioSource[0.3, 0, 0, freq, 1.20906 Sin[0.381544 + theta], 1, x, y, z, time] +
pointAudioSource[0.5, 0, 0, freq, 1.20906 Sin[0.92284 + theta] , 1, x, y, z, time] +
pointAudioSource[0.1, 0.4, 0, freq, -1.20906 Sin[0.16799 - theta], 1, x, y, z, time] +
pointAudioSource[0.3, 0.4, 0, freq, -1.20906 Sin[0.177993 - theta], 1, x, y, z, time] +
pointAudioSource[0.5, 0.4, 0, freq, -1.20906 Sin[0.299683 - theta], 1, x, y, z, time] +
pointAudioSource[0, 0.2, 0, freq, 1.20906 Sin[0.0417874 + theta], 1, x, y, z, time] +
pointAudioSource[0.2, 0.2, 0, freq, 1.20906 Sin[0.659576 + theta], 1, x, y, z, time] +
pointAudioSource[0.4, 0.2, 0, freq, 1.20906 Sin[0.106628 + theta], 1, x, y, z, time] +
pointAudioSource[0.6, 0.2, 0, freq, 1.20906 Sin[0.800743 + theta], 1, x, y, z, time]
Do[phases[i] = (1.2090607921047687)*Sin[{-1.5707963267948966`, 0.38154404262228914`, 0.9228402364529483`, -0.16798999381183755`, -0.17799269089222564`, -0.29968344931072827`, 0.04178744869657669`, 0.6595761338362179`, 0.10662773785801957`, 0.800743201331063`}[[i + 1]] + theta], {i, 0, 9}]
freq = 2000
v = 300
Export["Animation.avi", ListAnimate[Table[DensityPlot[Log[Abs[field3[0, y, x, 0, t]]], {x, -4, 4}, {y, -4, 4}, PlotPoints -> 50], {t, 0, 2*3.14159, 2*3.14159/200}], 20]]
Manual Phase Modulation
Mathematica Source
pointAudioSource[x0_, y0_, z0_, f_, phase_, amplitude_, x_, y_, z_, time_] := amplitude*Cos[f*(phase + time + (Sqrt[((x - x0)^2 + (y - y0)^2 + (z - z0)^2)]/v))*(2*\[Pi])]/((x - x0)^2 + (y - y0)^2 + (z - z0)^2)
freq = 2000
v = 300
field3[x_, y_, z_, time_, phase0_, phase1_ , phase2_, phase3_, phase4_, phase5_, phase6_, phase7_, phase8_, phase9_] :=
pointAudioSource[0.1, 0, 0, freq, phase0, 1, x, y, z, time] +
pointAudioSource[0.3, 0, 0, freq, phase1, 1, x, y, z, time] +
pointAudioSource[0.5, 0, 0, freq, phase2 , 1, x, y, z, time] +
pointAudioSource[0.1, 0.4, 0, freq, phase3, 1, x, y, z, time] +
pointAudioSource[0.3, 0.4, 0, freq, phase4, 1, x, y, z, time] +
pointAudioSource[0.5, 0.4, 0, freq, phase5, 1, x, y, z, time] +
pointAudioSource[0, 0.2, 0, freq, phase6, 1, x, y, z, time] +
pointAudioSource[0.2, 0.2, 0, freq, phase7, 1, x, y, z, time] +
pointAudioSource[0.4, 0.2, 0, freq, phase8, 1, x, y, z, time] +
pointAudioSource[0.6, 0.2, 0, freq, phase9, 1, x, y, z, time]
Manipulate[ContourPlot[Log[Abs[field3[x, y, 0, 0, phas0, phas1 , phas2, phas3, phas4, phas5, phas6, phas7, phas8, phas9]]], {x, -5, 5}, {y, -5, 5}, PlotPoints -> 5, PlotRange -> 10],
{phas0, 0, 2*Pi}, {phas1, 0, 2*Pi}, {phas2, 0, 2*Pi}, {phas3, 0, 2*Pi}, {phas4, 0, 2*Pi}, {phas5, 0, 2*Pi}, {phas6, 0, 2*Pi}, {phas7, 0, 2*Pi}, {phas8, 0, 2*Pi}, {phas9, 0, 2*Pi}]
Comments (0)
You don't have permission to comment on this page.