% read waveform files
[x1, fs, nbits] = wavread('00000005_16kHz.wav');
fprintf(1,'The sampling frequency of 00000005_16kHz.wav is %d Hz.\n',fs);
[x2, fs, nbits] = wavread('00000005_10kHz.wav');
fprintf(1,'The sampling frequency of 00000005_10kHz.wav is %d Hz.\n',fs);
[x3, fs, nbits] = wavread('00000005_8kHz.wav');
fprintf(1,'The sampling frequency of 00000005_8kHz.wav is %d Hz.\n',fs);

beg_time = 1.06;
end_time = 1.16;
% plot x1
beg_samp = round(beg_time*16000);
end_samp = round(end_time*16000);
subplot(3,1,1);
plot(x1(beg_samp:end_samp));
axis([0 end_samp-beg_samp+1 -0.5 0.5]);
title('16kHz');
% plot x2
beg_samp = round(beg_time*10000);
end_samp = round(end_time*10000);
subplot(3,1,2);
plot(x2(beg_samp:end_samp));
axis([0 end_samp-beg_samp+1 -0.5 0.5]);
title('10kHz');
% plot x3
beg_samp = round(beg_time*8000);
end_samp = round(end_time*8000);
subplot(3,1,3);
plot(x3(beg_samp:end_samp));
axis([0 end_samp-beg_samp+1 -0.5 0.5]);
title('8kHz');
xlabel('samples');