diff toolboxes/MIRtoolbox1.3.2/AuditoryToolbox/CorrelogramArray.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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/toolboxes/MIRtoolbox1.3.2/AuditoryToolbox/CorrelogramArray.m	Fri Aug 19 13:07:06 2016 +0200
@@ -0,0 +1,27 @@
+function movie = CorrelogramArray(data, sr, frameRate, width)
+% function movie = CorrelogramArray(data, sr, frameRate, width)
+% Compute an array of correlogram frames, from the sound file data with
+% a sampling rate of sr Hz.  Compute frameRate frames per second, using
+% a window size of "width" samples.
+
+% (c) 1998 Interval Research Corporation
+
+if nargin < 2, sr = 16000; end
+if nargin < 3, frameRate = 12; end
+if nargin < 4, width = 256; end
+
+[channels, len] = size(data);
+frameIncrement = fix(sr/frameRate);
+frameCount = floor((len-width)/frameIncrement)+1;
+fprintf('Correlogram spacing is %g samples per frame.\n', frameIncrement);
+
+movie = zeros(channels*width, frameCount);
+for i=1:frameCount
+	start = (i-1)*frameIncrement + 1;
+	pic = CorrelogramFrame(data, width, start, frameIncrement*4);
+		minimum = min(min(pic));
+		maximum = max(max(pic));
+		image((pic-minimum)/(maximum-minimum)*length(colormap));
+		drawnow;
+	movie(:,i) = reshape(pic, channels*width, 1);
+end