Disable low freq filter

709 views
Skip to first unread message

larlin

unread,
May 2, 2011, 6:11:08 AM5/2/11
to android-porting
I posted this on android-developers and got the suggestion to post
here instead.

I'm trying to sample low frequency signals on the headset microphone
AD.

There seems like by default android uses the sound chip voice filter
which has a high pass filter around 100-200 Hz.

Looking around in the code I found the following.

The wolfson driver defines the 3 different filter options available on
the chip, eg:
static const char *adc_hpf_text[] = {"Hi-Fi","Voice 1","Voice 2",
"Voice 3",};
inhttp://opensource.wolfsonmicro.com/cgi-bin/gitweb.cgi?p=linux-2.6-aso...

In libaudio I can't really see that these are used again, does all
these options disappear inside alsa? Is it possible to change some
alsa setting to set which mode to use? Or have they changed name so
much that I can't recognise them any more?

Also in libaudio(hardware/msm7k/libaudio-qsd8k) I can find msm7k and
below that qsd8k if I have understood correctly these are qualcomm
chips but I know there is phones using wolfson, are they using the
same code due to being similar or is the wolfson related code
somewhere else?

Also in hardware/msm7k/libaudio-qsd8k/AudioHardware.cpp there seems
like system property "media.a1026.nsForVoiceRec" controls if to use
Noice Suppresion or not. This I guess could be a control for the
filtering. This seems to default to 0 and on my nexus one the flag
seems not to be set and still I get the low freq filtering. Is this
value in any way related to the filtering?

Would be very happy for any answer to these questions or explanations
around this part of android.

larlin

Chris Stratton

unread,
May 2, 2011, 9:36:07 AM5/2/11
to android-porting
On May 2, 6:11 am, larlin <larlin...@gmail.com> wrote:
> I'm trying to sample low frequency signals on the headset microphone
> AD.

> The wolfson driver defines the 3 different filter options available on
> the chip, eg:
> static const char *adc_hpf_text[] = {"Hi-Fi","Voice 1","Voice 2",
> "Voice 3",};

I hadn't realized here was a software component to this. My gut
assumption would be that there's dc blocking (ie series) capacitor in
the input circuit.

I wouldn't be surprised if there is one even if there's also software/
DSP filtering involved.

If you want performance all the way down to 0 Hz you may need to look
at using a mixer circuit to modulate your low frequency input with say
a 12 KHz (assuming 48 Ksps) carrier frequency, and then demodulate it
in software. Ie, you use the input signal to control the amplitude or
frequency of a ~12 Khz oscillator, and then measure that
characteristic in software to recover the input signal.

larlin

unread,
May 2, 2011, 3:10:55 PM5/2/11
to android-porting
Thanks for the reply!

Interesting suggestion with the carrier freq will look into that.
Would be very interesting to test the software route too. The
datasheet to the sound chips have filter curves that fits the observed
behaviour so I would like to try that too I got a couple different
platforms to test on so I could test it even if it is not changeable
from the sdk or ndk.

larlin
Reply all
Reply to author
Forward
0 new messages