0
$\begingroup$

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

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

enter image description here

Or

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

$\endgroup$
  • $\begingroup$ What is the 'symmetrical waveform'? $\endgroup$ – N.J.Evans Apr 19 '17 at 20:17
  • $\begingroup$ @N.J.Evans when the "axis of symmetry" is the horizontal blue line $\endgroup$ – vito Apr 19 '17 at 20:42
  • 2
    $\begingroup$ 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. $\endgroup$ – Szabolcs Apr 20 '17 at 10:03
  • 1
    $\begingroup$ @Szabolcs I want to make a 3D gift from the sound wave. see here, I want to rotate it around the horizontal axis. $\endgroup$ – vito Apr 20 '17 at 13:01
  • 1
    $\begingroup$ 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. $\endgroup$ – Szabolcs Apr 20 '17 at 15:20
1
$\begingroup$

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]

enter image description here

$\endgroup$
0
$\begingroup$

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}]]

enter image description here

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

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.