Write a MATLAB program to create and output the touch-tone telephone signals (Dual-Tone, Multi-Frequency, DTMF) for the input numbers 0 through 9 (disregard the * and # symbols). When a user presses a button on a telephone set, a signal is produced that is the sum of two sinusoids with differing frequencies.


Telephone Touch-tone Frequencies

Write the program to prompt the user to input a number in the form 1-806-834-0144 or (806) 834-0144. The tones shall sound through the computer speaker.

Before you write a single line of MATLAB code …

Produce a flowchart that shows the step-by-step procedure you will use to produce the result you desire. Include the flowchart in a Word document.

Things to consider…

• What kind of program structure will you use to parse the input?
• How will the program discriminate between numbers and symbols?
• What kind of program structure will you use to produce the tones?
• How can you cause a “blank” to sound between each number?

A sinusoid is produced by sin(2π f t) where f is the frequency of the sinusoid.

How do I do such a thing?!

To accomplish this task in MATLAB, you can follow the following steps:

Step 1: Parse the user input
- Use MATLAB's input function to prompt the user to input a number in the specified format (1-806-834-0144 or (806) 834-0144).
- Extract only the digits from the input using regular expressions or built-in MATLAB functions like isdigit() or str2num().

Step 2: Define the DTMF frequencies
- Create a mapping between digits (0-9) and their corresponding dual-tone frequencies.
- Refer to the table provided to get the frequencies for each digit.

Step 3: Generate the DTMF tones
- Use the sine function in MATLAB to generate two sinusoids for each number, with frequencies corresponding to the pressed digits.
- Combine the two sinusoids by adding them together.

Step 4: Play the tones
- Use the sound function in MATLAB to play the generated tones through the computer speaker.
- Add a pause or silent period between each played tone to create a blank sound.

I hope this explanation provides you with a general guide on how to approach this problem in MATLAB.