Skip to content

Commit 5215335

Browse files
committed
HelloWorld
1 parent 740c056 commit 5215335

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Py/AC_fft_NIFTI.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)