hcilab / BreathingSonarJS

A Javascript web-tool that monitors breathing using high-frequency sonar
1 stars 0 forks source link

Sonar readings are sometimes out of range #4

Open aarontabor opened 4 years ago

aarontabor commented 4 years ago

Overview

Theoretically, the raw sonar readings should always read within the range [0, 255] (i.e., an 8-bit unsigned integer). However, I'm assuming I've made an error somewhere in calculations because I occasionally encounter very large readings.

This is likely due to an unaccounted for divide-by-zero, so take some time to find and address this.

Temporary Work Around

For now, I've simply clipped the normalized readings to the expected range when this occurs (i.e., [-1.0, 1.0]).