annotate 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 |
|
rev |
line source |
Daniel@0
|
1 function movie = CorrelogramMovie(data, sr, frameRate, width)
|
Daniel@0
|
2 % function movie = CorrelogramMovie(data, sr, frameRate, width)
|
Daniel@0
|
3 % Compute a Matlab movie of a sound array called "data" which has
|
Daniel@0
|
4 % a sampling rate of sr Hz. Compute frameRate frames per second, each
|
Daniel@0
|
5 % time taking "width" samples for analysis.
|
Daniel@0
|
6
|
Daniel@0
|
7 % (c) 1998 Interval Research Corporation
|
Daniel@0
|
8
|
Daniel@0
|
9 if nargin < 2, sr = 16000; end
|
Daniel@0
|
10 if nargin < 3, frameRate = 12; end
|
Daniel@0
|
11 if nargin < 4, width = 256; end
|
Daniel@0
|
12
|
Daniel@0
|
13 [channels, len] = size(data);
|
Daniel@0
|
14 frameIncrement = fix(sr/frameRate);
|
Daniel@0
|
15 frameCount = floor((len-width)/frameIncrement)+1;
|
Daniel@0
|
16
|
Daniel@0
|
17 movie = moviein(frameCount);
|
Daniel@0
|
18 for i=1:frameCount
|
Daniel@0
|
19 start = (i-1)*frameIncrement + 1;
|
Daniel@0
|
20 pic = CorrelogramFrame(data, width, start, frameIncrement*2);
|
Daniel@0
|
21 minimum = min(min(pic));
|
Daniel@0
|
22 maximum = max(max(pic));
|
Daniel@0
|
23 image((pic-minimum)/(maximum-minimum)*length(colormap));
|
Daniel@0
|
24 drawnow;
|
Daniel@0
|
25 movie(:,i) = getframe;
|
Daniel@0
|
26 end
|