Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible problem in bandpass filtering #89

Closed
farnazdelavari opened this issue Aug 9, 2023 · 1 comment · Fixed by #90
Closed

Possible problem in bandpass filtering #89

farnazdelavari opened this issue Aug 9, 2023 · 1 comment · Fixed by #90

Comments

@farnazdelavari
Copy link

I have been trying to generate CVR maps for simple resting state fMRI. The filtered average signal which is an output from the toolbox (petco2hrf) looked a bit strange to me. When checking the spectral density, it seems to us that the filtering might have failed.

Expected Behavior

I would expect such time-course:
image_2023-08-09_17-49-24

and a high density within the filtered 0.02-0.04 range of the filtered time course.
image_2023-08-09_17-48-32

Actual Behavior

The toolbox time-course is as below
image_2023-08-09_17-49-35

with the spectral density that is different :
image_2023-08-09_17-50-02

Steps to Reproduce the Problem

If the tc is the time-course filtered and stored in "avg_func_masked_petco2hrf.1D" and TR is the sampling rate of the MRI in seconds.
then this code in Matlab should generate the spectral density as stated.
N=lenghth(tc);
fs=1/TR;
xdft=fft(tc);
xdft = xdft(1:N/2+1);
psdx = (1/(fsN)) * abs(xdft).^2;
psdx(2:end-1) = 2
psdx(2:end-1);
freq = 0:fs/N:fs/2;
figure
plot(freq,pow2db(psdx),'r')

Specifications

- phys2cvr version: 0.16.0


- resting-state fMRI, TR=2.4 s, number of volumes = 200, band used = 0.02-0.04.

Possible solution

@smoia
Copy link
Owner

smoia commented Aug 13, 2023

@farnazdelavari can you check the new version against your matlab code please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants