

clear all
clc
%% mir toolbox

fm = mirspectrum('fm.wav', 'Min', 20, 'Max', 22050, 'Length', 4096, ...
    'Normal', 'Window', 'Hanning', 'Phase', 0, 'db', 'Gauss', 5, 'Power', 0);
fs = mirspectrum('fs.wav', 'Min', 20, 'Max', 22050, 'Length', 4096,...
    'Normal', 'Window', 'Hanning', 'Phase', 0, 'db', 'Gauss', 5, 'Power', 0);

fm = mirgetdata(fm);
fs = mirgetdata(fs);

xstr = 6.08 %8192 smpls
%xstr = 10.836601307189542483660130718954; %4096 smpls
%% plot data
subplot(2,1,1)
plot(fm, 'r')
hold on
plot(fs)
grid on
set(gca, 'Xscale', 'log');
set(gca,'XTick',[ 20/xstr; 50/xstr; 100/xstr;  500/xstr; 1000/xstr; 2000/xstr; 5000/xstr; 10000/xstr; 20000/xstr]);
set(gca,'XTickLabel',[ 20; 50; 100; 500; 1000; 2000; 5000; 10000; 20000 ]);
title({'Test Song', 'Mono = Rot, Stereo = Blau'})
xlabel('Frequenz in Hz')
ylabel('Amplitude in dB')

% plot differenz
subplot(2,1,2)
plot((fm-fs))
grid on
title('Differenz (Mono - Stereo)')
xlabel('Frequenz in Hz')
ylabel('Amplitude in dB')
set(gca, 'Xscale', 'log');
set(gca,'XTick',[ 20/xstr; 50/xstr; 100/xstr;  500/xstr; 1000/xstr; 2000/xstr; 5000/xstr; 10000/xstr; 20000/xstr]);
set(gca,'XTickLabel',[ 20; 50; 100; 500; 1000; 2000; 5000; 10000; 20000 ]);



