## Extracting a time series from a sound object

4

After importing a sound file, how can I generate a time series (preferably as an $n\times 1$ matrix) which gives the intensity at equal time intervals?

5

Let the imported sound be

sound = ExampleData[{"Sound", "JetSound"}]

One can extract the SampledSoundList with

sound[[1]]

This example has 2 channels and a sampling rate of 44100 Hz, as can be seen not only in the sound object box, but also from

Length@sound[[1, 1]]

2

sound[[1, 2]]

44100

To get the list of the amplitudes of the first channel one can use

channel1Amp = sound[[1, 1, 1]];

and generate a plot of these amplitudes using

ListPlot[channel1Amp, PlotRange -> All, Frame -> True]

The amplitudes of the second channel are

channel2Amp = sound[[1, 1, 2]];

## Downsampling

Downsampling the first channel by a factor of 5

channel1AmpDS = Downsample[channel1Amp, 5];

ListPlot[channel1AmpDS, PlotRange -> All, Frame -> True]

There is also Upsample and the more general ArrayResample that can be used to change the sampling rate.

Can you please tell me how to change the sampling rate? – Sankhadip Chakraborty – 2015-06-22T13:59:07.007

@SankhadipChakraborty The question in your comment isn't very specific. Please check the edit of my answer. Hope you didn't mean something like newSound = sound; newSound[[1, -1]] = 10000; newSound. – Karsten 7. – 2015-06-22T15:32:48.907