The voxelwise ALFF values are calculated with the following steps:
time series (detrended or not, chosen by user) -> FFT
For the denominator of fALFF:
- go through positive harmonics from m= 1 (ignore baseline harmonic) to Nyquist, and sum the sqrt of power per frequency (that is, sum the amplitudes)
For ALFF and numerator of fALFF:
- go through harmonics from m= minimum index to maximum index of bandpass range, and sum the sqrt of power per frequency (that is, sum the amplitudes)
Scale ALFF by 2/sqrt(number of time points)---the factor of 2 comes from going through just the "positive" harmonics.
Re. the factor of 2 common to both methods: that is purely implementational, as each one is summing over half of the Fourier components (which is fine, because they are symmetric, for real input signals).
So, one difference is that the ALFF is scaled by sqrt(N) in 3dRSFC, where N is the number of time points in the time series, rather than by just N, as used in DPABI. Why do we use sqrt(N)? Because the original ALFF work by Zang et al calculated ALFF in a similar way as here:
time series -> FFT -> power spectrum -> sqrt of power spectrum -> sum over LFF range.
So, because the original derivation mentions calculating a power spectrum, where each coefficient is typically scaled by 1/N, we have:
sqrt( power/N) = sqrt(power)/sqrt(N).
The relation of time series, Fourier transforms and both power and amplitude series are presented in the Appendix here:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3621593/
and the ALFF is shown in that Eq. 7---note that the notional range of components is over the full N harmonics (not just N/2), so no factor of 2 shows up there.
I don't quite understand the ALFF_2D aspect in above-posted code.
--pt