Shop OBEX P1 Docs P2 Docs Learn Events
Speech Recognition for the Propeller: Collaborative Project?? - Page 3 — Parallax Forums

Speech Recognition for the Propeller: Collaborative Project??

135

Comments

  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-27 15:26
    Okey! Here is the I2C version that I wrote last night. It is sloppy, inefficient code, but I was in a rush to get it done. It does not save to the EEPROM, apparently, because the program will still load from the external EEPROM after it records the first sound sample.

    Wait! I just thought of what it is that's the problem! I have it overwriting itself in the same EEPROM locations in the repeat loops! blush.gif I love mid-posting thoughts!

    If that dosn't work I will still need help with it, and if it does, here it is anyway.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-08-27 16:31
    I noticed this the other night...

    On our repeat i from 0 to n loops, shouldn't we have an i++ ?

    I was too tired when I noticed it to deal with it.
    Haven't had a chance to get back to the code.

    Nice additions!

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • jazzedjazzed Posts: 11,803
    edited 2009-08-27 16:36
    Oldbitcollector said...
    ...
    On our repeat i from 0 to n loops, shouldn't we have an i++ ?
    Only if you want i to be i := i + 2 on every loop.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve

    Propeller Tools
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-08-27 16:45
    microcontrolled said...

    Wait! I just thought of what it is that's the problem! I have it overwriting itself in the same EEPROM locations in the repeat loops! blush.gif I love mid-posting thoughts!


    I'm not an EEPROM expert (prefer SD myself) but that looks exactly like what is happening..
    You must copy/paste blocks of code too.. [noparse];)[/noparse]


    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.

    Post Edited (Oldbitcollector) : 8/27/2009 4:50:16 PM GMT
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-27 17:30
    I have now written a program that writes speech samples to the Demo Board EEPROM. This program is made specifically for Hanno's 12 Blocks program.

    @Hanno: is a setup like this valid for 12 Blocks? You would have to run it first, using a TV, keyboard, and the Demo Board and then run the program that actually uses the Speech recognition program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-27 18:21
    This one is the same thing with some waitcnts removed for smoother recording, full documentation at the top, and; oh yeah, the voice samples now ACTUALLY FIT IN THE EEPROM!! rolleyes.gif
    Samples CON is changed to 5300 because with a 32k (32000 byte) EEPROM 5300 X 6 (6 voice samples) = about 32000. It should work now, still working on the program that uses it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-08-27 18:49
    Based on what I've seen of 12 blocks (video demo only), You should probably
    have it set to record a single sample, and provide controls for the pin that is
    toggled when the sample is matched, the EEPROM location of the sample, just
    like the accuracy and choke controls.

    This way the object is drug out in 12 block, and the user is given these four
    options to change in the block.

    Perhaps Hanno can provide some additional input as it exactly what will
    work for him. Take a look at the "12 blocks" section of this video to see what I mean.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-27 19:45
    Well, he said that it had to work with ether "1,2,3,4,5,6,7,8,9,10" or "right,left,up,down,yes,no". If it was just a single command then I wouldn't have much trouble creating it. However, I HAVE created a version that fits under his specs (exept that it takes up 500 bytes more then 15k) and can run from the EEPROM. I just finished writing it and have been having some problems. It detects your voice (needed for 12 blocks, so they can start talking whenever they want) and then records it but when it starts to extract the files form the EEPROM the screen goes crazy with lines and flickering (which stop after a few seconds) and a fuzzy sound comes out of the speaker. Does anyone know what is going on? Examine the code attached. I would greatly appreciate your help. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-08-27 19:53
    Remark this section of code:

          DIRA[noparse][[/noparse]10]~~                              'Set Right Pin to output
          DIRA[noparse][[/noparse]11]~~                              'Set Left Pin to output
    
          'Set up the counters
          CTRA:= %00110 << 26 + 0<<9 + 10         'NCO/PWM Single-Ended APIN=Pin (BPIN=0 always 0)
          CTRB:= %00110 << 26 + 0<<9 + 11         'NCO/PWM Single-Ended APIN=Pin (BPIN=0 always 0)   
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-27 20:23
    They aren't commented out, in fact, they are the same as you have them there. Or are you saying to adjust them?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-08-27 21:03
    No, I suspect they can be removed, but comment them out first..
    IIRC, these were for the sound playback over the speakers.

    I haven't had a chance to crack open the prop *yet* today, it
    been a crazy afternoon between work and kids. [noparse];)[/noparse]

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • CounterRotatingPropsCounterRotatingProps Posts: 1,132
    edited 2009-08-27 22:43
    From the sidelines watching, a comment:

    Microcontrolled - you are an amazing and inspiring young man!

    @Hanno - does he get a bonus prize for the speed at which he's done this? [noparse]:)[/noparse])

    - Howard

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • HannoHanno Posts: 1,130
    edited 2009-08-27 23:28
    I wasn't expecting anything for weeks! I'm just assembling all the pieces now, having some problems locating the right basic_i2c object that's compatible with your code- can someone help?
    Microcontrolled's code references an i2c object that takes 3 arguments for writebyte:
    ic.WriteByte(ic#EEPROM, $0000 + i, temp)
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-08-28 00:01
    Given proper motivation young people can accomplish ANYTHING. [noparse]:)[/noparse]
    (and it sounds like Hanno found the fuel to light under microcontrolled. [noparse]:)[/noparse]

    Speech Recognition this week, next week we need retinal scan.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-08-28 00:14
    I'd like to suggest one rule change, if I may: accept "niner" for "nine". It's hard enough sometimes for humans to distinguish "five" from "nine", and "niner" is accepted in radio communications.

    -Phil
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-28 00:58
    I commented them out and it didn't help a bit. I started experimenting and I found that if I switched around the
    byte[noparse][[/noparse]final+i] := temp
    

    to
    temp := byte[noparse][[/noparse]final+i]
    

    that it worked and went through the system. However, after it Extracted the first file then it went through the whole system in less then a second! I soon found that I had NOT declared that n := Samples! After correcting that it would go through the system UNTIL it got to where it told me what word I said. I worked with it a long while and I still don't know why it is like this. Can you help me find out what is preventing it from telling me? Thanks for all the help so far!

    Micro

    ADDED: I am putting on an SD card holder now, and it is connected to the Propeller...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-08-28 01:03
    Please zip up your all your objects and post.

    I'm having the same problem Hanno is having. My I2C driver doesn't handle your code.

    Thanks
    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-28 01:06
    Oh, I had that post sitting here on the computer for hours, and I just posted it, so I'm a little behind here....
    Ive been "chomping at the bit", as one would say, with this project. I get up early and do Math, then Reading for the majority of the time, then as soon as my last school assignment is done I head for the desk! At least today I got in a good 5 1/2 hours, yesterday we had to go out in the evening so I worked till 10 to get in a mere 3 hours! smile.gif

    @Hanno: My version should be standard, but sometimes if I download an object that uses it the object comes with one a little modified. I will get it up here soon for you.

    @OBC: ViewPort Ultimate makes me VERY motivated! smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-28 01:17
    Here is the folder with EVERYTHING in it. Be warned: I just zipped up the drivers and all files labeled "Speech Recognition" some may be uncompleted so only use the newest of any of them. The "003" uses the LED's as the indicator, "004" uses the TV_Text object (also in the folder). Hope you find them suitable!

    P.S. The one thing that I have not worked out yet that needs worked out (besides the thing I posted a while ago) is the fact that the EEPROM read is VERY SLOW and the write is EVEN SLOWER! The setup procedure takes almost 5 minutes to complete and the comparison between stored files take about 1 minute 30 seconds!!!! freaked.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • HannoHanno Posts: 1,130
    edited 2009-08-28 01:21
    Keep going microcontrolled!
    I've tried all the usual places to find an i2c driver that's compatible with the one you seem to be using- so yes, please zip up your complete project that'll make it easier for me and others to try what you've built. In the Propeller Tool choose "File/Archive" and upload that...

    Hmmm, retinal scanning doesn't excite me that much. It would be nice to flesh out the speech synthesis stuff that Chip has built. I think someone else had built their own as well? But first, please concentrate on "completing" this. I'm sure lots of other people will want to use speech recognition in their robots/projects. Would be wonderful if the code was somewhat documented, commented, came with samples and a demo video. None of this is part of the challenge- but please do it!

    And yes, feel free to make slight changes in the vocabulary to make recognition more robust. The Palm Pilot was successful because it required a bit of learning from it's users, but then with the Graffiti strokes provide very robust character recognition. Great idea to borrow from animal/military practices.
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-28 01:30
    @Hanno: My entire method has been to take several pre-recorded voices, convert them to digital, take a spoken command, convert IT to digital, take the library of pre-recoded voices and see which ones match best, and then declare that as the spoken word. To turn it to speech-synthesis or the like would take weeks just like everyone else who has attempted speech recognition. I am trying to simplify it and that is why I am going so fast. If I can find an efficient way to use Chip's objects then I will, but I just don't think that it would be memory efficient.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-08-28 02:00
    A thought...


    How about loading the samples once, then just repeating the compare..
    (See attached code)

    Won't speed the loading yet, but would help once everyone was in place..

    OBC

    (Every command is "left" at the moment..)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • HannoHanno Posts: 1,130
    edited 2009-08-28 02:20
    Had problems with my TV, so converted code to use the terminal object from ViewPort. I'm currently "saving" my "yes"....
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-28 02:23
    I'm on my Palm now, so I can't view the code, but is it under 15k? That seems to be the hardest thing about Hanno's requirements but if it wasn't under 15k you couldn't have much of a program now, would you?

    P.S. I have started working on a new "trigger word" tecnique that records constantly, moving the BYTEs allong byte by byte using bytemove. When a word is detected, it is checked with a preveously recorded word for a match. If it is a match, it changes a variable and lights a light. (the varible if Hanno ever wants it for his program, they seem to be easy to track)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-28 02:26
    @Hanno: Remember: that code isn't fully working yet. I am still haveing trouble with it recognizing the voice. The screen will not show what I said but will just leave a blank spot. I am still to discover what the problem is with it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • HannoHanno Posts: 1,130
    edited 2009-08-28 02:35
    Yup, just ran into that...
    I went through the process of training my voice and then tried twice to have it recognize what I said. At least it consistently gave me a "blank spot". Keep going, you're almost there. I do like your method- it's simple, but I believe it will achieve the challenge conditions once you slow down and give yourself a little bit of time.

    This will give us a good foundation to improve upon- first 6 words, then more.

    I have to run off for a while but I'll check in periodically.
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • hinvhinv Posts: 1,255
    edited 2009-08-28 02:36
    How about compression? I know it makes it a lot more complicated, but voice samples should be quite compressible. Has anybody done audio compression on the prop yet? If not then taking a tangent to get that done would delay things.
    I would go for SDcard first, but that is not standard on a demoboard.
    What is the sample size(in bits) and the sample rate?

    Do you have the option open that what was said doesn't sufficiently match any of the commands? I wouldn't my robot(or my children for that matter) to assume I said something that I didn't.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-28 02:38
    Well, here in eastern America, it's 10:30 PM! I'll be going to bed, see you tomorrow!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-08-28 03:03
    Once it listens as good as my teenagers, I'd say we have a winner.[noparse]:)[/noparse]

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-28 22:32
    OK, today I've been busy with everything exept my code. smile.gif

    I ran your code, but I don't understand it. It writes to the "final" byte array over and over so the extractions are simply overwritten. I don't see how it only gets "Left" but if I even whistle into it is says that I said "Left".

    I've put in about 1 hour 30 minutes into the program so far and I think I have the solution: I think that the problem is in the EEPROM write. I made a simple player that extracts the files from the EEPROM and plays them on the speaker. What comes out, no matter which one you extract, is a sound similar to that of one tapping on the microphone once. See what I mean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



Sign In or Register to comment.