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

hold on; grid on;
% subplot(2,2,3) %C
fX4 = -1:0.05:2;
MaxRat = 200; ITD = 0.3;
fY4GAUSS = MaxRat* exp(-4*(fX4 - ITD).*(fX4 - ITD));
fYSIN = MaxRat*(0.5 + 0.5 * cos(0.5*2*pi*(fX4 - ITD)));
fYDIFF = (-1)*(fY4GAUSS - fYSIN);

% load ("-ascii", "../data/fs1_detail_human.txt", "x1","y1")
load ("-ascii", "../data/fs1_detail_human.txt")
% plot(fs1_detail_human(:,1), fs1_detail_human(:,2));
% fYC2 = 2.5.*(fXC-1).^2 + 1;
% hold on
plot(fX4, fY4GAUSS, 'b', fX4, fYSIN, 'r', fX4, fYDIFF, 'g');
 %plot(fs1_detail_human(:,1)*1000, fs1_detail_human(:,2)/6500);
 plot(fs1_detail_human(:,1)*1000, (fs1_detail_human(:,2)-1150000)/1000+30,'k');
grid on %grid minor
xlabel('ITD [ms]');
ylabel('Firing rate [AP/ s]');
axis([-0.5 1.7 -25 225])

% axis([10^1 2*10^5 0 0.1])
print('-depsc2', 'FM4V1.eps')
unix('eps2pdfpm FM4V1')