dtczhl / dtc-doppler-illustrator

Illustrating Doppler effect using sounds.

Home Page:https://www.huanlezhang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dtc-doppler-illustrator

License: MIT  Codacy Badge

Illustrating acoustic Doppler effect using Android phones

Two phones are required: one for emitting inaudible sounds and the other for calculating and displaying Doppler

Screenshot

screenshot

(Screenshot from Huawei Mate 20)

Code Structure

It has mainly two components. One for transmitting signals, and the other one for analyzing received signals. Parts of codes are copied from my other two repositories dtc-frequency-player and dtc-acoustic-spectrumer. You could refer to these repositories for some details.

Sender

The sender part is implemented in the PlaySound.java class, which emits sounds of a single frequency. The phone sends out sounds of 19 KHz. You can easily change to other frequencies if you like. See my repo dtc-frequency-player

Receiver

The receiver part is implemented in the AnalyzeFrequency.java class. The acoustic signals go through the following processing

  1. receive sounds. See my repo dtc-acoustic-spectrumer

  2. filtering. We apply a bandpass filter that only allows signals within [18KHz, 21KHz]. There is a very convenient Android app named FIR Filter Designer that can generate Java code for you. The higher order of filters causes greater computation overhead.

  3. undersampling and overlapping. Undersampling is applied to increase the frequency resolution and overlapping is used to increase temporal fidelity. We use 8X undersampling and 0.875 overlapping.

  4. window function. We apply Blackman-Harris window to smooth the spectrum. You can try other window functions as well. https://en.wikipedia.org/wiki/Window_function

  5. Fast-Fourier Transform (FFT). See my repo dtc-acoustic-spectrumer

  6. calculate Doppler shift. Since we know that the sender's signal is 19 KHz, we only need to calculate the received frequency (with the strongest magnitude) minus 19 KHz.

  7. draw Doppler shift on screen. See my repo dtc-acoustic-spectrumer

More Details

This repo is part of my project. For more technical details please refer to my paper

  • [Paper 1] DopEnc: Acoustic-based Encounter Profiling Using Smartphones, published in ACM Conference on Mobile Computing and Networking (MobiCom), 2016
  • [Paper 2] An Acoustic-Based Encounter Profiling System, published in IEEE Transactions on Mobile Computing (TMC), 2018

Please also consider to cite my papers. Thank you.

Phones Tested

  • Huawei Mate 20
  • Google Pixel 2

About

Illustrating Doppler effect using sounds.

https://www.huanlezhang.com


Languages

Language:Java 100.0%