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