Coder Social home page Coder Social logo

Comments (6)

DominiqueMakowski avatar DominiqueMakowski commented on June 1, 2024

I guess this part was based on biosppy, that multiples 0.3 by the sampling rate internally (hence the 0.3 as a default order).

However, this might be correct with only particular filters (guess I never thought about this as I never had the occasion of using different filters). Maybe we could allow the order parameter to be something like order="default", which would then be set appropriately (to some standard values depending on the filter type)?

What do you think?

from neurokit.py.

renatosc avatar renatosc commented on June 1, 2024

Sorry for taking too long to reply. I looked the biosppy code and it appears to me that they added that 0.3 multiplication line just as simplification to internally calculate a order based on the sampling rate provided since the order is not a parameter itself. In our case, the ecg_preprocess accepts order as a parameter (filter_order) and have it multiplied by the sampling rate does not appear correct to me. But I am no expert in DSP and also a change in that point could break code of users. What do you think? Leave that way?

from neurokit.py.

DominiqueMakowski avatar DominiqueMakowski commented on June 1, 2024

Hum, the idea was just to expose the order parameter (further adjusted based on the sampling rate). Instead of being hard-coded to 0.3 as biosppy, it is set as default to 0.3 but can be changed if need be. To be honest, I never had to change this parameter, but I guess that for some other filter types it could make sense to change it.
Do you know how we could change it for the better?

from neurokit.py.

renatosc avatar renatosc commented on June 1, 2024

The problem is not the default value, but what you do with the value after:
order = int(filter_order * sampling_rate)

Because right now if I enter, let's say, filter_order = 4, the code will actually use 4 * sampling rate for the order, which is not intuitive from the outside.

from neurokit.py.

DominiqueMakowski avatar DominiqueMakowski commented on June 1, 2024

Right, would you suggest then improving the documentation (specifying that the order value is further multiplied by the sampling rate), or changing the way it is handled internally?

from neurokit.py.

renatosc avatar renatosc commented on June 1, 2024

That is actually the question that I asked you...hehe. The old dilema of making a breaking change or not... I think for now the documentation note would be enough. That way we don't create a incompatible update without previous notification.

from neurokit.py.

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.