% first, draw the spectrum of the A440 tone (La 440Hz), together
% with the needed anti-aliasing filter for an output frequency of
% 44.1/22 = 2kHz
disp('++++++++++++++++++++++++++++++++++ Spectrum of AP-A440.wav');
wavspectrum( 'AP_A440.wav', 1, 0.5, 22);
print -djpeg99 -r50 AP_A440.jpg
print -depsc2 AP_A440.eps
close;
wavspectrum( 'AP_A440.wav', 1, 0.5, 22, 1);
print -djpeg99 -r50 AP_A440-log.jpg
print -depsc2 AP_A440-log.eps
close;

disp(' ');
disp('++++++++++++++++++++++++++++++++++ Spectrum of AP-A440-2k.wav');
wavresample( 'AP_A440.wav', 22, 'AP_A440-2k.wav');
upsample( 'AP_A440-2k.wav', 22, 'AP_A440-2k-up.wav');

wavspectrum( 'AP_A440-2k.wav', 1, 0.5, 0);
print -djpeg99 -r50 AP_A440-2k.jpg
print -depsc2 AP_A440-2k.eps
close;
wavspectrum( 'AP_A440-2k.wav', 1, 0.5, 0, 1);
print -djpeg99 -r50 AP_A440-2k-log.jpg
print -depsc2 AP_A440-2k-log.eps
close;

disp(' ');
disp('++++++++++++++++++++++++++++++++++ Spectrum of AP-A440-2kg.wav');
wavresamplegood( 'AP_A440.wav', 22, 'AP_A440-2kg.wav');
upsample( 'AP_A440-2kg.wav', 22, 'AP_A440-2kg-up.wav');

wavspectrum( 'AP_A440-2kg.wav', 1, 0.5, 0);
print -djpeg99 -r50 AP_A440-2kg.jpg
print -depsc2 AP_A440-2kg.eps
close;
wavspectrum( 'AP_A440-2kg.wav', 1, 0.5, 0, 1);
print -djpeg99 -r50 AP_A440-2kg-log.jpg
print -depsc2 AP_A440-2kg-log.eps
close;

disp(' ');
disp('++++++++++++++++++++++++++++++++++ Spectrum of mars-kms-sm.wav');
wavspectrum( 'mars-kms-sm.wav', 1, 0.5, 11);
print -djpeg99 -r50 mars-kms-sm.jpg
print -depsc2 mars-kms-sm.eps
close;
wavspectrum( 'mars-kms-sm.wav', 1, 0.5, 11, 1);
print -djpeg99 -r50 mars-kms-sm-log.jpg
print -depsc2 mars-kms-sm-log.eps
close;

disp(' ');
disp('++++++++++++++++++++++++++++++++++ Spectrum of mars-kms-sm-4k.wav ');
wavresample( 'mars-kms-sm.wav', 11, 'mars-kms-sm-4k.wav');
upsample( 'mars-kms-sm-4k.wav', 11, 'mars-kms-sm-4k-up.wav');

wavspectrum( 'mars-kms-sm-4k.wav', 1, 0.5, 0);
print -djpeg99 -r50 mars-kms-sm-4k.jpg
print -depsc2 mars-kms-sm-4k.eps
close;
wavspectrum( 'mars-kms-sm-4k.wav', 1, 0.5, 0, 1);
print -djpeg99 -r50 mars-kms-sm-4k-log.jpg
print -depsc2 mars-kms-sm-4k-log.eps
close;

disp(' ');
disp('++++++++++++++++++++++++++++++++++ Spectrum of mars-kms-sm-4kg.wav ');
wavresamplegood( 'mars-kms-sm.wav', 11, 'mars-kms-sm-4kg.wav');
upsample( 'mars-kms-sm-4kg.wav', 11, 'mars-kms-sm-4kg-up.wav');

wavspectrum( 'mars-kms-sm-4kg.wav', 1, 0.5, 0);
print -djpeg99 -r50 mars-kms-sm-4kg.jpg
print -depsc2 mars-kms-sm-4kg.eps
close;
wavspectrum( 'mars-kms-sm-4kg.wav', 1, 0.5, 0, 1);
print -depsc2 mars-kms-sm-4kg-log.eps
close;


