]> git.alsa-project.org Git - alsa-utils.git/commit
alsabat: add noise detection
authorLu, Han <han.lu@intel.com>
Wed, 8 Jun 2016 19:42:49 +0000 (03:42 +0800)
committerTakashi Iwai <tiwai@suse.de>
Wed, 8 Jun 2016 13:17:14 +0000 (15:17 +0200)
commit0cfe4066189fcc2e37decabf4e3165409a28dac1
tree9d9fd2e69f7182e1b875732b387ed444111f2a26
parente1b7a5f3769803759c50d1b189160b9f9f03b36e
alsabat: add noise detection

Alsabat reports error when noise above threshold be detected.
Use either of the options below to designate the threshold. (e.g.
if the ratio of noise to signal is 5%, the snr is about 26dB.)
    --snr-db <value in dB>
    --snr-pc <value in %>

The noise detection is performed in time domain. On each period
of the sine wave being analyzed, alsabat substracts a clean sine
wave from the source, calculates the RMS value of the residual,
and compares the result with the threshold. At last, alsabat
returns the number of periods with noise above threshold. 0 is
returned when the source is clean.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
bat/alsabat-test.sh
bat/alsabat.1
bat/analyze.c
bat/bat.c
bat/common.h