Coder Social home page Coder Social logo

Comments (4)

EtienneCmb avatar EtienneCmb commented on May 18, 2024

GitMate.io thinks a possibly related issue is #7 (Add .rec loading capability).

from visbrain.

EtienneCmb avatar EtienneCmb commented on May 18, 2024

@raphaelvallat I think this a part of your code, can you take a look at it?

from visbrain.

raphaelvallat avatar raphaelvallat commented on May 18, 2024

Hi @skjerns
Yes, I agree that the current implementation is not adequate for the two situations that you describe. Plus, I also think that the ptp might sometimes be biased in cases of very strong artefacts. As a more robust check, we could use the interquartile range (scipy.stats.iqr) and check for each individual channel:

# Assume that the inter-quartile amplitude of EEG data is ~50 uV
from scipy.stats import iqr
iqr_data = iqr(data, axis=1)

for idx_chan, iqr_chan in enumerate(iqr_data):
    if iqr_chan < 1:
        mult_fact = np.floor(np.log10(50 / iqr_chan))
        warn("Wrong channel data amplitude. Multiplying data amplitude by 10^%i" % mult_fact)
        data[idx_chan, :] *= 10 ** mult_fact

If you have any ideas for a better check, please feel free to create a PR!
Thanks

from visbrain.

skjerns avatar skjerns commented on May 18, 2024

I think this is a good solution for now, and should cover most cases.

I suspect that there might be some problems however in case of non-EEG data (like Heartrate or temperature), but don't have a sample file right now to check it.

PR is created #33

from visbrain.

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.