Results 1 to 12 of 12

Thread: Tone recognition help please

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    UK
    Posts
    123

    Tone recognition help please

    Ok here goes!

    I have a piece of hardware that stores an ID, this ID can be from 000 to 128. To find out what the ID has been set to, the hardware sounds out 3 tones through its internal speaker. What I am trying to do is write some software that would listen to these tones via a pc microphone and display the ID on the screen.
    The hardware uses it's internal oscillator to produce these tones and the only information I know at the moment is -

    (8861.5 / 4 = 2215) Tone for ID 0
    (8861.5 / 5 = 1772) Tone for ID 1
    (8861.5 / 6 = 1476) Tone for ID 2
    (8861.5 / 7 = 1265) Tone for ID 3
    (8861.5 / 8 = 1107) Tone for ID 4
    (8861.5 / 9 = 984) Tone for ID 5
    (8861.5 / 10 = 886) Tone for ID 6
    (8861.5 / 11 = 805) Tone for ID 7
    (8861.5 / 12 = 738) Tone for ID 8
    (8861.5 / 13 = 681) Tone for ID 9

    Each cycle of tone needs to be at least 16 cycles long

    I have looked at CVMichael's code for DTMF Tone Recognition which is very advanced and would like to know if it could be modified to do something like this.

    When I have this part working I would then like to sound the above tones out of the PC speaker. This way I could set the Hardware's ID.

    I have been using VB for a few years now and still learning!, but never touched Directsound mainly serial communications stuff, so any help with this would be great.

    Thanks all...

  2. #2
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Tone recognition help please

    Can you record some IDs and post the wave files here ? (don't record too long, cuz you won't be able to attach the file(s))

    Record the wave files at 16000 Hz, 16 Bit, Mono

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    UK
    Posts
    123

    Re: Tone recognition help please

    Here we go... Hopefully they are attached.

    Thanks
    Attached Files Attached Files

  4. #4
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Tone recognition help please

    Right now I'm at work (and I can't download anything, the proxy here blocks downloads), I don't know if I will have time after work, and I know for sure I won't have time tomorow. But I will most likely have enough time for this in the weekend, so expect a reply from me either later today or in the weekend...

    Anyways... there are 4 ways that I can think of to detect a frequency, but I have to see the wave files to make a decision on what is the best way.

    Here are in order of difficulty:

    1) Calculate the time diference between the start of the impulse and end, (and maybe make an average on all the sound), then calculate what frequency it is by the time it took.
    2) Use the code here: http://www.vbforums.com/showpost.php...6&postcount=18 posted by rm_03 to detect each of the 10 frequencies.
    3) Use my Tone Recognition program to detect by pattern.
    4) and last one: FFT (Fast Fourier Transform), but this is too difficult and too much work for something simple (like what you need)

    Anyways... I'll check it out, and i'll get back to you.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    UK
    Posts
    123

    Re: Tone recognition help please

    Thanks CVMichael for you reply, just finished work here!

    No problem about time, just pleased that you have some ideas and that you can help.

    Just going through some of your posts regarding sound and trying to understand some more.

    Anyway, I look forward to hearing from you and how you get on.

    Thanks again..

  6. #6
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Tone recognition help please

    Hi Adrian26,

    You said that your hardware generates those tones, I just find it unusual that in each wave file, there is only one frequency ?

    Or is that because you edited the files and separated the frequencies ?

    I was expecting to see, for example if ID was 035, then I would expect the wave file to be something like this:
    2215 Hz
    1265 Hz
    984 Hz

    And probably there is a space in between the "beeps" and each been has a certain duration ?

    Anyways, can you explaing how exactly is playin the sounds ? (what order, and durations maybe ?)

    Or if you could record the actuall thing ?

    Again.. I'm saying this because the wave files you posted, they all have only one frequency, from beginning to end of the file... (actually I did not look at all the files)

  7. #7

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    UK
    Posts
    123

    Re: Tone recognition help please

    Hi CVMichael,

    Sorry for the late reply, The attached tones were just samples of each frequency used to make up the ID, I didn't record them from the hardware, I generated them myself. They are however the exact frequencies that the unit produces for each part of it's ID.

    You are exactly right with the tones & sequence, I will try and explain a little more. When I request the ID from the unit, I firstly sound two tones out of the PC speaker(a request I suppose), these tones are 16 cycles of (8861.5 / 3 = 2953hz) and then 16 cycles of (8861.5 / 30 = 295hz) no delay in between. That bit is the easy part...I think!. When the unit detects those two tones it replies by sounding out it's ID through its internal speaker like you stated for ID 035 but it could be any ID from 000 to 128 hence the attached tones 0 to 9 -

    2215 Hz = 0
    1265 Hz = 3
    984 Hz = 5

    There is about 0.5sec of silence/space between each tone, But if it helps, this silence/space could be changed to be another tone different from the one's used for the ID's.(I know the guy who wrote the units firmware!) This way the software would know that the next part of the ID is going to be sounded, if you know what I mean -

    2215 Hz = 0
    seperator tone
    1265 Hz = 3
    seperator tone
    984 Hz = 5

    The length of each individual ID tone is about 16 cycles long.

    The way I see it is that if the software detected a 2215 hz tone it would display a 0 on the screen, 1265hz a 3 and a 5 for 984hz etc very very similar to your DTMF program.

    I hope this helps a little more, I’m not the best at explaining things.

    Thanks
    Last edited by Adrian26; Mar 23rd, 2007 at 05:43 PM.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    UK
    Posts
    123

    Re: Tone recognition help please

    CVMichael, did you get a chance to have a look at this for us? I'm still stuck

    Thanks

  9. #9
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Tone recognition help please

    I'm still working on it... I was more buys than I expected. What I have until know it only recognizes one frequency at one time, I have to make it detect when the frequency changes, then detect the changed frequency.

  10. #10
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Tone recognition help please

    Here's what I have until now... I am quite busy latelly, so I thought to give what I have, so that you can take a look, and learn from it.

    I don't know when I will have time to finish it. (maybe you can do it yourself after you lean what I gave you until now ?)
    Attached Files Attached Files

  11. #11
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Tone recognition help please

    Hi Adrian,

    Did you understand anything in the project ?

    Can you figure out the rest ?

  12. #12

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    UK
    Posts
    123

    Re: Tone recognition help please

    CVMichael,

    Thanks for the project and your time with this, I have had some serious problems with my pc so I've only just got it.

    Will have a look now..

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width