From 38094b90c4b61fc312c006c99dd45158a4714cf8 Mon Sep 17 00:00:00 2001 From: Andrew Stanford-Jason Date: Wed, 23 Sep 2015 09:43:16 +0100 Subject: [PATCH] removed the agc and replaced it with a fixed gain --- module_usb_audio/pcm_pdm_mic.xc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module_usb_audio/pcm_pdm_mic.xc b/module_usb_audio/pcm_pdm_mic.xc index c95a760b..a56fdb8a 100644 --- a/module_usb_audio/pcm_pdm_mic.xc +++ b/module_usb_audio/pcm_pdm_mic.xc @@ -211,11 +211,13 @@ void example(streaming chanend c_ds_output_0, streaming chanend c_ds_output_1, s default:break; } +#define GAIN 0 + if((-a) > max) max = (-a); if(a > max) max = a; int output; if(only_one_mic){ - output = a<<(clz(max)-1); + output = a< max) max = (-a); if(a > max) max = a; @@ -231,7 +233,7 @@ void example(streaming chanend c_ds_output_0, streaming chanend c_ds_output_1, s if(f > max) max = f; output = a+b+c+d+e+f+g+g; output >>=3; - output = output<<(clz(max)-1); + output = output<>17);