# Symmetrical waveform of sound

How can I record my sound to get the symmetrical waveform?

AudioPlot[mysound, PlotStyle -> Red, AxesStyle -> Blue]


Or

How can I transform "my sound" to get the symmetrical waveform?

• What is the 'symmetrical waveform'? – N.J.Evans Apr 19 '17 at 20:17
• @N.J.Evans when the "axis of symmetry" is the horizontal blue line – vito Apr 19 '17 at 20:42
• It could be forced to symmetric with an appropriately chosen nonlinear transformation, but what is the point of doing such a thing? This is an important question because there are infinitely many such transformations, most having an audible effect on the sound. – Szabolcs Apr 20 '17 at 10:03
• @Szabolcs I want to make a 3D gift from the sound wave. see here, I want to rotate it around the horizontal axis. – vito Apr 20 '17 at 13:01
• But that question is completely unrelated to audio processing! This is about graphics and 3D, and not about sound. You don't have to make the sound symmetric. Anyway, you don't need "symmetric" sound to use Vitaliy's method from that post. – Szabolcs Apr 20 '17 at 15:20

Since you are interested in a visual representation of the audio waveform, there is no need to worry about the (audio) fidelity of the transformation. This reads in a sound, and then forces it to be symmetric.

a = Abs[AudioData[ExampleData[{"Audio", "BlackcapWarbler"}]][[1]]];
asym = Table[If[EvenQ[i], a[[i]], -a[[i]]], {i, Length[a]}];
ListLinePlot[asym, PlotRange -> All]


I see in your example ,audio file is tt5.wav.

audio = Audio["tt5.wav"];
minmax = AudioBlockMap[MinMax, audio, .01]


You can view the max, min and mean of audio.

Show[AudioPlot[audio, AspectRatio -> 1/2, PlotRange -> All],
ListLinePlot[minmax, PlotStyle -> {Orange, Darker[Green]}, PlotRange -> {-1, 1}],
ListLinePlot[TimeSeriesMap[Mean, minmax], PlotStyle -> Red, PlotRange -> {-1, 1}]]


Then Using sample of audio Subtract the mean of audio,then it should be a symmetrical waveform.

you can use this to get it.Perfect!

newaudio = AudioSpectralMap[If[Abs@#Value < 2, 0., #Value] &, audio - Audio[TimeSeriesMap[Mean, minmax]]]

AudioPlot@newaudio