Mercurial > hg > camir-aes2014
diff toolboxes/bioakustik_tools/visualisation/filespecgram.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/filespecgram.m Tue Feb 10 15:05:51 2015 +0000 @@ -0,0 +1,19 @@ +function out=filespecgram(working_file, varargin) + +[starts,stops, unused]=process_options(varargin,'starts',0,'stops',-1); + + +filesize=wavread(working_file,'size'); +audiodatalen=filesize(1); +num_channels=filesize(2); +[src,sr,bits] = wavread(working_file,[1 2]); + + +startspl=max(1,starts*sr); +if stops =-1, + stopspl=audiodatalen; +else + stopspl=max(1,starts*sr); +end + +sgram=dataspecgram(src(startspl:stopspl,1),'sr',sr); \ No newline at end of file