{"id":13418977,"url":"https://github.com/DanielRapp/doppler","last_synced_at":"2025-03-15T04:31:12.017Z","repository":{"id":28346591,"uuid":"31860188","full_name":"DanielRapp/doppler","owner":"DanielRapp","description":":wave: Motion detection using the doppler effect","archived":false,"fork":false,"pushed_at":"2017-03-29T18:46:15.000Z","size":7167,"stargazers_count":2387,"open_issues_count":6,"forks_count":179,"subscribers_count":100,"default_branch":"master","last_synced_at":"2025-03-11T04:17:22.982Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://danielrapp.github.io/doppler/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanielRapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-08T18:21:59.000Z","updated_at":"2025-03-09T08:23:29.000Z","dependencies_parsed_at":"2022-08-25T09:54:07.019Z","dependency_job_id":null,"html_url":"https://github.com/DanielRapp/doppler","commit_stats":null,"previous_names":["danielrapp/doppler.js"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielRapp%2Fdoppler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielRapp%2Fdoppler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielRapp%2Fdoppler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielRapp%2Fdoppler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanielRapp","download_url":"https://codeload.github.com/DanielRapp/doppler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243685506,"owners_count":20330980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:01:09.624Z","updated_at":"2025-03-15T04:31:11.991Z","avatar_url":"https://github.com/DanielRapp.png","language":"JavaScript","readme":"# Motion sensing using the doppler effect\n[This is an implementation](https://danielrapp.github.io/doppler/) of the [SoundWave paper](http://research.microsoft.com/en-us/um/redmond/groups/cue/publications/guptasoundwavechi2012.pdf)\non the web. It enables you to detect motion using only the microphone and speakers!\n\n## How to use it\nJust run it like this\n```javascript\ndoppler.init(function(bandwidth) {\n  console.log(bandwidth.left - bandwidth.right);\n});\n```\nSee more in [example.html](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](https://danielrapp.github.io/doppler/).\n\n## What to contribute?\nWhat to contribute?\nHere's what is most needed:\n\n### Multiple sinusoids\nAdd support for using multiple sinusoids, and combining the data (could be as simple as taking the average), to improve robustness.\n\n### Experimental robustness improvement\nUp for a challenge? It'd be great to implement the various tricks [described on HN](https://news.ycombinator.com/item?id=9180380) on improving the robustness/accuracy for this (using tricks from radar tech).\n\n### Moving the hand too quickly\nIn the [SoundWave paper](http://research.microsoft.com/en-us/um/redmond/groups/cue/publications/guptasoundwavechi2012.pdf) 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\n\n\u003e perform a second scan, looking beyond the stopping point\n\u003e of the first scan. If a second peak with at least 30% of the\n\u003e primary tone’s energy is found, the first scan is repeated to\n\u003e find amplitude drops calculated from the second peak.\n\nThis improvement can/should all occur in the `getBandwidth` function.\n\n## Firefox?\nUnfortunately 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).\n\n## Derivatives\n* The awesome [Jasper Lu](https://github.com/jasper-lu) implemented a version of this [to android](https://github.com/jasper-lu/doppler-android). [Go check it out](https://github.com/jasper-lu/doppler-android)!\n* The wonderful [Harrison Green](https://github.com/hgarrereyn) wrote a [chrome extension](https://chrome.google.com/webstore/detail/audioscroll-extension/nknlpaccngmmdfjcbjkccfmoimehdeli?hl=en-US\u0026gl=US) with this!\n* [Stan James](https://github.com/wanderingstan/handybird) created a wonderful flappy birds implementation with it.\n","funding_links":[],"categories":["JavaScript","sound","Uncategorized","Javascript"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDanielRapp%2Fdoppler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDanielRapp%2Fdoppler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDanielRapp%2Fdoppler/lists"}