Akankshu,

I have taken a look at the code, but I'm not really able to say what is significantly different between the two other than the fact that SoundLocalizer is designed to sample the microphone as fast as possible, so there are probably some optimizations that Hu Siquan (the author of the code, his email is inside the code if you need it) made to make it perform better. You would have to talk to him if you have questions about it as I have no hands-on experience with any of the mts300 functionality.

Your problem may be that the MicP implementation is that it has more overhead and samples the microphone fewer times per second. I have no idea of the speeds, but if for example, the MicP implementation takes 10 seconds to collect 1000 samples, you may be missing all of the peaks of the sound events (clapping, shouting, or whatnot) when you are sampling the ADC, versus SoundLocalizer which is designed to sample the ADC as fast as possible. Without access to the hardware, and performing some profiling of each implementation, i can't say for sure if this is the case.

Sorry that i couldn't help you more.

-Paul

Akankshu Dhawan wrote:
Hi Paul
Can you tell me what might be the different between the microphone implementation in MicrophoneC inside SoundLocalizer Vs the MicP inside mts300 ?


Thanks a lot
Akankshu

On Thu, Nov 12, 2009 at 4:44 PM, Paul Johnson <oewyn...@gmail.com <mailto:oewyn...@gmail.com>> wrote:

    CVS under /tinyos-2.x-contrib/tinyos-programming/

    -Paul


    Martin Osterloh wrote:
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Hi all,

    sorry for interfering this thread. But, where can I find the
    sourcecode to the soundlocalizer demo?

    Best,
    Martin

    Akankshu Dhawan wrote:
    Hi Michael and Zainul

    Thanks a lot for your response. I am grateful to be hearing from you.

    I will look into the corrected mean solution before I suggest some
    hardware changes to my team.

    Although, my bigger question was why direct sampling by calling
    getData->dataReady on a free running ADC (this is what is used in
    the SoundLocalizer example in Tinyos-2.x described in the book also)
    responds better ? if I try to do threshold detection of every sample
    using the same interface and direct sampling I get values which are
    very responsive and high rate of sampling. I know I am loosing on
    some precision by sampling at a rate other than the default
    ATM128_ADC_PRESCALE but since I am mainly using it for thresholding
    I think my application can handle it.

    Can you tell me some comparison between the microphone setup used by
    the MicP and MicStream compared to the SoundLocalizer direct
    sampling setup ?

    Thanks a lot once again

    Sincerely
    Akankshu Dhawan

    On Thu, Nov 12, 2009 at 1:30 PM, Michael Schippling
    <sc...@santafe.edu <mailto:sc...@santafe.edu> <mailto:sc...@santafe.edu>> 
wrote:

        I suspect that the straight averaging thing is not what you want.

        I haven't looked at the mic data, but it's sampling an AC
        signal (sound wave pressure alternates between compression
        and rarefaction at the frequency you perceive) and is probably
        biased so a no-pressure signal is pretty much in the middle of
        the ADC range. Averaging that AC signal over a number of high-low
        pressure waves will just give you the middle again.

        If that is the case, what you want to do is rectify the signal --
        half-wave would just chop off the samples below the mid-value,
        full-wave would invert them around the mid-value -- before
        trying to average to get a "loudness". If you are trying
        to get the "Sound Pressure Level" -- how loud the sound is at
        any particular time -- it's called "Envelope Following" in the
        good old days of signal processing. If you know any electronics,
        what you want to build is a diode or diode bridge, to rectify
        the signal, and a capacitor to filter, or average, it to a slowly
        varying DC value.

        MS

        Akankshu Dhawan 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 ?*

            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
            Tinyos-help@millennium.berkeley.edu 
<mailto:Tinyos-help@millennium.berkeley.edu>
            <mailto:Tinyos-help@millennium.berkeley.edu>
    https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
    --
    First they ignore you, then they laugh at you, then they fight you,
    then you win.
    - Mahatma Gandhi

    ----------------------------------------------------------------------

    _______________________________________________
    Tinyos-help mailing list
    Tinyos-help@millennium.berkeley.edu 
<mailto:Tinyos-help@millennium.berkeley.edu>
    https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iEYEARECAAYFAkr8e2AACgkQa1gn+vovozNg8ACfaJLQVdQFUlNJWg6GDBsQSqAj
    q+8An38HnQsg1iyeSx8odAGKFG5d3EFj
    =BE0Q
    -----END PGP SIGNATURE-----

    _______________________________________________
    Tinyos-help mailing list
    Tinyos-help@millennium.berkeley.edu 
<mailto:Tinyos-help@millennium.berkeley.edu>
    https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help




--
First they ignore you, then they laugh at you, then they fight you, then you win.
- Mahatma Gandhi
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to