Mercurial > hg > camir-aes2014
diff toolboxes/bioakustik_tools/visualisation/datawavstem.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toolboxes/bioakustik_tools/visualisation/datawavstem.m Tue Feb 10 15:05:51 2015 +0000 @@ -0,0 +1,33 @@ +function [h,out] = datawavstem(wavin, varargin) +%[h,out] = datawavplot(data) + + +[sr,miny,maxy,minx,maxx,unused]=process_options(varargin,... + 'sr',44800,'miny',-1,'maxy',-1,'minx',-1,'maxx',-1); +out= wavin; + +m=min(wavin); +ma=max(wavin); +add=(ma-m)*0.1; +if miny ==-1 + miny=m-add; +end +if maxy==-1 + maxy=ma+add; +end +wavlens=round(length(wavin)/sr*100)/100; +timetbl=([0:length(wavin)-1]./length(wavin))*wavlens; +h=stem(timetbl,out,'r'); + +if minx ==-1 + minx=0; +end +if maxx==-1 + maxx=wavlens; +end +axis([minx maxx miny maxy]); +set(gca,'FontSize',8); +h=get(0,'CurrentFigure'); +axis xy; +xlabel('Time[s]','FontSize',8) +ylabel('Amplitude','FontSize',8) \ No newline at end of file