Skip to content

Commit

Permalink
Allow ALFF to work with low-pass or high-pass filters (PennLINC#1176)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo authored May 23, 2024
1 parent f559dc0 commit 4a50efc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions xcp_d/utils/restingstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ def compute_alff(data_matrix, low_pass, high_pass, TR, sample_mask=None):
# square root of power spectrum
power_spectrum_sqrt = np.sqrt(power_spectrum)
# get the position of the arguments closest to high_pass and low_pass, respectively
if high_pass == 0:
# If high_pass is 0, then we set it to the minimum frequency
high_pass = frequencies_hz[0]

if low_pass == 0:
# If low_pass is 0, then we set it to the maximum frequency
low_pass = frequencies_hz[-1]

ff_alff = [
np.argmin(np.abs(frequencies_hz - high_pass)),
np.argmin(np.abs(frequencies_hz - low_pass)),
Expand Down

0 comments on commit 4a50efc

Please sign in to comment.