PDS - DTMF Detection PDF

Title PDS - DTMF Detection
Author John Javier Soledispa
Course Processat Digital del Senyal
Institution Universitat Politècnica de Catalunya
Pages 5
File Size 438.5 KB
File Type PDF
Total Downloads 33
Total Views 130

Summary

Informe laboratorio...


Description

> REPLACE THIS LINE WITH YOUR PAPER IDENTIFICATION NUMBER (DOUBLE-CLICK HERE TO EDIT) <

1

Simulation of acoustic echoes (December 2017) Authors, John Javier Soledispa and Krunal Ratan Badsiwal, Members, UPC EETAC.

Abstract— This document gives you guidelines for preparing a Dual Tone Multi-Frequency (DTMF) Detection. Specifically, a DTMF keypad. The main purpose of this practice is knowing how to use Discrete Fourier Transform with the objective of carry out the DTMF for detecting two tones in a signal X. Index Terms— MATLAB, DTMF, sinusoidal frequency, digital frequency, sampling rate, zero padding, DFT, key number.

II. PREVIOUS STUDY A. Background study question 1 and 2: Which is the mathematical expression corresponding to the DFT of a sinusoidal signal of period N and length a·N samples? Plot the DFT of this sinusoidal signal.

I. INTRODUCTION

I

N this practice, we have to use the Dual-tone multifrequency standard system. To begin, we are given a scheme of a telephone equipped with the following keypad.

Where, for there are two different cases that we should be considered: when α is an integer and when it’s not an integer. Like in the following two cases: • Case 1

Fig.1. DTMF Keypad

Each key represents the sum of a pair of tones. One tone is from the group between 1 KHz and 2 KHz, and the other one is from the group below 1 KHz. The frequencies are supposed to fit with the DTMF, so they can be distinguished as the signaling tone.

We strongly recommend reading the following concepts to have clear the ideas about DTMF detection to then be able to follow the development.

Fig.2. DTMF of a signal for α integer

> REPLACE THIS LINE WITH YOUR PAPER IDENTIFICATION NUMBER (DOUBLE-CLICK HERE TO EDIT) <

• Case 2

Fig.3. DFT of a signal for α not an integer

The mathematical expression is the following:

𝑋(𝑘) =

𝑎𝑁 (𝛿 𝑘 − 𝑎 + 𝛿(𝑘 − 𝑎(𝑁 − 1)))) 2

For k ∈ |0, aN-1|

Fig.4. DFT of a sinusoidal signal

2

> REPLACE THIS LINE WITH YOUR PAPER IDENTIFICATION NUMBER (DOUBLE-CLICK HERE TO EDIT) <

3

III. DEVELOPMENT First of all, the file which have worked is N.1.MAT, then, we loaded it in Matlab. This file serves to get the sample signal x that is displayed in the Fig.5. To see the sample signal, we have to use the command Matlab: plot(x). Fig.6. Code to see the modulus signal in Matlab

Fig.5. Signal x though n samples

As we can see, this signal has a length of 1024 values approximately (which the first 1000 of them have been plotted to fit in the right scale). In order to get the duration of the signal, we apply the next formula:

And to see the modulus, we have to implement abs to the function to plot it.

From this signal we can get different parameters: • N = Length of this signal = 1024 samples. • Fs = Sampling rate fs = 8Khz (obtained from the wording). So now, we can apply it in the formula:

With the command wavplay (x, fs) it is impossible to listen it, so we used the sound (x, fs) command to listen it. In order to obtain the discrete Fourier transform (DFT) we have to use function. The function that we are going to use is: y = fft (x, N) It returns the n-point DFT, where n is the size of x. To see the modulus, we apply to the signal the following code and implement the abs to the function:

Fig.7. Modulus of the DFT transform of the signal x(n) without zero padding.

As you can see, the peeks are not the same, this is why we put on the zero padding, for increasing the frequency resolution with more samples and thus to have the same amplitudes in the plot. N = 1024  N’ = 1024 x 4 = 4095; Once that’s done, the modulus of the DFT should plot it, like in the following Fig.8.:

> REPLACE THIS LINE WITH YOUR PAPER IDENTIFICATION NUMBER (DOUBLE-CLICK HERE TO EDIT) <

Fig.8. Modulus of the DFT transform of the signal x(n).

The two double delta functions that appear in the DFT corresponding to the two different sines that the signal is composed of. In fact, due to the fact that this signal has had a finite duration the original signal of two pure and infinite sines has been multiplied by a pulse in time, which, in the Fourier domain, corresponds to a sinc. If we observe the previous plot in a different scale, we can distinguish the local peaks of the function, like in the Fig.9.

Fig.10. MATLAB code to find local maximums of x (k= and store them in the variable k

The values obtained are the following: • Pos1 = K1 = 685 • Pos2 = K2 = 483 Note: We also can take it with the next formula:

and

by isolating the k.

The digital frequencies (Ωi) corresponding to detected the two tones can be calculated with the following formula:

Ω1 = 685

2·𝜋 = 1.0507 2 · 2048

Ω2 = 483

2·𝜋 = 0.7409 2 · 2048

Where all these values are in radians. Fig.9. Detailed view of DFT transform domain.

By finding the DFT positions for each one (returning to Fig.8.) of the four DFT peaks, we have used the max function. [M, P] = max (abs(y)) The function max has been used in such a way that two different outputs are obtained: the value of the maximum “M” and the position at which it is given within the vector “P”, each of them stored in different arrays.

Their analogue frequency corresponding to the previously obtained digital frequencies can be calculated with:

4

> REPLACE THIS LINE WITH YOUR PAPER IDENTIFICATION NUMBER (DOUBLE-CLICK HERE TO EDIT) <

If we check out in MATLAB, we can see that the f1 and f2 match perfectly. Note that k3 and k4 values, ergo f3 and f4, are the symmetric values of f1 and f2 respectively, so when subtracted to them the value of the sampling rate (8 kHz), f1 and f2 are obtained only. This’s why, in order to know the key that corresponds to those frequencies, we only have to select f1 and f2, that are very close to the frequencies of the key number 0 (941 Hz and 1.336 KHz). The amplitude of the DFT peaks we have stored in the variable maxim (as shown in Figure X.), whose values are: Val1 = 511.296 and Val2 = 509.139. Once knowing that, we have been able to find the amplitude values of the x signal by multiplying by 2 and dividing by N with zero padding, so we obtained 0.2497 and 0.2486. IV. CONCLUSION In this practice, a new mathematical tool has been introduced without having been previously commented on in the theory class. This fact, made us the practice harder to finding out something that we hardly knew. But, the background study given us the necessary theoretical means by which we have been able to conduct the lab session successfully. In this experiment, we could test the system of DTMF and how to implement the theory learned in class of discrete Fourier transform in the realization of the practice. We would also like to conclude that the DFT is very useful in digital signal processing as it is a sampled function in the domain of frequencies (discrete transform) it enables conducting operations with software tools more easily.

V. REFERENCES MATLAB Help: https://es.mathworks.com/help/matlab/ Atenea: http://atenea.upc.edu/

5...


Similar Free PDFs