% lab6plt.m   plots Spectral Density, Coherence, and Phase plots

figure(1)
clf

%vcoher=[xmin xmax ymin ymax];   % This is for the Coherence and Phase axes.
%vphase=[xmin xmax ymin ymax];   % Uncomment and fill in the appropriate values.

orient tall

axes('position',[0.3 0.55 0.6 0.300])

semilogy(fr,Gxmean1,fr,Gxmean2,'g--')   % plot your log spectral densities for 
ylabel('G(f) (units???)')                % y1 and y2, fr is your frequency vector
xlabel(' ')                           % starting at fr=1*df (not fr=0)
title('Lab 6 Results for c22x and w29')  % Fill in your plot title
set(gca,'XTickLabel',[])
set(gca,'box',['off'])

axes('position',[0.3 0.325 0.6 0.200])
plot(fr,Coher)                
axis(vcoher);
ylabel('Coherence (units???)')
xlabel(' ')
set(gca,'XTickLabel',[])
set(gca,'box',['off'])
set(gca,'ytick',[0,1])
set(gca,'YTickLabel',['   0';'   1'])
% Add a line for significance level (you need to assign this value)
hold on; plot(fr,siglevel,'--');


axes('position',[0.3 0.10 0.6 0.200])
plot(fr,phase)                     
axis(vphase)
set(gca,'box',['off'])
ylabel('Phase (units???)')
xlabel('frequency (units???)')
set(gca,'ytick',[-180,0,180])
set(gca,'YTickLabel',['-180';'   0';' 180'])

