Thank you for the code and information. I checked out the documentation, and did the following to reproduce something similar to the MATLAB code I was using.
center_freq = 20 # in Hz
filter_frequency_spread = 6 # Hz +/- the center frequency
transition_width = 0.2
ffrequencies = [
0,
(1-transition_width)*(center_freq-filter_frequency_spread),
(center_freq-filter_frequency_spread),
(center_freq+filter_frequency_spread),
(1+transition_width)*(center_freq+filter_frequency_spread),
nyquist,
] /nyquist
idealresponse = [ 0, 0, 1, 1, 0, 0, ]
# Order hard set to 200 as in MATLAB code
filterweights = remez(
200,
[
(ffrequencies[1], ffrequencies[2]) => 0,
(ffrequencies[3], ffrequencies[4]) => 1,
(ffrequencies[5], ffrequencies[6]) => 0
],
Hz = EEG["srate"]/nyquist
)
And then to take a look at what’s going on with a fft
filterweights = (firls(200,ffrequencies,idealresponse));
# compute its power spectrum
fft_filtkern = abs.(fft(filterweights))
fft_filtkern = fft_filtkern./maximum(fft_filtkern) # normalized to 1.0 for visual comparison ease
hz_filtkern = range(0,nyquist, length=101); # list of frequencies in Hz corresponding to filter kernel
From the original MATLAB code:

