function smoothed_trace=movingwindowsmooth(raw_trace,smoothing_binwidth)

if size(raw_trace,1)>size(raw_trace,2),raw_trace=raw_trace';end
holder=[];
for i=1:smoothing_binwidth
    holder=[holder;raw_trace(i:end-(smoothing_binwidth-i))];
end
smoothed_trace=mean(holder);    