spm_eeg_lapmtx.m 981 B

1234567891011121314151617181920212223242526272829303132333435
  1. function [T] = spm_eeg_lapmtx(pst)
  2. % Laplace transform basis set for ERPs
  3. % [T] = spm_eeg_lapmtx(pst)
  4. %
  5. % pst - perstimulus time in ms.
  6. %
  7. % T - Laplace transform basis set
  8. %
  9. %__________________________________________________________________________
  10. % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
  11. % Karl Friston
  12. % $Id: spm_eeg_lapmtx.m 1143 2008-02-07 19:33:33Z spm $
  13. % assume a single sample if not specified
  14. %--------------------------------------------------------------------------
  15. pst = pst(:)/pst(end);
  16. pst = pst.*(pst > 0);
  17. w = [1:32]*pi;
  18. k = [1:4];
  19. T = [];
  20. S = sparse(2,0);
  21. for i = 1:length(w)
  22. for j = 1:length(k)
  23. W = w(i);
  24. K = k(j)*W;
  25. s = sqrt(-1)*w(i) + k(j)*i;
  26. T(:,end + 1) = pst.^3.*exp(-s*pst);
  27. S(:,end + 1) = [W; K];
  28. end
  29. end
  30. % select major modes
  31. %--------------------------------------------------------------------------
  32. T = spm_svd(imag(T));