Changing lib_mic_array fir_coefs for user defined frequency response Topic is solved

If you have a simple question and just want an answer.
Post Reply
shaileshwankhede
Experienced Member
Posts: 65
Joined: Fri Dec 02, 2016 1:30 pm

Changing lib_mic_array fir_coefs for user defined frequency response

Post by shaileshwankhede »

Hi,

I want mic array to consider only voice frequency in the range 130Hz to 620Hz.
I tried to run script fir_design.py of lib_mic_array by changing values of parameters like --first-stage-pass-bw, --second-stage-pass-bw etc. and replace existing fir_coefs.h and fir_coefs.xc with new generated files.
But I can't see any change in mic response while recording audio. In fact sound looks little noisy.

But more important is if manually change value of default=8 for --second-stage-pass-bw to default=0.1 (In Khz) and play 1KHz or 4KHz sine tone, I still can hear that in recorded signal with same intensity.
Changing these values doesn't seem to affect. When I see output of command python fir_design.py, final stage passband value always shows same 3360 Hz, only passband ripple changes.
Also is lower frequency always 0Hz? How to change it?

How do I change these parameters for my application?

Thanks,
Shailesh


View Solution
User avatar
andrew
Experienced Member
Posts: 114
Joined: Fri Dec 11, 2009 10:22 am

Post by andrew »

You need to tell the application to use your new filters. i.e. design a third stage decimator of your own specification then use it within your application.
shaileshwankhede
Experienced Member
Posts: 65
Joined: Fri Dec 02, 2016 1:30 pm

Post by shaileshwankhede »

Thank you very much Andrew. This solved my problem.
But with this can I suppress lower frequencies or is there any other way to do this real time without much overhead?

Thanks,
Shailesh
User avatar
andrew
Experienced Member
Posts: 114
Joined: Fri Dec 11, 2009 10:22 am

Post by andrew »

there is a DC offset removal feature, you can vary its cut off with MIC_ARRAY_DC_OFFSET_LOG2
shaileshwankhede
Experienced Member
Posts: 65
Joined: Fri Dec 02, 2016 1:30 pm

Post by shaileshwankhede »

Does dc offset removal equivalent to high pass filtering. I think it will only remove dc bias and thus zero frequency(dc) only.
Anyway this term is also useful to me as I am seeing some dc offset when checked signal with xSCOPE.

Thanks,
Shailesh
User avatar
andrew
Experienced Member
Posts: 114
Joined: Fri Dec 11, 2009 10:22 am

Post by andrew »

Is dc offset removal equivalent to high pass filtering. Yes
shaileshwankhede
Experienced Member
Posts: 65
Joined: Fri Dec 02, 2016 1:30 pm

Post by shaileshwankhede »

Sorry for multiple questions. But do you know how alpha is dependant of high pass filter cutoff?
As per document, dc offset removal is implemented as single pole IIR filter given by:
Y[n] = Y[n-1] * alpha + x[n] - x[n-1]
If I remember dsp correctly, this will have one Zero at value 1 and one Pole at value alpha.
But how frequency response changes with this pole zero combination I couldn't find.
Is there any formula, applet or some generalization that can be made. I mean how exactly it is dependent on MIC_ARRAY_DC_OFFSET_LOG2?

Thanks,
Shailesh
User avatar
andrew
Experienced Member
Posts: 114
Joined: Fri Dec 11, 2009 10:22 am

Post by andrew »

Here is a good explanation of the DC offset filter used: http://www.embedded.com/design/configur ... DC-Removal

Eq 13-118 will give you the transfer function you require for adjusting the cut off. Hope that helps.
shaileshwankhede
Experienced Member
Posts: 65
Joined: Fri Dec 02, 2016 1:30 pm

Post by shaileshwankhede »

Yeah I analyzed that and with bode plot calculator given in: http://www.onmyphd.com/?p=bode.plot
for different values alpha obtained from MIC_ARRAY_DC_OFFSET_LOG2, but this doesn't server to be good High pass filter as required.
Currently I override default MIC_ARRAY_DC_OFFSET_LOG2 value to 6. Results are slight better.

Thanks,
Shailesh
Post Reply