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