MATLAB: Convert mat files to wav

bird song wav

I have followed the steps here as closely as I can: https://www.mathworks.com/help/matlab/ref/audiowrite.html
I am using MATLAB R2016b.
I am attempting to listen to these bird songs and save them as .wav files: http://datadryad.org/resource/doi:10.5061/dryad.9nv3b.
Audio_Bird9 is the smallest file, so am I working with this one specifically.
I have defined y = 1.0, and Fs = 48000, but I have not successfully created a .wav output file that produces sound.
I am sure they are lovely songs, and I would love to hear them, if anyone can offer me a working code. Thank you!
Robert

Best Answer

In Section 5 ‘Materials and Methods’, the authors note: ‘... pied butcherbird singing performances were digitally recorded at a sample rate of 44.1 kHz and 16 bits ...’
With that added bit of information, you can hear them in their full glory, for example:
d = load('Audio_Bird1.mat');
Bird1 = d.Audio_Bird1;
Fs = 44.1E+3; % Sampling Frequency
nBits = 16; % Bit Resolution
Audio_Bird1 = audioplayer(Bird1, Fs, nBits); % Create ‘audioplayer’ Object
audiowrite('Audio_Bird1.wav', Bird1, Fs, 'BitsPerSample',nBits, 'Comment','Australian pied butcherbird song - Bird1');
play(Audio_Bird1) % Play Song
EDIT Added sudiowrite call to save as .wav file.
Related Question