A simple Jupyter Notebook file that generates and plays DTMF (Dual-Tone Multi-Frequency) tones - the sounds produced when dialing numbers on a telephone keypad.
This project was originally written many years ago, but I decided to open-source it as I have no real use for this, and it's pretty much completed.
- Generates DTMF tones using the standard frequency pairs
- Supports digits
0–9,*, and# - Plays the generated audio directly in the notebook
Each digit is represented by two sine waves:
- One low-frequency tone
- One high-frequency tone
These tones are summed and played sequentially with short pauses between digits.
- Python 3
- numpy
- Jupyter Notebook (or Google Colab)
Install locally:
pip install numpy
- Open the notebook
- Edit the number:
DIAL_NUMBER = "01234567890" - Run all cells
- The sound will output the inputted number in
DIAL_NUMBERas a DTMF tone.
You can adjust:
- Sampling rate
- Tone duration
- Pause duration between tones
Example:
SAMPLING_RATE = 48000
SIGNAL_DURATION = 0.075
PAUSE_DURATION = 0.05This software is licensed under the Unlicense.