bakgrund0=[2,4,4,1,4,23,11,9,9,3,1,3,2,3,7,5,1,3,4,3,3,4,4,2,5,1,9,4,4,4,4,6,2,3,2,3,4,2,4,2,3,1,3,5,1,3,3,3,2,3,3,0,4,3,5,4,5,0,3,3,1,4,6,3,2,3,5,3,3,2,4,5,3]
bakgrund1=[2,3,3,2,4,6,3,1,3,5,4,4,4,5,1,3,4,8,4,2,4,3,5,2,2,5,2,5,4,2,1,3,1,4,12,4,4,3,3,2,9,3,4,6,3,6,4,2,6,2,4,2,6,4,3,3,2,4,4,3,5,3,5,3,6,6,3,3,4,4,3,3]
bakgrund2=[3,5,4,5,0,2,4,3,1,6,5,2,3,2,2,5,6,2,3,3,3,5,0,4,4,2,6,2,2,5,7,7,5,3,1,5,4,1,3,4,2,7,3,3,1,5,2,2,4,4,2,4,5,4,2,2,4,6,6,7,3,3,3,2,2,2,8,2,4,4,2,4]
bakgrund3=[2,2,4,6,3,3,3,3,3,2,5,3,0,6,2,4,1,3,3,2,4,5,2,2,4,3,1,2,3,4,5,3,3,5,2,7,2,7,3,5,4,4,5,5,3,7,4,3,2,5,5,2,4,1,3,4,6,3,2,4,3,5,4,5,5,1,6,3,5,2,5,2]
bakgrund4=[4,6,3,2,3,2,5,3,4,3,3,0,4,2,4,3,6,3,2,4,3,3,3,1,1,5,2,9,3,3,2,3,4,3,2,1,8,2,2,1,2,1,4,3,1,2,1,4,2,2,3,3,5,3,0,3,5,2,6,4,2,3,3,2,5,4,2,3,5,2,3,4,2,2,5,1,2,3]

function BackgroundHist(backgrounddata)
   minfreq=min(backgrounddata);
   maxfreq=max(backgrounddata);
   avgfreq=mean(backgrounddata);
   stdfreq=std(backgrounddata);
   typfreq=mode(backgrounddata);
   thishist=hist(backgrounddata, maxfreq-minfreq);
   thisbar=bar(thishist);
   title( sprintf('typ:%1.1f, avg:%1.1f, stdev:%1.1f \n', [typfreq,avgfreq, stdfreq]));
endfunction

clf()
refresh()
drawnow()
subplot(2,3,1)
BackgroundHist(bakgrund0)
subplot(2,3,2)
BackgroundHist(bakgrund1)
subplot(2,3,3)
BackgroundHist(bakgrund2)
subplot(2,3,4)
BackgroundHist(bakgrund3)
subplot(2,3,5)
BackgroundHist(bakgrund4)
refresh()

