Reference no: EM132856883
DTMF Decoding
Project assignment
The project consists of 3 parts. There are 2 bonus parts (4th and 5th ) that are completely voluntary.
1. You should work on the project individually.
2. Please submit all your codes as well as a report (in .doc or .pdf format) where you describe your approach, your design decisions, any theoretical formulations, as well as show any graphics and analyses of your code. Do NOT include code as part of your report.
3. Your submission should include your MATLAB functions following the parameters defined in each part of the project. The code submitted should be fully debugged and only use built-in MATLAB functions (no third-party software or special MATLAB toolboxes.) Keep in mind your code will be tested using our own generated sequences. So, it should be fully automated and ready to analyze any unknown sequences of phone numbers. There are some implementations of DTMF available online, but they don't cover many aspects of our project. Make sure you develop your own code. Plagiarism will be severely punished.
4. Submit your project files on blackboard no later than 4/29/2021 at 11:59pm.
Part 1 - Encoding DTMF
First, we get ourselves more familiar with DTMF sounds. Using the frequencies given in the figure above, write a function DTMFencode.m with the following parameters:
[x,fs] = DTMFencode(key,duration,weight,fs)
|
Output
|
x
|
output sound waveform generated by pressing the corresponding key
|
|
fs
|
sampling rate in Hz
|
Input
|
key
|
a character corresponding to one of twelve possible keys (Figure 1)
|
|
duration
|
[optional argument] desired duration of the signal (default 200ms)
|
|
weight
|
[optional argument] 1x2 vector with desired weight of low and high frequency
component (default [1 1])
|
|
fs
|
[optional argument] sampling rate in Hz (default 8000Hz). Note: values below
3000Hz should not be accepted
|
Write and submit the code for DTMFencode
Generate the twelve possible digits with your choice of parameters and save each digits as an audio file named digitX.wav (X=1,2,...)
Provide in your report a plot of both the time-domain signals and Fourier transform magnitude of each digit. Make sure all axes are labeled properly.
Describe in your code how you checked that your code is running properly.
Part 2 - Decoding DTMF keys
Next, we focus on decoding an audio signal into the corresponding digit. Here, we assume our audio recording contains only one digit. Write a function DTMFdecode.m with the following parameters:
[key,fs] = DTMFdecode(filename)
|
Output
|
key
|
a character corresponding to one of twelve possible keys (Figure 1)
|
|
fs
|
The sampling rate in Hz
|
Input
|
filename
|
*.wav file that contains a single DTMF signal
|
Write and submit the code for DTMFdecode.
o Your code should work with any sampling rate above 3000Hz, any signal duration and any weighting of low and high frequencies.
o You should think of the best strategy to determine the DTMF values (time-domain, frequency- domain, energy over small frequency bins or a combination).
o Keep in mind that your code for Part 2 will be used in Part 4; it should be able to work well in noisy conditions. You can add other sounds (off the web) to your test signals to generate noisy versions of dialed keys in order to make sure your decoder is robust to noise.
o Generate audio files from Part 1 (with varying parameters) to test your DTMF decoder.
Describe in your report what strategy or strategies you use to decode the key. Choose for your report an example test-file and plots that describes how your decoder works on this example.
Part 3 - Decoding DTMF sequences
Next, we will deal with parsing a continuous recording of a person dialing a phone number. Here, the unknowns are the onset and offset of each key press as well as how many key presses there are. Write a function DTMFsequence.m with the following characteristics:
[seq,fs] = DTMFsequence(filename)
|
Output
|
seq
|
a string of characters 1 corresponding to one of twelve possible keys (Figure 1)
|
|
fs
|
The sampling rate in Hz
|
Input
|
filename
|
*.wav file that contains a sequence of key presses of unknown length
|
Write and submit the code for DTMFsequence
o You should generate a variety of test signals using your code from Part 1.
o To appreciate the range of difficulty in real-life applications, you are provided with a list of 20 real-life recordings recorded in a real office (some of these are noisy, and may include additional short sections of dialtone or ringtone). You should also generate your own test signals with varying degree of distortions.
Use the report to explain your strategy for finding the key presses in the sequence. Use an example and plots (both time and frequency domain with proper axes) to walk us through how an example works.
Part 4 - Decoding DTMF sequences in open environments
Now, we would like to understand the limits of your algorithm (so we know what settings we can market it for!) How much noise can it tolerate? You are provided a noise recording referred to as babble noise. It corresponds to a recording from a group of people talking at the same time, as would happen in a cafeteria or at a party. If a person is dialing their phone at this party, how loud can the party be before your algorithm stops reliably decoding the phone number? To estimate that, follow these steps:
a. Generate 50 random phone sequences (random numbers and random length) and encode them using your code from Part 1 (with varying DTMF parameters across sequences: frequency weighting and tone duration). You can assume that the weighting and duration is constant within each sequence.
b. Normalize each audio signal s[n] to an absolute maximum of 1
c. Normalize the background noise distortion d[n] to an absolute maximum of 1
d. Combine each sequence s[n] with the distortion d[n] using the equation:
y[n] = s[n] + α d[n]
e. Gradually vary the degree of noise (α) from 0 to 3 in steps of 0.1. Obviously, α = 0 represents your clean sequence without distortion.
f. For each level of α, decode your sequence and check your error rate (how correctly are you decoding the phone number?).
g. Repeat this procedure 50 times with each of the 50 sequences and provide an average accuracy for each noise level α
h. Include a plot of average accuracy vs. α in your report.
i. Examine a few examples in the time and frequency domain and comment on why you think your algorithm deteriorated at a certain level α.
Part 5 - Bonus section
Repeat the procedure in Part 4. Instead of using additive noise (y[n] = s[n] + α d[n]), we want to analyze effects of room reverberation, i.e. the reflections of the sound through all surfaces in the room. In this case, the distortion can be modeled as a convolution: y[n] = s[n] ∗ d??[n] where d??[n] is the impulse response of the room. You are provided a MATLAB function addreverb.m which simulates reverberation with different echo characteristics. The parameter reverbTime in the MATLAB function represents that echo characteristics: the higher that value, the more echo in the room. Repeat the procedure in Part 4, but this time testing accuracy of the algorithm as a function of reverberation time.
Revisit your analysis of Part 4. Repeat your analysis, but this time estimate how the encoding of DTMF tones affects your accuracy? Do longer or shorter tones give you better accuracy, or is your accuracy independent of tone duration? How about the weighting of low and high frequencies?
Attachment:- DTMF Decoding.rar