Shop OBEX P1 Docs P2 Docs Learn Events
DTMF Generation and DTMF Detection — Parallax Forums

DTMF Generation and DTMF Detection

william chanwilliam chan Posts: 1,326
edited 2008-05-07 23:25 in Propeller 1
Hi,

How easy would it be to implement DTMF generation and DTMF detection code (using Sigma Delta ADC) on the propeller?
Would it be easier to implement than on the SX?

Thanks.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my

Comments

  • PraxisPraxis Posts: 333
    edited 2008-04-30 11:42
    Hi William,

    This should point you in the right direction;
    http://en.wikipedia.org/wiki/Goertzel_algorithm

    BTW do you have the Propeller Proto board & Plug in stock?

    Azlan
  • RaymanRayman Posts: 14,355
    edited 2008-04-30 19:05
    I've got a dual tone generator here:

    http://www.rayslogic.com/propeller/Programming/dac/dac.htm

    I think Paul Baker posted some kind of spectrum analyzer code a while ago for use with sigma-delta ADC.


    Those two things should do it, I think...
  • BTXBTX Posts: 674
    edited 2008-04-30 19:30
    @Rayman

    Is there any possibility that use your "ASM WAV Player" as a DAC, to play the samples captured by the MIC of the demo board ??
    Just like the "microphone to headphones demo" but using your asm code as a DAC....
    Unless only one channel, & unless only 8-12 bits sampled. Although thinking to use it, with an external 16 bits A/D.

    I tried to do this before but I can't, just using the Buffers[noparse]/noparse as an input for the samples.
    Sorry for OT for this thread.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-04-30 21:01
    Google is your friend here..

    Here's the touch tone wav files. With Rayman's player this should solve the output side.

    community.voxeo.com/library/audio/prompts/dtmf/index.jsp

    OBC

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

    Getting started with the Protoboard? - Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card? - PropDOS
    A Living Propeller FAQ - The Propeller Wiki
    (Got the Knowledge? Got a Moment? Add something today!)

  • william chanwilliam chan Posts: 1,326
    edited 2008-05-01 08:34
    Azlan,

    Both Propeller Protoboard and Propeller Plug is in stock at our office.
    How many pieces you need?

    Thanks everyone.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • nutsonnutson Posts: 242
    edited 2008-05-01 10:25
    Given the prop counters it seems easier to me to measure time between input signal zero crossings and decide on·the discrete frequency from that.
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-05-02 16:55
    nutson: that would be a lot simpler with a single tone. DTMF = Dual Tone Multiple Frequency, which results in a more complex waveform. Counting zero crossings may not get you what you want.· It may be necessary to use FFT.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • william chanwilliam chan Posts: 1,326
    edited 2008-05-03 02:47
    How difficult would it be to "port" the SX dtmf detection virtual peripheral to an object in the propeller?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • LeonLeon Posts: 7,620
    edited 2008-05-03 11:24
    Ken Peterson said...
    nutson: that would be a lot simpler with a single tone. DTMF = Dual Tone Multiple Frequency, which results in a more complex waveform. Counting zero crossings may not get you what you want. It may be necessary to use FFT.

    The previously suggested Goertezel algorithm is related to the FFT.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • RaymanRayman Posts: 14,355
    edited 2008-05-07 15:53
    BTX said...
    @Rayman

    Is there any possibility that use your "ASM WAV Player" as a DAC, to play the samples captured by the MIC of the demo board ??
    Just like the "microphone to headphones demo" but using your asm code as a DAC....
    Unless only one channel, & unless only 8-12 bits sampled. Although thinking to use it, with an external 16 bits A/D.

    I tried to do this before but I can't, just using the Buffers[noparse]/noparse as an input for the samples.
    Sorry for OT for this thread.

    I think this is very doable...· You may be able to store a second or two in hub ram if you acquire at 8 bits/sample and 8ksps...· I have a SPIN wav player that can play this sort of data stored in hub ram on my web site.

    But, if you want good quality, you will probably need to save to SD card.·

    Just be carefull with the data format...· 16-bit data is stored as two's compliment (or you can think of it as 7FFF being the baseline, 0000 being the minimum possible value and FFFF being the maximum possible value).· But, 8-bit data is strored a different way...
  • BTXBTX Posts: 674
    edited 2008-05-07 16:09
    Thanks so much Raymond for the answer !!
    I will try your suggests.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • RaymanRayman Posts: 14,355
    edited 2008-05-07 23:25
    you could start by just saving to the sd card as a .wav file. see my apps for notes on the header format...· then, you can test the wav's out on a pc...
Sign In or Register to comment.