jdhuang-csm / pygamry

A Python package for customized electrochemical experiments with Gamry potentiostats
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

filter_response: True or False? #3

Closed duangs-zju closed 4 months ago

duangs-zju commented 4 months ago

Dear Jake,

Thanks for your sharing!

I read the relevant code in pygamry and the part about downsampling confuses me. As we all know, the data needs to be filtered before downsampling. However, the default values of filter in the file are all False, e.g:

pygamry\dtaq\\hybrid.py line 375 leave_cell_on=False, filter_response=False) and measure_script\\arg_config.py line 76 '--decimate_filter': dict(default=False, action='store_true')

Does this mean that filtering is not done by default before downsampling? Why?

jdhuang-csm commented 4 months ago

Hello,

You are right - by default, the digital filter is not applied before downsampling. I chose to make this the default behavior simply to be cautious with applying any modifications to the data - I expect that the user may want to test the filter before deciding to apply it to their measurements. Nonetheless, best practice should be to apply the filter before downsampling to avoid aliasing effects. As a note, when the filter is applied, the raw downsampled data (without filtering) is saved in a separate file for comparison to the filtered and downsampled data.

duangs-zju commented 4 months ago

Okay, thanks for the reply👍.