annotate 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
rev   line source
wolffd@0 1 function [h,out] = datawavstem(wavin, varargin)
wolffd@0 2 %[h,out] = datawavplot(data)
wolffd@0 3
wolffd@0 4
wolffd@0 5 [sr,miny,maxy,minx,maxx,unused]=process_options(varargin,...
wolffd@0 6 'sr',44800,'miny',-1,'maxy',-1,'minx',-1,'maxx',-1);
wolffd@0 7 out= wavin;
wolffd@0 8
wolffd@0 9 m=min(wavin);
wolffd@0 10 ma=max(wavin);
wolffd@0 11 add=(ma-m)*0.1;
wolffd@0 12 if miny ==-1
wolffd@0 13 miny=m-add;
wolffd@0 14 end
wolffd@0 15 if maxy==-1
wolffd@0 16 maxy=ma+add;
wolffd@0 17 end
wolffd@0 18 wavlens=round(length(wavin)/sr*100)/100;
wolffd@0 19 timetbl=([0:length(wavin)-1]./length(wavin))*wavlens;
wolffd@0 20 h=stem(timetbl,out,'r');
wolffd@0 21
wolffd@0 22 if minx ==-1
wolffd@0 23 minx=0;
wolffd@0 24 end
wolffd@0 25 if maxx==-1
wolffd@0 26 maxx=wavlens;
wolffd@0 27 end
wolffd@0 28 axis([minx maxx miny maxy]);
wolffd@0 29 set(gca,'FontSize',8);
wolffd@0 30 h=get(0,'CurrentFigure');
wolffd@0 31 axis xy;
wolffd@0 32 xlabel('Time[s]','FontSize',8)
wolffd@0 33 ylabel('Amplitude','FontSize',8)