comparison toolboxes/MIRtoolbox1.3.2/AuditoryToolbox/CorrelogramMovie.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:cc4b1211e677
1 function movie = CorrelogramMovie(data, sr, frameRate, width)
2 % function movie = CorrelogramMovie(data, sr, frameRate, width)
3 % Compute a Matlab movie of a sound array called "data" which has
4 % a sampling rate of sr Hz. Compute frameRate frames per second, each
5 % time taking "width" samples for analysis.
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
17 movie = moviein(frameCount);
18 for i=1:frameCount
19 start = (i-1)*frameIncrement + 1;
20 pic = CorrelogramFrame(data, width, start, frameIncrement*2);
21 minimum = min(min(pic));
22 maximum = max(max(pic));
23 image((pic-minimum)/(maximum-minimum)*length(colormap));
24 drawnow;
25 movie(:,i) = getframe;
26 end