
clear

load spectrum_regional_u.mat  
load spectrum_regional_v.mat % (31) 145m   (43) 286m  (53)  485m  


t = [10:10:1090];
u1 = tu1(53,:)     
v1 = tv1(53,:)
%nn = find(~isnan(v));
%t = t(nn);
%v = v(nn);

t = t - t(1);

[f1,S11] = spec1D(t,u1,true,false);
[f1,S12] = spec1D(t,v1,true,false);

S11 = S11(f1>0);
S12 = S12(f1>0)
f1 = f1(f1>0);

S1 = S11 + S12

subplot(3,1,1)
plot(t,u1);
grid on
xlabel('Time, (days)');
ylabel('Velocity u, (m/s)')



subplot(3,1,2)
plot(t,v1);
grid on
xlabel('Time, (days)');
ylabel('Velocity v, (m/s)')

subplot(3,1,3)
semilogx(f1,S1);
grid on
xlabel('Frequency, (rad/day)');
ylabel('Frequency spectrum')


set(gcf,'PaperPositionMode','auto');
print -dpng -r300 ~/spectrum_regional_total1.png

clear


load spectrum_regional_u.mat  
load spectrum_regional_v.mat

t = [10:10:1090];
u1 = tu2(53,:)     
v1 = tv2(53,:)
%nn = find(~isnan(v));
%t = t(nn);
%v = v(nn);

t = t - t(1);

[f1,S11] = spec1D(t,u1,true,false);
[f1,S12] = spec1D(t,v1,true,false);

S11 = S11(f1>0);
S12 = S12(f1>0)
f1 = f1(f1>0);

S1 = S11 + S12

subplot(3,1,1)
plot(t,u1);
grid on
xlabel('Time, (days)');
ylabel('Velocity u, (m/s)')



subplot(3,1,2)
plot(t,v1);
grid on
xlabel('Time, (days)');
ylabel('Velocity v, (m/s)')
 

subplot(3,1,3)
semilogx(f1,S1);
grid on
xlabel('Frequency, (rad/day)');
ylabel('Frequency spectrum')


set(gcf,'PaperPositionMode','auto');
print -dpng -r300 ~/spectrum_regional_total2.png


clear

load spectrum_regional_u.mat  
load spectrum_regional_v.mat

t = [10:10:1090];
u1 = tu3(53,:)     
v1 = tv3(53,:)
%nn = find(~isnan(v));
%t = t(nn);
%v = v(nn);

t = t - t(1);

[f1,S11] = spec1D(t,u1,true,false);
[f1,S12] = spec1D(t,v1,true,false);

S11 = S11(f1>0);
S12 = S12(f1>0)
f1 = f1(f1>0);

S1 = S11 + S12

subplot(3,1,1)
plot(t,u1);
grid on
xlabel('Time, (days)');
ylabel('Velocity u, (m/s)')



subplot(3,1,2)
plot(t,v1);
grid on
xlabel('Time, (days)');
ylabel('Velocity v, (m/s)') 

subplot(3,1,3)
semilogx(f1,S1);
grid on
xlabel('Frequency, (rad/day)');
ylabel('Frequency spectrum')


set(gcf,'PaperPositionMode','auto');
print -dpng -r300 ~/spectrum_regional_total3.png


%clear

%load spectrum_regional_u.mat  
%load spectrum_regional_v.mat

%t = [10:10:1090];
%u1 = tu4(43,:)     
%v1 = tv4(43,:)

%nn = find(~isnan(v));
%t = t(nn);
%v = v(nn);

%t = t - t(1);

%[f1,S11] = spec1D(t,u1,true,false);
%[f1,S12] = spec1D(t,v1,true,false);

%S11 = S11(f1>0);
%S12 = S12(f1>0)
%f1 = f1(f1>0);

%S1 = S11 + S12

%subplot(3,1,1)
%plot(t,u1);
%grid on
%xlabel('Time, (days)');
%ylabel('Velocity u, (m/s)')


%subplot(3,1,2)
%plot(t,v1);
%grid on
%xlabel('Time, (days)');
%ylabel('Velocity v, (m/s)')


%subplot(3,1,3)
%semilogx(f1,S1);
%grid on
%xlabel('Frequency, (rad/day)');
%ylabel('Frequency spectrum')

%set(gcf,'PaperPositionMode','auto');
%print -dpng -r300 ~/spectrum_regional_total4.png
