load('SCRN0003.TXT');
load('SCRN0004.TXT');
load('SCRN0005.TXT');
load('SCRN0006.TXT');
load('SCRN0007.TXT');
load('SCRN0008.TXT');
load('SCRN0009.TXT');
load('SCRN0010.TXT');
load('SCRN0011.TXT');
load('SCRN0012.TXT');

Comm_Path_NoiseSpec_Gain15(:,1) = vertcat(SCRN0010(:,1),SCRN0003(13:400,1));
Comm_Path_NoiseSpec_Gain15(:,2) = vertcat(SCRN0010(:,2),SCRN0003(13:400,2));

Comm_Path_NoiseSpec_Gain12(:,1) = vertcat(SCRN0011(:,1),SCRN0004(13:400,1));
Comm_Path_NoiseSpec_Gain12(:,2) = vertcat(SCRN0011(:,2),SCRN0004(13:400,2));

Comm_Path_NoiseSpec_Gain9(:,1) = vertcat(SCRN0012(:,1),SCRN0005(13:400,1));
Comm_Path_NoiseSpec_Gain9(:,2) = vertcat(SCRN0012(:,2),SCRN0005(13:400,2));

Comm_Path_NoiseSpec_Gain18(:,1) = vertcat(SCRN0009(:,1),SCRN0006(13:400,1));
Comm_Path_NoiseSpec_Gain18(:,2) = vertcat(SCRN0009(:,2),SCRN0006(13:400,2));

Comm_Path_NoiseSpec_Gain21(:,1) = vertcat(SCRN0008(:,1),SCRN0007(13:400,1));
Comm_Path_NoiseSpec_Gain21(:,2) = vertcat(SCRN0008(:,2),SCRN0007(13:400,2));

save('/Users/alexastaley/Documents/MATLAB/COMM PLL/Comm_Path_NoiseSpec_Gain15.txt','Comm_Path_NoiseSpec_Gain15','-ascii')
save('/Users/alexastaley/Documents/MATLAB/COMM PLL/Comm_Path_NoiseSpec_Gain12.txt','Comm_Path_NoiseSpec_Gain12','-ascii')
save('/Users/alexastaley/Documents/MATLAB/COMM PLL/Comm_Path_NoiseSpec_Gain9.txt','Comm_Path_NoiseSpec_Gain9','-ascii')
save('/Users/alexastaley/Documents/MATLAB/COMM PLL/Comm_Path_NoiseSpec_Gain18.txt','Comm_Path_NoiseSpec_Gain18','-ascii')
save('/Users/alexastaley/Documents/MATLAB/COMM PLL/Comm_Path_NoiseSpec_Gain21.txt','Comm_Path_NoiseSpec_Gain21','-ascii')


figure(1)
clf;
loglog(Comm_Path_NoiseSpec_Gain9(:,1),Comm_Path_NoiseSpec_Gain9(:,2),Comm_Path_NoiseSpec_Gain12(:,1),Comm_Path_NoiseSpec_Gain12(:,2),...
    Comm_Path_NoiseSpec_Gain15(:,1),Comm_Path_NoiseSpec_Gain15(:,2), Comm_Path_NoiseSpec_Gain18(:,1),Comm_Path_NoiseSpec_Gain18(:,2),...
    Comm_Path_NoiseSpec_Gain21(:,1),Comm_Path_NoiseSpec_Gain21(:,2));
grid on;
xlabel('Frequency [Hz]');
ylabel('Amplitude Spectrum [Vrms/SqrtHz]');
xlim([10 10^5])
legend('Gain 9dB', 'Gain 12dB', 'Gain 15dB', 'Gain 18dB','Gain 21dB');
title(' Noise Spectrum of Comm Path');
set(gcf, 'Color', 'w');

saveas(gcf, '/Users/alexastaley/Documents/MATLAB/COMM PLL/Comm_Path_NoiseSpec.pdf');