Skip to content

Question regarding temporal filtering #448

@takhs91

Description

@takhs91

Hi,
I was reading the way temporal filtering is implemented using the cosine model and except I was a bit confused from the fact that is written as a low-pass filter while it is a high-pass filter as also stated in #295 (An error that is actually propagated in nistats too https://github.com/nistats/nistats/blob/master/nistats/design_matrix.py#L87) I also think I noticed something else.

The order of the DCT that is computed at https://github.com/nipy/nipy/blob/master/nipy/modalities/fmri/design_matrix.py#L87
is the closest one (equal to or a bit lower in frequency ) to the requested cutoff point.

For example if you have 120 volumes and a tr of 2s and you want your cut period to be 120s then highest order should be

2*120*(1/120)*2 = 4

this is the exact dct order that will cut the requested period

Although later https://github.com/nipy/nipy/blob/master/nipy/modalities/fmri/design_matrix.py#L91
only the 1... order-1 drifts are added (plus the constant at last)missing the dct of order equal to the order found above.

Should't it be included too? If that's the case I am willing to proceed with a fix for here and for nistats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions