This discussion is archived
5 Replies Latest reply: Oct 20, 2010 2:03 PM by 801390 RSS

check sample array

801390 Newbie
Currently Being Moderated
Hi guys,
i develop a babyphone for my mobile. I use the microphone for short capturing and I have to check it.
I get a ByteArray and I convert it to sample array:

public String transformTon ( byte[] SoundArray ){
String s1="";
String s2="";
String strSampleHex="";
String strSample="";
int intSample=0;
for (int b = 0; b < SoundArray.length-2; b+=2){
s1= Integer.toString( ( SoundArray[b] & 0xff ) + 0x100, 16).substring( 1 );
b++;//if 1 channel
b++;//if 2 channels
System.out.println("Byte 2 : " + SoundArray);
s2= Integer.toString( ( SoundArray[b] & 0xff ) + 0x100, 16).substring( 1 );
strSampleHex= s2+s1; //or s1+s2
intSample=Integer.parseInt(strSampleHex,16);
strSample+=Integer.toString( intSample) + ";";
}
return strSample;
}
I recorded 3 seconds: 2 seconds of silent and 1 second of scream .With Excel I could print this sample array:



Uploaded with ImageShack.us

So, how can I find out that I screamed? Please help me.

PS: sorry for my English, that is not my native language.
  • 1. Re: check sample array
    800537 Newbie
    Currently Being Moderated
    Hi,
    if your array contains Amplitude only,
    I think you can create a sense line.low sound: low numbers such as 50, medium Sound such as 100 and high Sound such as 150. if numbers greater than 150 you can set is as a scream.
    Use a Loop and a "if" to check your array.
    example:
    for(i=0;i<YourArray.lentgh;i++)
    if(YourArray>150){
    //Your Codes

    }

    if your array contains Frequency only,
    Create sense line For freq,low freq: low numbers such as .....
    screams or women have high freq.

    if your array contains Frequency and amp,
    Create a sense line for Amp only.


    I hope that these will be useful.

    Edited by: Msba on Sep 30, 2010 12:46 AM
  • 2. Re: check sample array
    DarrylBurke Guru Moderator
    Currently Being Moderated
    Moderator advice: Announcements at the top of the forum listing are there for a purpose. Please read the announcement and edit your posts accordingly.

    db
  • 3. Re: check sample array
    801390 Newbie
    Currently Being Moderated
    Hi, Msba!

    If I am doing like you said, so should my babyfone report that the baby is crying. Look at the picture. I screamed only at the end of the recording. The graphic should increase only at the end. Then I would do as you have proposed.
  • 4. Re: check sample array
    800537 Newbie
    Currently Being Moderated
    If your work is supersensitive,You can use signal processing(DSP) or simple signal processing.simple process don't need high CPU.
    Electronic scientists use this for listening of robots.(in high grade of this science)
    if you don't know this you can learn it ,this is not easy and this is not hard !

    Search the INTERNET : "audio or signal processing tutorial" pdf , book .

    don't forget:screams usually have low band-witch.(low variance in frequency)

    Good-luck.
  • 5. Re: check sample array
    801390 Newbie
    Currently Being Moderated
    Hi, thanks for your tip.

    The problem is, the phone codes the record to the AMR format.
    My professor has meant that I first have to decode AMR.
    This is not so simple.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points