Mercurial > hg > camir-aes2014
comparison toolboxes/MIRtoolbox1.3.2/AuditoryToolbox/CorrelogramMovie.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 = 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 |