Hey everyone,
I wanted to make a post to ask about the Bandpass filter, specifically how its designed. I am running wPLI on some source EEG data so I used the Brainstorm GUI to generate a wPLI matrix and then I also wrote my own wPLI code on Matlab. The matrices are a perfect match (100% correlation), but I do not understand the filter and would like some explanation/advice.
So, to extract frequency within the desired frequency range (e.g. 1-4Hz Delta), I use the following Brainstorm function:
DataAband = process_bandpass('Compute', my_data, Fs, (low_freq), (high_freq));
(my_data is regions x time, Fs is 250Hz sampling frequency, low/fast_freq are the band limits)
I looked here: https://neuroimage.usc.edu/brainstorm/Tutorials/ArtifactsFilter ...to find some explanation about this bandpass filter. I now understand this is a FIR type filter, and mostly likely 60dB stopband attenuation (set by default) but I know nothing else about it.
I tried to design this filter myself to avoid using the function as I am not sure about the specifics, but the results are not the same:
Fs = 250; % Sampling frequency (Hz)
low_cutoff = 1; % Lower cutoff frequency (1 Hz) % Define the bandpass filter cutoff frequencies
high_cutoff = 4; % Upper cutoff frequency (4 Hz)
nyquist = Fs / 2; % Normalize the cutoff frequencies by the Nyquist frequency (Fs/2)
low_cutoff_norm = low_cutoff / nyquist;
high_cutoff_norm = high_cutoff / nyquist;
order = 50; % Filter order (no idea what to set this to exactly)
b = fir1(order, [low_cutoff_norm high_cutoff_norm], 'bandpass'); % Filter order (again, no idea how to modify this)
I am wondering if there is a publication or something that explains all the details of this filter or if there is a way to know the specific parameters.
If I could understand how 'process_bandpass' works, then I wouldn't need to design the filter myself. I am just trying to build a good understanding of my own work and why this process works.
Any advice would be very welcome!
Healthy Regards,
Vyte