Shop OBEX P1 Docs P2 Docs Learn Events
Real Time Goertzel Algorithm Object and DTMF Sensing Demo — Parallax Forums

Real Time Goertzel Algorithm Object and DTMF Sensing Demo

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
edited 2009-09-09 00:59 in Propeller 1
Here's a pre-OBEX copy of the Goertzel object I used for my speech recognizer. It comes with a DTMF demo that displays relative amplitudes at the DTMF frequencies on a TV screen and an Excel file that computes and plots power spectra for different settings of the algorithm coefficients.

-Phil

Post Edited (Phil Pilgrim (PhiPi)) : 9/5/2009 1:27:00 AM GMT

Comments

  • BradCBradC Posts: 2,601
    edited 2009-09-05 03:55
    I've been building a stroboscopic instrument tuner so I plugged this code in and told it to look for the freqs associated with a 6 string guitar. It does quite a passable job of detecting which string was plucked, although it has a bit of trouble with the harmonics from the bottom E & A. I'm still playing with the parameters, but it's quite flexible and pretty accurate [noparse]:)[/noparse]

    It probably does not help that I'm using an A/D on p0-7 of the Demo board, so the traces and connections have a lot of capacitance (the output from the A/D is *very* noisy).

    Nice one.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2009-09-05 06:53
    @BradC

    Re: instrument tuner.

    I was thinking the same thing. Maybe you could start a new thread.

    I will post the frequencies for the benefit of others:

    6 string guitar:

    E string (Big E) 82.4068892282 Hz
    A String 110.0000000000 Hz
    D String 146.8323839587 Hz
    G String 195.9977179909 Hz
    B String 246.9416506281 Hz
    E String (little E) 329.6275569129 Hz
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2009-09-05 06:59
    Unfortunately my Pedal Steel guitar uses a 10 string E9th chromatic tuning. I'll have to dig out my Washburn electric / acoustic and give it a shot. I can use my Peterson Strobe tuner to compare it to.

    www.petersontuners.com/index.cfm?category=37
  • BradCBradC Posts: 2,601
    edited 2009-09-05 08:24
    Bob Lawrence (VE1RLL) said...
    Unfortunately my Pedal Steel guitar uses a 10 string E9th chromatic tuning. I'll have to dig out my Washburn electric / acoustic and give it a shot. I can use my Peterson Strobe tuner to compare it to.

    www.petersontuners.com/index.cfm?category=37

    I've been saving for a Peterson, but it's just beyond my reach at the moment, thus I built this one [noparse]:)[/noparse]

    It does full 7 octave chromatic from A0->G6.

    There is quite a bit of error when using a straight waitcnt at the fundamental * 32 (32 led display) so I've built a 32 bit phase accumulator in there to dither the waitcnt +1 cycle as required. This has brought the accuracy down to a calculated 1.0 E-8 HZ. In practical terms is far more accurate than any piece of test gear I've got here can measure. That buys me the accuracy beyond 1/0th of a Cent that I needed to properly intonate my guitars.

    The frequency and remainder tables were calculated on my PC in 64 bit floating point and the tuner just references the tables for its value.

    Surprisingly the unit functions very well with the guitar directly connected to the A/D input. I've put a 741 on the board with 4x gain to clean things up a bit and make it easier for the detection algorithm, but it's not at all required.

    The note detection is quite quick (about 1/4 second to properly lock on) and then you just tune to the strobe. The TV displays the currently detected note. I had to slow the detection down a lot as it was having trouble with the low E and A harmonics.

    I've got a 22 fret neck, so D5 is my top note. There is very little sustain up that end of the neck and it can take an extra pluck or two to lock, but once it's locked you can get a decent indication on the strobe. Scary how the intonation varies fret to fret as you work up the neck. It all averages out in the end, but it's far from perfect!

    The Led display is 4 cascaded 74HC595's and all the LED cathodes are tied together and then fed to a 2N7000 fet via a single 220Ohm resistor.
    The A/D cog also does zero crossing detect and just activates the strobe output for anything positive of the average. It's not as good as an analogue stroboscope as it does not modulate the LEDs following the waveform properly so you miss some of the subtle harmonics, but then for about 10 bucks worth of bits (including the Prop) it's as accurate as any other commercially available high accuracy tuner [noparse]:)[/noparse]

    I only finished it a couple of hours ago, and I've just finished re-intonating 2 of my guitars with it. When I get it cleaned up, mounted and the code tidied up a bit I might publish it as a project somewhere.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
    920 x 772 - 412K
    2624 x 712 - 397K
    1520 x 1616 - 523K
  • KeithEKeithE Posts: 957
    edited 2009-09-05 16:50
    Brad,

    This is interesting. I was wondering what it would take to build a Peterson-like strobe tuner with a rotating disk and strobe. My application would be for tuning harmonica reeds. Do you know if Peterson does any conditioning of the signal before driving the strobe, or do they just strobe at zero crossings?

    -Keith
  • BradCBradC Posts: 2,601
    edited 2009-09-05 17:07
    KeithE said...
    Brad,

    This is interesting. I was wondering what it would take to build a Peterson-like strobe tuner with a rotating disk and strobe. My application would be for tuning harmonica reeds. Do you know if Peterson does any conditioning of the signal before driving the strobe, or do they just strobe at zero crossings?

    I don't know how the new digital and "virtual strobe" products work, but the old strobe tuners drive the lamp with a directly amplified version of the input signal.

    You could do the rotating disk I guess but you would need a *very* accurate control mechanism that can control the speed and phase of the motor to within about .001 of a HZ (for 1/10th of a cent in the 7th octave). Much easier / cheaper using leds [noparse]:)[/noparse] and provided you are not looking for partials or specific harmonics, just as accurate (probably moreso).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2009-09-05 17:25
    Inside a Peterson Tuner:


    Bigger Picture(External web site)

    robert.l.lawrence.googlepages.com/PTuner.JPG/PTuner-full.jpg
    200 x 150 - 11K
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2009-09-08 04:32
    Your project looks great. I'm always amazed at how well delta sigma ADC works with the Propeller.

    RE:A0->G6

    My open string tuning starts at F#4 - B2 but I also have 5 knee levers and 4 floor pedals that can raise or lower the pitch of a string. The overall range is A2 - A6 Still within your overall range burger.gif
  • KeithEKeithE Posts: 957
    edited 2009-09-09 00:24
    >When I get it cleaned up, mounted and the code tidied up a bit I might publish it as a project somewhere.

    Brad - have you thought about the 2009 Propeller Design Contest?
  • BradCBradC Posts: 2,601
    edited 2009-09-09 00:59
    KeithE said...
    >When I get it cleaned up, mounted and the code tidied up a bit I might publish it as a project somewhere.

    Brad - have you thought about the 2009 Propeller Design Contest?

    Not really. While I've done some fun stuff it's not really anything you can't do with another processor. There is really nothing unique to the Propeller, and certainly nothing that has the *wow* factor to impress judges.

    I'll let Phil have his thread back now [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
Sign In or Register to comment.