function freqhist(bb,nf) zz=size(bb); sr=750000/76; freq=(nf-1)*sr/2/(zz(2)-1); nframes=zz(1)*(zz(2)-1)/25000; % % plot absolute value histogram % subplot(3,1,1) hist(log10(abs(bb(:,nf))),50) xlabel('log_{10} (absolute value fft)') ylabel('number of samples') title(['Histograms at ',sprintf('%8.2f',freq),' Hz from ',num2str(nframes),' frames']) % % real part of fft % [nn xx]=hist(real(bb(:,nf)),50); mur=mean(real(bb(:,nf))); sdr=std(real(bb(:,nf))); ny=gausshist(mur,sdr,zz(1),xx); subplot(3,1,2) %doublehist(xx,nn,ny) hist(real(bb(:,nf)),50) xlabel('real part fft') ylabel('number of samples') % x1=(3*xx(1)-xx(2))/2; x2=.9*max([nn,ny]); x3=(8*xx(end)+xx(1))/9; x4=.8*max([nn,ny]); text(x1,x2,'red = data') text(x1,x4,'blue = Gaussian fit') text(x3,x2,['\mu = ',sprintf('%6.2f',mur)]) text(x3,x4,['\sigma = ',sprintf('%6.2f',sdr)]) % % imaginary part of fft % [nn xx]=hist(imag(bb(:,nf)),50); mui=mean(imag(bb(:,nf))); sdi=std(imag(bb(:,nf))); ny=gausshist(mui,sdi,zz(1),xx); subplot(3,1,3) doublehist(xx,nn,ny) %hist(imag(bb(:,nf)),10) xlabel('imaginary part fft') ylabel('number of samples') x1=(3*xx(1)-xx(2))/2; x2=.9*max([nn,ny]); x3=(8*xx(end)+xx(1))/9; x4=.8*max([nn,ny]); text(x1,x2,'red = data') text(x1,x4,'blue = Gaussian fit') text(x3,x2,['\mu = ',sprintf('%6.2f',mui)]) text(x3,x4,['\sigma = ',sprintf('%6.2f',sdi)])