Coder Social home page Coder Social logo

Comments (7)

VisLab avatar VisLab commented on July 26, 2024 1

That is correct. Remember these are different methods and they do different things to the signal and cutoff frequencies are not direct equivalents.

Most of our testing was done with the high pass method. However, based on my experience, I don't believe that the detection of bad channels and robust reference is very sensitive to this choice or to the exact choice of frequency as long as it is in the ballpark.

Prep makes a big effort to produce a final signal that is not filtered or otherwise detrended so that users are free to select their filtering/trending based on application after referencing.

from eeg-clean-tools.

VisLab avatar VisLab commented on July 26, 2024

A few comments (corrected):

Detrending of linear type is done with the chronux_2 runline command. The change_row_to_column is part of chronux, which should be downloaded as part of the plugin so I don't know why there was a problem unless you didn't add it to your path. In PREP it is treated as local so just installing as an EEGLAB plugin (or not installing as an EEGLAB plugin) might not add it to your path correctly.

See @vasileermicioi for correct answer.

from eeg-clean-tools.

vasileermicioi avatar vasileermicioi commented on July 26, 2024

@VisLab
1.5/detrendFreq formula is reducing the frequency by 33%, which means using this formula with a detrendFreq=1Hz will have the same effect as using 1/detrendFreq with a detrendFreq=0.67Hz

from eeg-clean-tools.

VisLab avatar VisLab commented on July 26, 2024

@vasileermicioi: Thank you for pointing that out!

:-(( I looked at the defaults as set in getPrepDefaults.m to see what we were setting them to. I misread the default as signal.rate/2, but the default is 1, the first parameter in the specification structure.

The rules for detrendCutoff are: it must be positive, numeric, scalar, and have a value less than the Nyquist frequency.

    case 'detrend'
          defaults = struct( ...
            'detrendCutoff', ...
            getRules(1, {'numeric'}, ...
            {'positive', 'scalar', '<', signal.srate/2}, ...
            'Frequency cutoff for detrending or high pass filtering.'), ...
  );

The key observation is that you should set your detrendCutoff based on the frequency of the physical phenomenon you are detrending and 0.67 Hz is a reasonable detrending interval for EEG.

I think we probably should have called this parameter detrendCutoffHz to be clearer.

from eeg-clean-tools.

danibene avatar danibene commented on July 26, 2024

@VisLab
Thank you for your help, it was an issue with the path & the example code runs now.

Would you agree with redefining windowSize based on 1.0/detrendFreq as suggested by @vasileermicioi ?

I.e., instead of:

windowSize = 1.5/detrendOut.detrendCutoff;

windowSize = 1.0/detrendOut.detrendCutoff; 

We were wondering if we should make this change in our implementation and were interested in your input on whether that would be correct.

from eeg-clean-tools.

VisLab avatar VisLab commented on July 26, 2024

The removeTrend uses the
linear detrending when the else clause is taken. The windowSize is set to 1.5/detrendOut.detrendCutoff.

Since the default for detrendCutoff is 1, the default is 1.5 seconds. or 0.6667 Hz. I think this is a good default setting for EEG.

What I was trying to convey is that the name detrendCutoff is probably not the best name for this parameter, but the calculation is just fine. If we were going to change the windowSize to 1/detrendOut.detrendCutoff we would probably want to change the default detrendCutoff to 0.6667 instead of 1. Remember if you have a strong feeling that the detrending should be done using a different default cutoff, Prep will still work with a modified setting.

from eeg-clean-tools.

danibene avatar danibene commented on July 26, 2024

@VisLab Thank you for your response. To confirm I understood:

  1. when detrendType = 'linear', detrendCutoff = 1 will filter with a cutoff frequency of 0.6667 Hz?
  2. when detrendType = 'high pass', detrendCutoff = 1 will filter with a cutoff frequency of 1 Hz?

from eeg-clean-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.