380 likes | 747 Views
“DTMF Generator". Texas Instruments University Programme Teaching Materials. DTMF Generator. Introduction. Touch tone telephones use Dual Tone Multi Frequency (DTMF) for dialling numbers When a keyboard button on a telephone is pressed, pairs of audio tones are generated
E N D
“DTMF Generator" Texas Instruments University Programme Teaching Materials
Introduction • Touch tone telephones use Dual Tone Multi Frequency (DTMF) for dialling numbers • When a keyboard button on a telephone is pressed, pairs of audio tones are generated • Click on the loudspeaker icon to hear the effect.
Objectives • To produce dual tones using sine wave generators • To generate the sequence of tones for a telephone number • To generate DTMF tones using the Texas Instruments TMS320C5505 USB Stick • To hear the results on headphones/computer loudspeakers.
Keypad Frequencies 1336 Hz 1209 Hz 1477 Hz 697 Hz 770 Hz 852 Hz 941 Hz
Design of DTMF Tones • The pairs of frequencies are defined by a precise tone plan • Harmonics and inter-modulation products do not cause the signal to be unreliable • The frequencies were initially chosen to have a ratio of 21:19, which is slightly less than a whole (musical) tone.
Choice of Frequencies • No frequency is a multiple (harmonic) of another • The sum of any two frequencies does not equal any of the other frequencies • The difference between any two frequencies does not equal any of the other frequencies.
Non-Musical Tones • The tones should not be musical frequencies such as: • 880 Hz, 1046 Hz etc. • The difference between tones should not be a musical interval e.g. third, fifth.
Frequency Tolerances • The frequencies may not vary more than ±1.8% from their nominal frequency • Frequencies outside this range are ignored by the receiver.
Twist • Ideally the amplitude of the low tone and the high tone should be the same • When transmitted along the telephone line, the amplitudes may be different • The difference in amplitude between the high and low frequencies can be as large as 3 dB. This is referred to as "twist“ • A difference of greater than 6dB may indicate a non-DTMF pair of tones.
Tone Duration • Each DTMF tone should last a minimum of 70 ms • Some countries use tones of duration 45 ms • In order to reliably catch a DTMF burst, 2-3 detection frames are required • Typically the detection frame is 22.5 ms.
Generating Sine Waves • To generate the sine waves, the C code uses the sine() function in DSPLIB. • The sampling frequency is 8000 Hz.
Change to Sinewaves.c • The original sinewaves.c used Fs = 48000 Hz • For Fs = 8000 Hz, the new scaling factor will be 2*32767/8000 = 8.192 • 8.192 = 0.51198 x 16 = 0.51198 x 24 • In Q15 format, 16776 represents 0.51198 • The frequency can be converted to angle using: angle = (frequency x 16776L) >> 11 ;
Setup TMS320C5505 USB Stick USB to PC Headphones
Installing the Application • Copy the code given in Application 14 DTMF Generator to the Workspace • Follow the steps previously given in Chapter 1 to set up the new project.
Changing the Phone Number • Replace the keyboard characters with your own sequence e.g. • char telephone_number[] = “0032-235-800 326";
Checking Generated Frequencies • The application also supports the letters PQRSTUVW. • These have been used to generate single test frequencies that are easier to measure: char telephone_number[] = “PQRSTUVW";
Monitor the XF LED Frequency • The single frequency can be measured on the XF LED using a frequency meter or oscilloscope.
Changing the Tone Durations • The duration of tones, gaps and redial delay can be adjusted.
Programming Challenge • Add the DTMF tones for the letters A, B, C and D: • A = 697 Hz + 1633 Hz • B = 770 Hz + 1633 Hz • C = 852 Hz + 1633 Hz • D = 941 Hz + 1633 Hz • You will need to modify DTMF.c in order to do so.
Saving to .wav file • The sequence of DTMF tones can be saved as a .wav file on a computer • To do this, use a cable to connect the headphones output to the soundcard input on the PC • The tones can then be played back for use as a signal for the Goertzel Algorithm example in Chapter 15.
Questions • What does the abbreviation DTMF stand for? • What factors must be taken into consideration when selecting DTMF frequencies? • What is meant by “twist”? • How long should the duration of a DTMF tone be?
References • Digital Signal Processing, A Practical Approach by Emmanuel C. Ifeachor and Barrie W. Jervis. ISBN 0201-59619-9.