Dear SPM'ers,
I want to plot the power spectrum of the estimated global AR(1) + white
noise model that is used in SPM.
I first create the residual forming matrix by I - S*X * pinv(S*X),
where X is the design matrix and S is the filtering matrix
residual_forming_matrix = eye(number_of_timepoints) - SPM.xX.xKXs.X *
SPM.xX.pKX;
I then multiply this matrix with the non-sphericity estimate, to obtain
the correlation matrix
correlation_matrix = residual_forming_matrix * SPM.xVi.V;
As this matrix has a Toeplitz structure, I can obtain the auto
correlation function as the first row (or column) of this matrix
correlation_function = correlation_matrix(:,1);
Finally I calculate the spectrum by using a Fourier transform
abs(fftshift(fft(correlation_function)))
Can anyone tell me if this is correct?
/Anders
--
--
-----------------------------------------------------------------------
Anders Eklund
Phd student
Medical Informatics, Department of Biomedical Engineering
CMIV, Center for Medical Image Science and Visualization
Tel: +46 73 6003790 mail: [log in to unmask]
Fax: +46 13 101902 web: http://www.wanderineconsulting.com/
-----------------------------------------------------------------------
|