annotate dsp/spec2ac.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
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