Shop OBEX P1 Docs P2 Docs Learn Events
Need help with PhiPi's Goertzel_DTMF_Demo — Parallax Forums

Need help with PhiPi's Goertzel_DTMF_Demo

WossnameWossname Posts: 174
edited 2012-02-23 05:17 in Propeller 1
Regarding the Goertzel algorithm DTMF detection library (see the link in this post: http://forums.parallax.com/showthread.php?119568-Propeller-DTMF&p=876749&viewfull=1#post876749).

I've been wanting to add this feature to my current project but I'm having a bit of trouble converting the code to use an ADC chip instead of the Propeller Counter-based sigma/delta method that Phil used.

Basically all I've done is disable the Counter stuff and replaced the original "sample" subroutine with my own ADC code (which just reads a 10 bit value from the ADC chip on an SPI bus connection). The data being spat out of the serial port indicates that the algorithm seems to be functioning as a basic level but the actual values it produces are not a reflection of the actual audio I'm feeding in. It's definitely trying to give sensible output as the curve is a nice smooth polynomial and is very stable from one set of readings to the next (see the screenshot).

I suspect this is because there is a mismatch between what the algorithm expects to receive from the (old) ADC method and what it's actually receiving now I've mangled the code to get the dedicated ADC chip working. So the question is, how do I work out how to scale my 10-bit unsigned (0..1023) value to be compatible with Phil's algorithm.

That screenshot was generated from 697Hz+1209Hz (DTMF digit "1"), but the algorithm isn't reporting that. Clearly my ADC values need adjusting, but how I'm not sure.

My ADC spits out values between 480 and 540 (the audio is centred about +1.65 volts and has approx 200mv amplitude).

I realise this is hard to help with but any advice would be gratefully received.
776 x 431 - 69K

Comments

  • WossnameWossname Posts: 174
    edited 2012-02-16 02:21
    I wonder if Phil could have a look into this for me if he gets a moment.
  • lardomlardom Posts: 1,659
    edited 2012-02-16 05:35
    Thanks for the link to the demo. I just bought several adc chips which I'll use with multiple microphones and speech recognition. Phil's demo works great with the Parallax Demo board. I just ran it...amazing. I'm also studying Heater's FFT because I want to understand how this stuff works. So I can use the same information you're looking for.
  • WossnameWossname Posts: 174
    edited 2012-02-16 10:59
    This signal processing stuff is Really Hard. FFT and Goertzel algorithms seem to lose any semblance of understandability as soon as they are created in assembly code.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-02-16 11:19
    Wossname,

    If you'd like my help, please post all of your code, so I can see what you're doing.

    -Phil
  • WossnameWossname Posts: 174
    edited 2012-02-23 05:17
    Sorry for the belated reply. I've not had a chance to look at it this week.

    I can't really upload my code at the moment. There's a fair amount of in-development proprietary code surrounding your library. I'm looking into this Goertzel system as part of a proof-of-concept demo for work, (don't worry, the final product will be fully licence-compliant).

    Can you tell me what range of values you expect your "sample" subroutine to return? If I can craft my ADC's values into that range then perhaps I'll have more luck.
Sign In or Register to comment.