wolffd@0: function movie = CorrelogramArray(data, sr, frameRate, width) wolffd@0: % function movie = CorrelogramArray(data, sr, frameRate, width) wolffd@0: % Compute an array of correlogram frames, from the sound file data with wolffd@0: % a sampling rate of sr Hz. Compute frameRate frames per second, using wolffd@0: % a window size of "width" samples. wolffd@0: wolffd@0: % (c) 1998 Interval Research Corporation wolffd@0: wolffd@0: if nargin < 2, sr = 16000; end wolffd@0: if nargin < 3, frameRate = 12; end wolffd@0: if nargin < 4, width = 256; end wolffd@0: wolffd@0: [channels, len] = size(data); wolffd@0: frameIncrement = fix(sr/frameRate); wolffd@0: frameCount = floor((len-width)/frameIncrement)+1; wolffd@0: fprintf('Correlogram spacing is %g samples per frame.\n', frameIncrement); wolffd@0: wolffd@0: movie = zeros(channels*width, frameCount); wolffd@0: for i=1:frameCount wolffd@0: start = (i-1)*frameIncrement + 1; wolffd@0: pic = CorrelogramFrame(data, width, start, frameIncrement*4); wolffd@0: minimum = min(min(pic)); wolffd@0: maximum = max(max(pic)); wolffd@0: image((pic-minimum)/(maximum-minimum)*length(colormap)); wolffd@0: drawnow; wolffd@0: movie(:,i) = reshape(pic, channels*width, 1); wolffd@0: end