Giter VIP home page Giter VIP logo

pulsepal's People

Contributors

jsneurodev avatar liangshe avatar sanworks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pulsepal's Issues

Rounding of numbers (Phase1Duration)

Dear Josh,

I'm playing a bit around with my PulsePal (Gen 2; FW: 2.0.1).

When setting the Phase1Duration manually (by joystick) to 300µs (=0.00030s) and the PulseInterval to 333ms (=0.33300s) in order to obtain 3Hz stimulation, in a burst of 16s - I, instead of the desired 3*16=48 pulses, get 49 pulses. That makes sense, - as there's still room for another pulse.
So I went for the python interface to circumvent this, by writing a loop with a "total number of pulses per burst".

But that introduces some new problems in regards of rounding.
Regardless if I set "myPulsePal.phase1Duration[1] = 0.00030" or "myPulsePal.programOutputChannelParam('phase1Duration', 1, 0.00030)" - the PulsePal reads the Phase1Duration as "0.00025s". And measuring the pulse width on an oscilloscope, the width does seem to be closer to 250µs.

I've also tried approaches with the decimal.Decimal module in python. E.g.
Decimal('300')/Decimal('1000000') => with and without either or both float(Phase1Duration) and round(Phase1Duration,6)...

If I put the following:
myPulsePal.programOutputChannelParam('phase1Duration', 1, 0.000301) -> that is, 301µs, the PulsePal reads "0.00030s", and the width (measured with an oscilloscope) does appear closer to 300µs.

According to your paper regarding the PulsePal (Sanders and Kepecs, 2014) you restricted the shortest configurable pulse duration to 100µs, which is also seen in that it is not possible to adjust the last precision point in the float (by joystick). But then it shouldn't be a problem with 300µs pulses? So I guess it is something about rounding...

When I get the python script to print the values that I assign to the Phase1Duration or InterPhaseInterval (etc.), it does seem to be the right values.

So... I'm probably missing a simple mistake that I make? Or there might be a bug in how these values a registered / assigned on the Arduino?

Hope to hear from you how you would suggest I go forward / circumvent this problem :)

Br,
Christian Skoven

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.