comparison toolboxes/MIRtoolbox1.3.2/AuditoryToolbox/CorrelogramArray.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 movie = CorrelogramArray(data, sr, frameRate, width)
2 % function movie = CorrelogramArray(data, sr, frameRate, width)
3 % Compute an array of correlogram frames, from the sound file data with
4 % a sampling rate of sr Hz. Compute frameRate frames per second, using
5 % a window size of "width" samples.
6
7 % (c) 1998 Interval Research Corporation
8
9 if nargin < 2, sr = 16000; end
10 if nargin < 3, frameRate = 12; end
11 if nargin < 4, width = 256; end
12
13 [channels, len] = size(data);
14 frameIncrement = fix(sr/frameRate);
15 frameCount = floor((len-width)/frameIncrement)+1;
16 fprintf('Correlogram spacing is %g samples per frame.\n', frameIncrement);
17
18 movie = zeros(channels*width, frameCount);
19 for i=1:frameCount
20 start = (i-1)*frameIncrement + 1;
21 pic = CorrelogramFrame(data, width, start, frameIncrement*4);
22 minimum = min(min(pic));
23 maximum = max(max(pic));
24 image((pic-minimum)/(maximum-minimum)*length(colormap));
25 drawnow;
26 movie(:,i) = reshape(pic, channels*width, 1);
27 end