The module first implements the construction of matrices exactly as described above. Then, since the zero lag output is the sample variance, we are able to implement data normalization as a floating reference hypothesis (See Section 2.3.4). The function software/pdf_quadspa.m implements the log-PDF of ACF feature under hypothesis of independent Gaussian noise of variance 1. Using equation (2.17) directly, we can write the J-function for the feature as using the floating-variance reference hypothesis as
% the variance estimate for normalization v=mean(x.^2); % The PDF of x under floating hypothesis Hv: lpxHv = -N/2*log(2*pi*v) - sum(x.^2,1)/2/v; % The PDF of r under floating hypothesis Hv: lprHv=pdf_quadspa(r/v,Pm,level)+(P+1)*log(v) jout = jin + lpxHv - lprHv
We can float the reference hypothesis even closer to the data by changing the assumed covariance of the reference hypothesis. If we base the covariance on the feature r, we must use the autoregressive assumption to extend the covariance beyond the -th lag. We then use equation (9.2) to modify the matrices . That is all accomplished by the following code extract:
% compute extended ACF using AR: [a,e]=levinson(r,P); pa=e./msq(fft(a,2*N)); ra=real(ifft(pa)); % normalize to have variance 1 e=e/ra(1); ra=ra/ra(1); % create the ACF matrix: R=toeplitz(ra(1:N)); ldr=log(det(R)); % Modify the quadratic form matrices C=chol(R); for i=1:P+1, Pm(:,:,i) = C* Pm(:,:,i) * C'; end;
The PDF of under must also be used
xt=x/sqrt(v); lpxHv = -N/2*log(2*pi*v) - .5*ldr-.5*xt'*(R\xt);This can be implemented efficiently using software/pdf_arma_exact.m (See section 10.2.3):
lpxHv = pdf_arma_exact(x/sqrt(v),a,1,e,0)-N/2*log(v);For additional information and experimental results of this module, see software/module_acfx.m, software/module_acfx_test.m, software/module_acfx_synth.m, and see Section 10.4.10.