We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 740c056 commit 5215335Copy full SHA for 5215335
Py/AC_fft_NIFTI.py
@@ -0,0 +1,19 @@
1
+#!/usr/bin/env python2
2
+# -*- coding: utf-8 -*-
3
+"""
4
+Created on Fri Mar 16 16:53:44 2018
5
+
6
+@author: sorooshafyouni
7
8
9
+def AC_fft_NIFTI(Y)
10
+ Y = Y-np.transpose(np.tile(mY2,(T,1))); #deamean to be safe!
11
12
+ nfft = 2**nextpow2(2*L-1); #zero-pad the hell out!
13
+ yfft = np.fft.fft(Y,n=nfft,axis=1); #be careful with the dimensions
14
+ ACOV = np.real(np.fft.ifft(yfft*np.conj(yfft),axis=1));
15
+ ACOV = ACOV[:,1:L];
16
+ xAC = ACOV/np.sum(np.abs(Y)**2,axis=1); #normalise the COVs
17
+ #bnd=(sqrt(2)*erfinv(0.95))./sqrt(L); #assumes normality for AC
18
+ #CI=[-bnd bnd];
19
+ return(xAC)
0 commit comments