%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Read from a WAV file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[Y,fs]=audioread('note_440Hz.wav'); % read the WAV file
nSamples= size(Y,1)    % print the size of the data (in samples)
fs                     % print the sampling frequency (in Hz)    
figure;
plot(1:1000,Y(1:1000), 'b.');    % plot the first 1000 samples 
xlabel('Sample number (only the first 1000)');
ylabel('Y');
title('The wave for a 440 Hz sine, sampled at 44,100 Hz');
