# Wolfram Mathematica

In:= ```a = BandpassFilter[ AudioNormalize@ AudioResample[Import["ExampleData/rule30.wav"], 96000], {Quantity[ 10, "Hertz"], Quantity[5000, "Hertz"]}, 201]```
In:= ```Periodogram[a, 2000, ImageSize -> Small, PlotRange -> {{0, 10000}, All}]```
Out= Modulate the amplitude with a 22,050 Hz sinusoid to shift the content at the high end of the spectrum. The result should be already inaudible for most people.

In:= ```amsignal = ((.5 + a) AudioGenerator[{"Sin", Quantity[22050, "Hertz"]}, Duration@a])/2```
In:= `Periodogram[amsignal, 2200, ImageSize -> Small]`
Out= Demodulate the AM signal by multiplying the result by another sinusoid at 22,050 Hz with the same phase.

In:= ```result = BandpassFilter[ amsignal*AudioGenerator[{"Sin", Quantity[22050, "Hertz"]}, Duration@amsignal], {Quantity[100, "Hertz"], Quantity[5000, "Hertz"]}, 201]```

Use a nonlinear filter to demodulate an AM signal.

In:= ```BandpassFilter[# - Mean@# &@ MaxFilter[amsignal, 4], {Quantity[100, "Hertz"], Quantity[5000, "Hertz"]}, 201]```