Mercurial > hg > lots
changeset 17:0da5eb32e49d tip
minor changes
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Thu, 10 Nov 2011 15:53:06 +0000 |
parents | ce97f3e920ef |
children | |
files | .hgignore lotplot.m |
diffstat | 2 files changed, 11 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Wed Jul 27 14:57:53 2011 +0100 +++ b/.hgignore Thu Nov 10 15:53:06 2011 +0000 @@ -5,3 +5,4 @@ lotbasis\.m~ dcti\.m~ tests/testLot\.m~ +export
--- a/lotplot.m Wed Jul 27 14:57:53 2011 +0100 +++ b/lotplot.m Thu Nov 10 15:53:06 2011 +0000 @@ -31,22 +31,23 @@ maxLength = max(wLength); sigLength = sum(wLength); -timeVec = linspace(0,sigLength/Fs,10*ceil(sigLength/min(wLength))); +timeVec = linspace(0,sigLength/Fs,nWindows); -S = zeros(maxLength,length(timeVec)); +S = zeros(maxLength,nWindows); timeSupp = @(p) floor(wLength(p)*length(timeVec)/sigLength); interpFun = @(p,v) interp1(1:wLength(p),abs(v),linspace(1,wLength(p),maxLength))'; -S(:,1:timeSupp(1)) = repmat(interpFun(1,y(1:wLength(1))),1,timeSupp(1)); +S(:,1) = repmat(interpFun(1,y(1:wLength(1))),1,1); for i=2:nWindows - S(:,sum(timeSupp(1:i-1))+(1:timeSupp(i))) = ... - repmat(interpFun(i,y(sum(wLength(1:i-1))+(1:wLength(i)))),1,timeSupp(i)); + S(:,i) = ... + mag2db(repmat(interpFun(i,y(sum(wLength(1:i-1))+(1:wLength(i)))),1,1)); end -SmagdB = mag2db(S); -if nargout, varargout{1} = SmagdB; end +if nargout, varargout{1} = S; end -surf(timeVec,1:maxLength,SmagdB,'EdgeColor','none'); +surf(timeVec,(1:maxLength)/maxLength*Fs/2,S,'EdgeColor','none'); axis xy; axis tight; colormap(jet); view(0,90); -set(gca,'YScale','log'); \ No newline at end of file +set(gca,'YScale','log'); +xlabel('time (sec)'); +ylabel('frequency (Hz)'); \ No newline at end of file