You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The function connectivity matrix is calculated wrongly when the time series is odd-numbered length.
The bug occurs within the following code snippet in AnalyzeEnsemble_FUN_WU:
data = sub.getr('FUN');
fs = 1 / T;
if fmax > fmin && T > 0
NFFT = 2 * ceil(size(data, 1) / 2);
ft = fft(data, NFFT); % Fourier transform
f = fftshift(fs * abs(-NFFT / 2:NFFT / 2 - 1) / NFFT); % absolute frequency
ft(f < fmin | f > fmax, :) = 0;
data = ifft(ft, NFFT);
end
The issue arises when the input data contains odd-numbered time series, such as 83x150 (indicating 150 time series with 83 time points). In this case, the variable NFFT attempts to add zeros to the end of each time series, leading to unexpected highly correlated function connectivity matrices.
The following is an example of the wrongly calculated functional connectivity matrices due to the odd-numbered time series in certain subjects
To Reproduce
Steps to reproduce the behavior:
Provide functional data containing odd-numbered time series.
Execute the code and observe the constructed functional connectivity
Expected behavior
The Fourier transform operation should be executed correctly, producing accurate results regardless of the number of time points in the input data.
The text was updated successfully, but these errors were encountered:
c-yuwei
changed the title
Incorrect function connectivity matrix due to odd-numbered time series length
Incorrectly calculated function connectivity matrix due to odd-numbered time series length
Apr 29, 2024
c-yuwei
changed the title
Incorrectly calculated function connectivity matrix due to odd-numbered time series length
Incorrect Function Connectivity Matrix Calculation with Odd-Numbered Time Series
Apr 29, 2024
Describe the bug
The function connectivity matrix is calculated wrongly when the time series is odd-numbered length.
The bug occurs within the following code snippet in AnalyzeEnsemble_FUN_WU:
The issue arises when the input data contains odd-numbered time series, such as 83x150 (indicating 150 time series with 83 time points). In this case, the variable NFFT attempts to add zeros to the end of each time series, leading to unexpected highly correlated function connectivity matrices.
The following is an example of the wrongly calculated functional connectivity matrices due to the odd-numbered time series in certain subjects
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The Fourier transform operation should be executed correctly, producing accurate results regardless of the number of time points in the input data.
The text was updated successfully, but these errors were encountered: