DTMF Presentation

30
+ Decoding DTMF Telephone Touch Tone Signals By: Thomas Berschauer Charles Wolfenden

Transcript of DTMF Presentation

Page 1: DTMF Presentation

+ Decoding

DTMF Telephone Touch Tone

Signals

By:Thomas BerschauerCharles Wolfenden

Page 2: DTMF Presentation

+Overview History

DTMF Signaling Explanation

Alternative Applications

Experiment Objectives

FIR Filter Explanation

Thomas Berschauer’s Experimental .m Files

Thomas Berschauer’s Experimental Results

Charles Wolfenden’s Experimental .m Files

Charles Wolfenden’s Experimental Results

Conclusion

Page 3: DTMF Presentation

+History

Prior to DTMF, numbers were dialed by means of pulse dialing (DP) or loop disconnect (LD) signaling

Rotary dials were invented to eliminate need for operators and to automate the switching required to get from a caller to a receiver Generates pulses on the local loop by opening and closing

an electrical switch when the dial is rotated and released Similar to flicking a light switch on and off

Snyder, Gordon F. "Telephone Set Function 2." Gordon's Information and Communications Technologies (ICT) Blog. N.p., 22 Aug. 2011. Web. 30 Oct. 2012. <http://www.gordostuff.com/2011/08/telephone-set-function-2-to-provide.html>.

Page 4: DTMF Presentation

+History Multi-frequency signaling (MF) was developed for signaling

between switching centers MF signaling methods use a mixture of two pure sine wave

sounds Was used by the telecoms to route long-distance calls

DTMF stands for “dual-tone multi-frequency” Developed so consumers could signal their own destination

telephone number instead of talking to a telephone operator

DTMF's frequencies differ from all of the pre-existing MF signaling protocols

DTMF was known throughout the Bell System by the trademark “Touch-Tone” Was introduced to the public on November 18, 1963, when the

first push-button telephone was made available to the public.Sadler, Charlene. "Time to Retire Touch-tone Fee: Researcher." CBCnews. N.p., 02 Feb. 2010. Web. 30 Oct. 2012. <http://www.cbc.ca/news/story/2010/02/02/consumer-touch-tone-service-bell.html>.

Page 5: DTMF Presentation

+DTMF Signaling The DTMF system uses eight different frequency

signals transmitted in pairs to represent 16 different numbers, symbols and letters

Keypad is laid out in a 4×4 matrix

Pressing a single key (such as '1' ) will send a sinusoidal tone for each of the two frequencies (697 and 1209 Hz)

The multiple tones are the reason for calling the system multi-frequency.

Tones are decoded by the switching center to determine which key was pressed.

"Technical Information on the DTMF Tones." Western Electric Touch Tone. N.p., n.d. Web. 30 Oct. 2012. <http://www.porticus.org/bell/telephones-technical_dials-touchtone.html>.

Page 6: DTMF Presentation

+Alternative Applications Indicating start and stop times of local commercial

insertion points during station breaks Until better equipment was developed in the 90s, fast,

unacknowledged, and loud DTMF tone sequences could sometimes be heard during the commercial breaks

U.S. military used the letters, relabeled, in their now defunct Autovon phone system Used before dialing the phone

in order to give calls priority Levels of priority available were

Flash Override (A), Flash (B),Immediate (C), and Priority (D), with Flash Override being the highest priority

Lexlexlex. “Western Electric Model 66A3A DTMF ("Touch Tone") Keypad Showing Additional Feature Buttons for the Autovon System" File:66a3aDTMFpad.jpg. N.p., 22 May 2002. Web. <http://commons.wikimedia.org/wiki/File:66a3aDTMFpad.jpg>.

Page 7: DTMF Presentation

+Alternative Applications

Tones can be heard at the start or end of some VHS tapes Encoded tone provides info to

duplication machines, such as format, duration and volume levels, in order to replicate the original video as closely as possible

Greenstein, Shane. "Richard Rosenbloom, in Memory." Virulent Word of Mouse. N.p., 27 Oct. 2011. Web. <http://virulentwordofmouse.wordpress.com/2011/10/27/richard-rosenbloom-in-memory/>.

Possible to transfer Binary code (including ASCII text messages) using DTMF Assume that E is equal to * and F is equal to # Two subsequent DTMF tones are enough to

transfer whole byte of data or 8-bit ASCII character

Page 8: DTMF Presentation

+Experiment Objectives

To generate and decode signals similar to those used by analog touch tone telephones

Page 9: DTMF Presentation

+Experiment Objectives

Divide signal into shorter time segments representing each key pressed

Determine which two frequencies are present in each segment

From the two frequencies, determine which keys were pressed

Reconstruct the dialed phone number

DTMFdial, DTMFscor, DTMFdeco, DTMFmain

Page 10: DTMF Presentation

+DTMFdial.m

Implementation of a DTMF dialer

Function input: [3 3 8 3 9 4 7]

Input and output is a vector

Each key pressed was sampled at 8 kHz

Duration of each key press is 0.5 sec followed by 0.1 sec silence

Sound(dtmfdial([3 3 8 3 9 4 7]), 8000)

Page 11: DTMF Presentation

+DTMFscor.m

Binary output determining the presence or absence of a specific frequency

Input is a short segment from a DTMF signal

Implementation of FIR bandpass filter (convo function)

Filter constructed with sinusoidal impulse responses:

L: filter length, : frequency location of passband, n: number of samples, : sampling frequency

Page 12: DTMF Presentation

+FIR – Finite Impulse Response Bandpass Filter

Page 13: DTMF Presentation

+DTMFdeco.m

Utilizes DTMFscor to determine which key was pressed

Returns the key number corresponding to the DTMF waveform

Page 14: DTMF Presentation

+DTMFmain.m

Combines DTMFscor and DTMFdeco within DTMFmain

First divides signal so each segment can be sent to DTMFscor and DTMFdeco

Use DTMFdial to test>> dtmfmain(dtmfdial([3 5 4 3 4 4 1]))

ans =

3 5 4 3 4 4 1

Signal_a.wav

Signal_b.wav

Signal_c.wav

Page 15: DTMF Presentation

+DTMFdial.m – Thomas Berschauer

function play = dtmfdial (button)

dur = 0.5; sil = 0.1; fs = 8000;

t = 0:(1/fs):dur;

tt = 0:(1/fs):sil;

play = [];

for i = 1:length(button);

Page 16: DTMF Presentation

+DTMFdial.m – Thomas Berschauer

if button(i) == 1

f1 = 697;

f2 = 1209;

elseif button(i) == 2

f1 = 697;

f2 = 1336;

elseif button(i) == 3

f1 = 697;

f2 = 1477;

Page 17: DTMF Presentation

+DTMFdial.m – Thomas Berschauer

elseif button(i) == 0

f1 = 941;

f2 = 1336;

elseif button(i) == '#'

f1 = 941;

f2 = 1477;

end

Page 18: DTMF Presentation

+DTMFdial.m – Thomas Berschauer

x = sin(2*pi*f1*t); %signal of 1st freq

y = sin(2*pi*f2*t); %signal of 2nd freq

z = [x+y]; %combine signals

pause = sin(2*pi*0*tt); %signal of pause/silence

play = [play,z,pause];

%add vector play to itself w/ pause

end

end

Page 19: DTMF Presentation

+DTMFscor.m – Thomas Berschauer

function ss = dtmfscor(xx, freq, L, fs)

if (nargin < 4), fs = 8000; end;

n = 0:L;

hh = (2/L)*cos(2*pi*freq*n/fs);

ss = (mean(conv(xx,hh).^2)>mean(xx.^2)/5);

end

Page 20: DTMF Presentation

+DTMFdeco.m – Thomas Berschauer

function key = dtmfdeco(xx,fs)

if dtmfscor(xx,697,L,fs) == 1

if dtmfscor(xx,1209,L,fs) == 1

key = 1;

elseif dtmfscor(xx,1336,L,fs) == 1

key = 2;

elseif dtmfscor(xx,1477,L,fs) == 1

key = 3;

end

Page 21: DTMF Presentation

+DTMFdeco.m – Thomas Berschauer

elseif dtmfscor(xx,770,L,fs) == 1

if dtmfscor(xx,1209,L,fs) == 1

key = 4;

elseif dtmfscor(xx,1336,L,fs) == 1

key = 5;

elseif dtmfscor(xx,1477,L,fs) == 1

key = 6;

end

Page 22: DTMF Presentation

+DTMFmain.m – Thomas Berschauer

function keys = dtmfmain(xx)

keys = [];

for i = 4802:4802:length(xx)

if i == 4802

keys = [keys,dtmfdeco(xx(1:i))];

elseif i > 4802

keys = [keys,dtmfdeco(xx((i-4802):i))];

end

end

Page 23: DTMF Presentation

+DTMFmain.m – Thomas Berschauer

if length(xx) < 30000

for i = 4500:5000:length(xx)

if i == 4500

keys = [keys,dtmfdeco(xx(1:i))];

elseif i > 4802

keys = [keys,dtmfdeco(xx((i-1500):i))];

end

end

else

Page 24: DTMF Presentation

+Results – Thomas Berschauer

>> dtmfmain(wavread('Signal_a'))

ans =

1 3 1 0 3 3 8 3 9 4 7

>> dtmfmain(wavread('Signal_b'))

ans =

1 3 1 0 3 3 8 3 9 4 7

>> dtmfmain(wavread('Signal_c'))

ans =

8 3 9 4 7

Page 25: DTMF Presentation

+DTMFdial.m – Charles Wolfenden

fs = 8000 %Sampling ratet1 = 0:1/fs:0.5 %Duration of tonet2 = floor(0.5:1/fs:0.6) %Duration of silencet = [t1 t2] for n = 1:length(keyNum) %Establish button frequenciesif keyNum(n) == 1 f1 = 697 f2 = 1209;...f1 = sin(2.*pi.*f1.*t); %Generate frequency 1f2 = sin(2.*pi.*f2.*t); %Generate frequency 2f = [f1+f2] %Combine the two frequenciesdtmfdial = [dtmfdial,f]; 

• Executed with command: dtmfdial([‘# to dial’]),8000)

Page 26: DTMF Presentation

+DTMFdeco.m – Charles Wolfenden % Length of Band Pass Filter:

% L can be increased to produce a more narrow bandpass filterL = 128;filt_n = 0:L-1;digilength = length(encodedTones)/(tonelength+silencelength);for deco_seq = 1:digilength

%Segmentingstartpos = (deco_seq - 1)*(tonelength + silencelength) + 1;endpos = startpos + tonelength - 1;encstr_frag = encodedTones(startpos:endpos);

% Loop through each column and check if the column-i frequency exists in the signal for i = 1:4 % Calculate filter coefficients for the bandpass filter for column frequencies given the center frequency hh = 2/L*cos(2*pi*colfreq(i)*filt_n/fs);ss = mean(conv(encstr_frag,hh).^2) > mean(encstr_frag.^2)/5;if (ss)col = i;break %now have the column

numstr(1,deco_seq) = key(row,col);

Page 27: DTMF Presentation

+DTMFmain.m – Charles Wolfenden

rowfreq = [ 697 770 852 941]; % frequency components for each rowcolfreq = [1209 1336 1477 ]; % frequency components for each column key = [ '1' '2' '3' ; % Define the telephone keypad as a 2d matrix '4' '5' '6' ; '7' '8' '9' ; '*' '0' '#' ]; fs = 8000; % Sampling Frequency tonelength = round(fs*0.5); %Convert length from seconds to samples silencelength = round(fs*0.1); %Convert length from seconds to samples

%Return The Decoded Tones

Decoded_Digits = dtmfdeco(encodedTones);

Page 28: DTMF Presentation

+Results – Charles Wolfenden

Executed by command dtmfmain(wavread('Signal_x.wav')) where x is ‘a’ ‘b’ or ‘c’

Signal_a.wav Encoded tone: 13103383947 Decoded tone: 13103383947

Signal_b.wav Encoded tone: 13103383947 Decoded tone: 13103383947

Signal_c.wav Encoded tone: 83947 Decoded tone: 8347 or 888394447

Page 29: DTMF Presentation

+Conclusion

History

DTMF and Alternative Applications

Experiment Objectives

FIR Filter, Filter Length

DTMF m-files

Results

Page 30: DTMF Presentation

+Questions?