annotate 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
rev   line source
wolffd@0 1 function out=filespecgram(working_file, varargin)
wolffd@0 2
wolffd@0 3 [starts,stops, unused]=process_options(varargin,'starts',0,'stops',-1);
wolffd@0 4
wolffd@0 5
wolffd@0 6 filesize=wavread(working_file,'size');
wolffd@0 7 audiodatalen=filesize(1);
wolffd@0 8 num_channels=filesize(2);
wolffd@0 9 [src,sr,bits] = wavread(working_file,[1 2]);
wolffd@0 10
wolffd@0 11
wolffd@0 12 startspl=max(1,starts*sr);
wolffd@0 13 if stops =-1,
wolffd@0 14 stopspl=audiodatalen;
wolffd@0 15 else
wolffd@0 16 stopspl=max(1,starts*sr);
wolffd@0 17 end
wolffd@0 18
wolffd@0 19 sgram=dataspecgram(src(startspl:stopspl,1),'sr',sr);