Hi Akankshu, On Thu, Nov 12, 2009 at 9:17 AM, Akankshu Dhawan <[email protected]> wrote: > Hi All > I am using two mechanisms for high sampling. > 1. Using MicStreamC and changing the prescalar value inside MicP to > ATM128_ADC_PRESCALE_32 and the gain value is set to 64. > I create a buffer of 1000 samples and every time the buffer gets full I take > the average and print it out. The problem is that the microphone does not > seem to be responding or is not showing me sufficiently precise values. The > average when I dont make a noise is around 500 ADC.. and even if I am > clapping shouting (for long durations) it still shows me slightly lower > values like 497 etc. So I am not sure why this is so ?
The values from the ADC are DC offset to about level 500 (which is halfway in the 10-bit resolution). This means when the values reported by the microphone transducer are negative, you get a lower ADC value. For what you want to do, I would suggest computing the corrected mean square and not the direct mean. That is: mean=1/1000*sum((v[i]-500)^2) where, 1000 is the number of samples in your buffer and 500 is your halfway point. In general, you may want to calibrate your halfway point. Zainul. > 2. When I created the low level interfaces on my own using the sample > SoundLocalizer example in Tinyos programming book, I am giving the > microphone ADC a free run at the same prescale setup (there is a difference > of some parameter being passed through getData as FALSE in that example > which is suppose to cater to LEFT_ADJUSTMENT ) but when I compare the values > that I am getting inside dataReady they respond well to sounds. This would > work for me but I am just curious why the MicStream does not work. This way > I would not have to recreate all the buffer code. > If anyone can please tell me what setting inside MicSetting or MicP have I > done wrong that it is not responding. > Thanks a lot. > SIncerely > Akankshu Dhawan > -- > First they ignore you, then they laugh at you, then they fight you, then you > win. > - Mahatma Gandhi > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
