The samples from a digital audio file can be imported into Matlab by using a built-in function: audioread.

 

The basic syntax for using the function is the following:

 

[y, Fs] = audioread(filename)
 

Input Variable:

filename – a string containing the name of the file. Example: ‘testSignal.wav’ 

 

Output Variables:

y – an array containing the samples of the audio signal.

 

Fs – a scalar of the sound file’s sampling rate.

 

 

Further documentation for the function is available here.

Links to other related functions: sound, audiowrite, audioinfo, plot

Receive Updates

No spam guarantee.