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