Closed ZoeChen96 closed 1 year ago
Hi @ZoeChen96
I agree we can add another parameter called filter_type="filtfilt" | "lfilter"
The function is defined correctly. The order=3
is just the default value, but it should be overwritten when you pass it externally.
After checking, I indeed noticed that the order
is not well propagated to the bandpass
case! Making a PR to fix both issues
Thank you very much!
Hi there,
I am generating MEArec datasets with different filtering options. I found two issues: 1) In MEArec filtering, I saw you use the
filtfilt
function. But if we want to mimic the analog filter applied to the signal, I think we need a causal filter (because in analog system we don't have the option to filter back in time), which means using functions such aslfilter
. For more information, you can refer to the following paper , part 2.2:Or at least, shall we have the option to choose between filtfilt and filter?
2) filtering order is not working. I configure the filter as following:
Then I found the filter cutoff works, but the filter order does not. (By checking the waveforms). I go inside the code, and found the parameter
order
does assigned to args in https://github.com/alejoe91/MEArec/blob/aa3d00ad6c4fea4e3f5fbd9401159e92e262dc07/MEArec/generators/recordinggenerator.py#L1276, but in the file tools.py, it seems to be overwrite by the default value 3: https://github.com/alejoe91/MEArec/blob/aa3d00ad6c4fea4e3f5fbd9401159e92e262dc07/MEArec/tools.py#LL2657C5-L2657C26. I tried to delete the default parameter 3, but it gives me an error ofCould you please have a look?