Example Code

Decode Touch Tone Phone System DTMF Signals

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Overview

This VI reads from an Analog Input of DAQ card, analyzes the signals and parses the prominent frequencies into equivalent DTMF Signals.

Description

Touch Tone phone systems use Dual-Tone Multi-Frequency signals to transfer user keystrokes across the phone system.  This example shows how to decode these signals using a multifunction DAQ analog output.  This will allow you to decode phone numbers using any DAQ board that supports hardware-timed analog input. The VI creates an Analog Input task, reads data from it in user specified chunks, filters, and analyzes the information into the appropriate key that the DTMF tone corresponds to. Screenshots of the front panel and block diagram can be found below.

Requirements

  • Software
    • LabVIEW 8.0 or compatible
    • DAQmx 8.0 or compatible
  • Hardware
    • NI DAQ card with Hardware-Timed Analog Input

Steps to Implement or Execute Code

  1. Download or copy the code into a VI
  2. Connect a DTMF signal to an input on your DAQ device
  3. Run the VI and watch the Key indicators as they show what buttons were pressed

Additional Information or References

The decoder algorithm uses an FFT to isolate input frequencies.  This algorithm uses a threshhold to determine when a valid keystroke has occurred.  This algorithm is not optimized and currently decodes signals slower than a user can input them on a standard keypad.  The max decode rate is around one number per 700ms.  Input rates faster than this are simply not decoded.  This means this example can be used as is with slowly typed numbers.  Optimizing this code would require increasing the dB of interest threshhold, which would allow you to decode data faster at the expense of rejecting incorrect frequencies.  The principals of this example are correct, but the time has not been spent to optimize for faster dialing.

Front Panel.png

Block Diagram.png

**This document has been updated to meet the current required format for the NI Code Exchange.**

-John Sullivan
Problem Solver

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors