How are sets of sines and cosines for bandpass filtering via regression generated in 1dBport? I came across this post on the afni message board with a similar question but with an unclear answer. How are the frequencies to be removed represented with sines and cosines? Specifically, how are different phases represented and how is the resolution determined (i.e. how many regressors to generate)? A link to a paper with the relevant formulae and theoretical background would be great.
My goal in asking this question is to better understand how bandpass filtering can be done via OLS linear regression and how this method compares to other bandpass filtering methods (such as doing a FFT and multiplying by a rect function).
Paul has been planning to write up some of this in detail (though 1dBport was not driving that). But in the meantime…
OLS regression of frequencies should work exactly like the FFT. The only difference is the leading “F”. OLS is more like a slow FT rather than a fast one. The point of “fast” is that one can take advantage of the sines and cosines to make the regression more efficient. But it is still the same result. This is not special.
The phase is handled via relative contributions between the sine and cosine terms for a given frequency.
The resolution is based on a fully invertible FT matrix, with all frequencies up to Nyquist, which is then truncated to the bands of interest. The full matrix would have the same number of vectors as there are time points. So the frequency resolution would be Nyquist/(NT/2), with the extra /2 accounting for frequency terms coming in pairs.
Anyway, this method should be the same a using an FFT and multiplying by a rect function. 1dBport outputs the relevant frequency components, and 3dDeconvolve regresses them out (or hands them to 3dTproejct to do so).