annotate dsp/spec2ac.m @ 47:82075c94eed1

adding a bunch of stuff, including graphics and pitch toolboxes.
author samer
date Sat, 17 Jan 2015 15:20:35 +0000
parents c3b0cd708782
children
rev   line source
samer@32 1 function R=spec2ac(A)
samer@32 2 % SPEC2AC - convert power spectrum to autocorrelation sequence
samer@32 3 %
samer@32 4 % assumes that S is a half-spectrum.
samer@32 5 % R=spec2ac(S)
samer@32 6
samer@32 7 if isvector(A), A=A(:); end
samer@32 8
samer@32 9 S=[A; A(end-1:-1:2,:)];
samer@32 10 R=real(ifft(S)); % autocorrelation
samer@32 11 R=R(1:(1+size(R,1)/2),:); % extract first half (rest is symmetric)
samer@32 12