filtering and phase shift?

fanfanfdxfanfanfdx LiaoNing
edited April 3 in Software

After reviewing the C # code, how do you understand the phase shift caused by bandpass filtering in the code?

DataFilter.perform_bandpass (unprocessed_data, eeg_channels[i], BoardShim.get_sampling_rate (board_id), 4.0, 30.0, 4, (int)FilterTypes.BUTTERWORTH, 0.0);

Comments

  • retiututretiutut Louisiana, USA

    Please ask this question in BrainFlow Slack.

  • fanfanfdxfanfanfdx LiaoNing

    After reviewing the C # code, how do you understand the phase shift caused by bandpass filtering in the code?

    DataFilter.perform_bandpass (unprocessed_data, eeg_channels[i], BoardShim.get_sampling_rate (board_id), 4.0, 30.0, 4, (int)FilterTypes.BUTTERWORTH, 0.0);

  • wjcroftwjcroft Mount Shasta, CA

    Hi @fanfanfdx,

    I merged your new thread on phase shift into your previous thread. Did you see Richard's April 3rd comment (above) to post the question in the Brainflow Slack? You sign up for it via the home page:

    https://brainflow.org/

    See the Community / Slack button about halfway down the page.

    All DSP digital filters introduce some amount of phase shift. If you are applying similar filter parameters to each channel you are using, then ALL channels will shift the same amount. Thus you can compare across channels for metric such as coherence or synchrony with no problem.

    There are also quite a few web search results that you can explore:

    https://www.google.com/search?q=dsp+filter+phase+shift

    William

  • stellarpowerstellarpower Scotland

    @fanfanfdx Just glossing over the arguments, that appear to be a fourth-order Butterworth; this application here I find a little difficult to use if you're not an expert in the art of filter design, but it does show you an awful lot. You can see the phase response and group delay in a tab in the plotting. You should be able to design a Butterworth filter in the same way; if you can find the filter co-efficients within Brainflow you can also input those directly to make sure you have exactly the same filter.

  • wjcroftwjcroft Mount Shasta, CA

    Way impressive the filter design tool from Christian Münker,

    https://github.com/chipmuenk/pyfda

    He also has an extensive repo with many links on modular synths.

    https://github.com/chipmuenk/modular_synths

Sign In or Register to comment.