#! /usr/bin/octave -qf % Emacs mode header: -*-Octave-*- source. %

%subplot(2,2,1) %A

% subplot(2,2,2) %B
hold on; grid on;
% subplot(2,2,3) %C
load ("-ascii", "../data/asymp1.txt", "v1","v2")
%% fXC = 0:0.05:5; 
fXC = 0:0.33:5; 
fXC2LO = 0:0.33:1.66; fXC2HI = 1.66:0.33:5;
fXCELO = 0.01:0.05:1.66; fXCEHI = 1.66:0.05:5;

fYCELO = exp(1.9*(fXCELO-1.25)) - 0.2; % EXP
fYCEHI = exp(1.9*(fXCEHI-1.25)) - 0.2;

fYC2LO = 2.5.*(fXC2LO-1).^2 + 1; % ^2
fYC2HI = 2.5.*(fXC2HI-1).^2 + 1; % ^2

fXC3 = 0:0.1:4.95;
semilogy(fXCELO, fYCELO,   'b', fXCEHI, fYCEHI, 'r-^');%EXP
semilogy(fXC2LO, fYC2LO, 'r-o', fXC2HI, fYC2HI,  'b-s'); % ^2
semilogy(fXC3,asymp1(:,2),'k');
% grid on
xlabel('Spike timing jitter in ms',"fontsize",14);
ylabel('{JND of ITD in {\mu}s}',"fontsize",14);
axis([0 5 0.01 1000])
%axis([10^1 2*10^5 0 0.1])

print('-deps2', 'FM3V1.eps')
unix('eps2pdfpm FM3V1')