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