wolffd@0: function movie = CorrelogramMovie(data, sr, frameRate, width) wolffd@0: % function movie = CorrelogramMovie(data, sr, frameRate, width) wolffd@0: % Compute a Matlab movie of a sound array called "data" which has wolffd@0: % a sampling rate of sr Hz. Compute frameRate frames per second, each wolffd@0: % time taking "width" samples for analysis. 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: wolffd@0: movie = moviein(frameCount); wolffd@0: for i=1:frameCount wolffd@0: start = (i-1)*frameIncrement + 1; wolffd@0: pic = CorrelogramFrame(data, width, start, frameIncrement*2); 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) = getframe; wolffd@0: end