# Extracting a time series from a sound object

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?

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 Jun 22 '15 at 13:59
• @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. Jun 22 '15 at 15:32