Mercurial > hg > ishara
view graphics/tfdimage.m @ 53:3ba80c9914ff
Minor doc fix, added .class to .hgignore
author | samer |
---|---|
date | Mon, 02 Feb 2015 10:47:55 +0000 |
parents | 82075c94eed1 |
children |
line wrap: on
line source
function tfdimage(TFD,N,m,fs,range,varargin) % TFDIMAGE: image of time frequency distribution with correct axes % % tfdimage(TFD,N,M,fs[,range]) % % TFD: image matrix % fs: sampling rate in Hz % N: frame size (used to determine frequency scale) % m: hop size (used to derermine time scale) % range: if present, determines manual colour scaler. range(1)=dBs of dynamic range, % and range(2) is max value. % if range=[], uses default manual offset (13.5). if nargin<4, fs=1; end opts=options('offset',0,varargin{:}); [T,F]=tfscale(fs,N,m,size(TFD)); if fs>1000, imagesc(T+opts.offset,F/1000,10*log10(TFD)); else imagesc(T+opts.offset,F,10*log10(TFD)); end if nargin>=5 if isempty(range), range=13.5; end dBs=range(1); cax=caxis; cax(1)=cax(2)-dBs; if length(range)>1, cax=cax+range(2)-cax(2); end caxis(cax); end axis xy xlabel('time/s'); if fs>1000, ylabel('frequency/kHz'); else ylabel('frequency/Hz'); end