Dear all,
I like to write a matlab script to calculate fractionalALFF and ALFF (Amplitude of lowfrequency fluctuations).

What is the right order for calculation:
Temporally bandpass filtered (0.01–0.0.8Hz) and then FFT
or
FFT and then to obtain the power spectrum across 0.01–0.08 Hz 
Should I apply linearly detrend on the input functional file? (for ALFF)
Can i apply melodic (ICA decomposition) and removal of noise components (with fsl_regfilt) and next to apply FFT? 
For fALFF should I calculate the entire frequency range of the whole brain or only the gray matter?

For fALFF, should I divide by the entire frequency range (00.5 Hz, Nyquist frequency) my TR=1sec?

For group comparison ALFF, f/ALFF should be both
 Divided by the global mean
and  transformed into Zscores
Tali