function [ output_args ] = plot_psd_5sec( out1,out2, freq)
    signal = [1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1];%condition 1
    signal = [0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0];%condition 2
    background = [];
    target = 5;
    figure('name','CCA');
    temp = squeeze(mean(out1,3));
    temp = temp(:,any(temp));
    out(:,1) = mean(temp,2);
    plot(freq,out(:,1),'r','Linewidth',1);hold on;
    qq = mean(out,2);
%     plot(xlim,[qq(target) qq(target)],'--r');
    %     plot([8:0.2:8.8 9.2:0.2:11.8],qq([1:2:9 13:2:39]),'ok','markers',12);
    plot([8 8.4 9.2 9.6 10 10.6 11 11.4 11.8],qq([1 3 7 9 11 14 16 18 20]),'ok','markers',12);
%     xlim([8 11.8]);
%     set(gca,'XTick',[8:0.2:11.8]);
%     set(gca,'XTickLabelRotation',45);
%     box off;
%     ylabel('uV');
%     xlabel('Frequency');
%     set(gca,'fontsize',20)
    
    
%     figure('name','CCA');
    temp = squeeze(mean(out2,3));
    temp = temp(:,any(temp));
    out(:,1) = mean(temp,2);
    plot(freq,out(:,1),'k','Linewidth',1);hold on;
    qq = mean(out,2);
%     plot(xlim,[qq(target) qq(target)],'--k');
    %     plot([8:0.2:8.8 9.2:0.2:11.8],qq([1:2:9 13:2:39]),'ok','markers',12);
    plot([8.2 8.6 9 9.4 9.8 10.2 10.4 10.8 11.2 11.6],qq([2 4 6 8 10 12 13 15 17 19]),'ok','markers',12);
    xlim([8 11.8]);
    set(gca,'XTick',[8:0.2:11.8]);
    set(gca,'XTickLabelRotation',45);
    box off;
    ylabel('uV');
    xlabel('Frequency');
    set(gca,'fontsize',20)
    legend('A-pattern','B-Pattern');
    hold off;
    
%     figure('name','FFT');
%     temp2 = squeeze(mean(out2,3));
%     temp2 = temp2(:,any(temp2));
%     out(:,1) = mean(temp2,2);
%     plot(freq,out(:,1),'r','Linewidth',1);hold on;
%     qq2 = mean(out,2);
%     plot(xlim,[qq2(target) qq2(target)],'--r');
%     %     plot([8:0.2:8.8 9.2:0.2:11.8],qq2([1:2:9 13:2:39]),'ok','markers',12);
%      plot([8 8.4 9.2 9.6 10 10.6 11 11.4 11.8],qq([1 3 7 9 11 14 16 18 20]),'ok','markers',12);
%     plot(8.8,qq2(target),'*k','markers',12);
%     xlim([8 11.8]);
%     set(gca,'XTick',[8:0.2:11.8]);
%     set(gca,'XTickLabelRotation',45);
%     box off;
%     ylabel('uV');
%     xlabel('Frequency');
%     set(gca,'fontsize',20)
%     hold off;


end

