%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Read from a WAV file and plot the Spectrogram
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[Y,FS,NBITS]=wavread('test440.wav'); % read the WAV file
figure;
plot(1:1000,Y(1:1000))               % plot the first 1000 samples 
xlabel('Sample number (only the first 1000)');
ylabel('Y');

figure;
spectrogram(Y, 512, 256, 512, FS, 'yaxis');

