GithubHelp home page GithubHelp logo

alexxnica / doppler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielrapp/doppler

0.0 1.0 0.0 7 MB

:wave: Motion detection using the doppler effect

Home Page: https://danielrapp.github.io/doppler/

License: MIT License

JavaScript 81.72% HTML 18.28%

doppler's Introduction

Motion sensing using the doppler effect

This is an implementation of the SoundWave paper on the web. It enables you to detect motion using only the microphone and speakers!

How to use it

Just run it like this

doppler.init(function(bandwidth) {
  console.log(bandwidth.left - bandwidth.right);
});

See more in example.html. (Note that doppler uses navigator.getUserMedia, which can't be run on the local filesystem, so you'll have to start a server to run this. E.g. with python -m SimpleHTTPServer.) Read more about the theory of how this works on the github-pages site.

What to contribute?

What to contribute? Here's what is most needed:

Multiple sinusoids

Add support for using multiple sinusoids, and combining the data (could be as simple as taking the average), to improve robustness.

Experimental robustness improvement

Up for a challenge? It'd be great to implement the various tricks described on HN on improving the robustness/accuracy for this (using tricks from radar tech).

Moving the hand too quickly

In the SoundWave paper they talk about a phenomenon that occurs when you move your hand too quickly. (See Figure 2d.) A new bulge is formed. I didn't implement the method they described for reducing this, but it should be pretty easy. What I'm doing at the moment to calculate the bandwidth (see getBandwidth), is just iteratively step to the right and left until I've hit a frequency with amplitude 0.001 (see maxVolumeRatio) of the doppler tone (see the global variable freq). What should be done instead (as suggested by the paper) is

perform a second scan, looking beyond the stopping point of the first scan. If a second peak with at least 30% of the primary tone’s energy is found, the first scan is repeated to find amplitude drops calculated from the second peak.

This improvement can/should all occur in the getBandwidth function.

Firefox?

Unfortunately this doesn't work on Firefox since it doesn't seem to support the echoCancellation: false parameter to navigator.getUserMedia. This means there's no way to turn off it filtering out the sounds which are coming from the computer itself (which is precisely what we want to measure).

Derivatives

doppler's People

Contributors

danielrapp avatar webreflection avatar

Watchers

 avatar

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.