function noise_autocorrelation_structure(input_matrix)

chan1_trace=input_matrix(:,1:2:end);
chan2_trace=input_matrix(:,2:2:end);

num_sweeps=size(chan1_trace,2);
corr_plot_length=10000;%length(chan1_detrend);

for sweep=1:num_sweeps
    subplot(num_sweeps,4,((sweep-1)*4)+1)
    plot(chan1_trace(:,sweep),'k'), axis off
	chan1_corr=xcorr(chan1_trace(:,sweep));
	[y2,chan1corrmaxind]=max(chan1_corr);
	chan1_detrend=detrend(chan1_corr((chan1corrmaxind+1):end));
    subplot(num_sweeps,4,((sweep-1)*4)+2)
	plot([.0001:.0001:corr_plot_length*.0001],chan1_detrend(1:corr_plot_length),'r'), axis off
    
    subplot(num_sweeps,4,((sweep-1)*4)+3)
    plot(chan2_trace(:,sweep),'k'), axis off
    chan2_corr=xcorr(chan2_trace(:,sweep));
	[y2,chan2corrmaxind]=max(chan2_corr);
	chan2_detrend=detrend(chan2_corr((chan2corrmaxind+1):end));
    subplot(num_sweeps,4,((sweep-1)*4)+4)
	plot([.0001:.0001:corr_plot_length*.0001],chan2_detrend(1:corr_plot_length),'r'), axis off
end