[Eeglablist] Setting correct parameters for pop_eegfiltnew()

Alica Rogojin arogojin at research.baycrest.org
Fri Feb 24 08:29:32 PST 2023


Hi there,

Apologies for the double email - I think I may have figured it out but was
hoping to confirm that I did this correctly.

fs = 5000; %5000 Hz sampling rate
df = 1; %requested transition band width of 1Hz (I'm not sure if this is
reasonable or if I should have a larger transition band)
filter order = 3.3/(1/5000) = 16,500

1) Bandpass filter of 25 - 1000 Hz means lower passband edge = 25.5 Hz and
upper passband edge = 999.5 Hz (based on transition band of 1Hz)

>> EEG = pop_eegfiltnew(EEG, 'locutoff', [], 'hicutoff', 25.5, 'filtorder',
16500, 'revfilt', 0) --> will give a 25 Hz highpass with 25.5 Hz passband
edge
>> EEG = pop_eegfiltnew(EEG, 'locutoff', 999.5, 'hicutoff', [],
'filtorder', 16500, 'revfilt', 0) --> will give a 1000 Hz lowpass with
999.5 Hz passband edge

2) Then using same transition band for a notch filter, would I need to set
'revfilt' to 1?
This is where things get a bit confusing but for a notch filter of of
57-63Hz, would I do the following:

>> EEG = pop_eegfiltnew(EEG, 'locutoff', [], 'hicutoff', 57.5, 'filtorder',
16500, 'revfilt', 1)
>> EEG = pop_eegfiltnew(EEG, 'locutoff', 62.5, 'hicutoff', [], 'filtorder',
16500, 'revfilt', 1)

3) Do I need to specify anything for usefft, plotfreqz, minphase, or
usefftfilt?

Thank you!
Alica

On Fri, Feb 24, 2023 at 10:25 AM Alica Rogojin <
arogojin at research.baycrest.org> wrote:

> Hi there,
>
> I'm trying to use pop_eegfiltnew to filter EMG data from a muscle in the
> hand, sampling rate = 5000Hz.  I'd like to apply a bandpass filter (low
> cutoff = 25Hz, high cutoff = 1000Hz) and a notch filter (60Hz), and have
> the following:
>
> Bandpass filter -
> >> EEG = pop_eegfiltnew(EEG, 'locutoff', 25, 'hicutoff', 1000);
>
> Notch filter (revfilt = 1 to change bandpass filter to be a notch filter)
> -
> >> EEG = pop_eegfiltnew(EEG, 'locutoff', 57, 'hicutoff', 63, 'revfilt', 1);
>
> However, looking into more posts about pop_eegfiltnew I feel that I may
> have oversimplified and there may be more to this.  Did I do this correctly?
>
> According to <https://sccn.ucsd.edu/pipermail/eeglablist/2017/012297.html>,
> the numbers I used above are not actually cutoff frequencies but are
> passband edges.  They also mention calculating transition band widths to
> get the correct cutoff frequency to use in pop_eegfiltnew.  I'm a bit
> confused as to how to do this and would appreciate any pointers.  Same for
> the notch filter.
>
> I also saw posts mentioning that I should not be creating a bandpass
> filter with high and low cutoffs in one - that I should be doing this in
> separate lines.  Is this true?
>
> I would appreciate any help!  Thank you,
> Alica
>
>



More information about the eeglablist mailing list