clear;

load data/spectrum_d_n.mat;

k1=subplot(2,3,1);
h=loglog(f,m_PDS2_w_n/m_std_w_n^2,'b');set(h,'linewidth',0.5);
hold on;
h=loglog(f,m_PDS2_w_d/m_std_w_d^2,'r');set(h,'linewidth',0.5);
x=[0.01 10.0];
y=[100.0 0.001];
loglog(x,y,'g--');
xlabel('Frequency (1/s)');
ylabel('$S(f)/\sigma_w^{2}(s^{-1})$','interpreter','latex');
axis([0.0005,30,0.0001,1000]);
set(gca,'xtick',[1e-3 1e-2 1e-1 1 1e1],'ytick',[1e-5 1e-4 1e-3 1e-2 1e-1 1 1e1 1e2]);
grid on;
h=title('w spectra');set(h,'fontweight','normal');
h=legend('Night','Day','-5/3');
set(h,'box','off');
hold off;

k2=subplot(2,3,2);
h=loglog(f,m_PDS2_v_n/m_std_v_n^2,'b');set(h,'linewidth',0.5);
hold on;
h=loglog(f,m_PDS2_v_d/m_std_v_d^2,'r');set(h,'linewidth',0.5);
x=[0.01 10.0];
y=[100.0 0.001];
loglog(x,y,'g--');
xlabel('Frequency (1/s)');
ylabel('$S(f)/\sigma_v^{2}(s^{-1})$','interpreter','latex');
set(gca,'xtick',[1e-3 1e-2 1e-1 1 1e1],'ytick',[1e-5 1e-4 1e-3 1e-2 1e-1 1 1e1 1e2]);
h=title('v spectra');set(h,'fontweight','normal');
axis([0.0005,30,0.0001,1000]);
grid on;
hold off;

k3=subplot(2,3,3);
h=loglog(f,m_PDS2_u_n/m_std_u_n^2,'b');set(h,'linewidth',0.5);
hold on;
h=loglog(f,m_PDS2_u_d/m_std_u_d^2,'r');set(h,'linewidth',0.5);
x=[0.01 10.0];
y=[100.0 0.001];
loglog(x,y,'g--');
set(gca,'xtick',[1e-3 1e-2 1e-1 1 1e1],'ytick',[1e-5 1e-4 1e-3 1e-2 1e-1 1 1e1 1e2]);
axis([0.0005,30,0.0001,1000]);
h=title('u spectra');set(h,'fontweight','normal');
xlabel('Frequency (1/s)');
ylabel('$S(f)/\sigma_u^{2}(s^{-1})$','interpreter','latex');
grid on;
hold off;

set(k1,'position',[0.077 0.3 0.25 0.40]);
set(k2,'position',[0.407 0.3 0.25 0.40]);
set(k3,'position',[0.737 0.3 0.25 0.40]);

print -dpng spectrum_d_n_plot



