please Solve the problem and clearly explain each command li
please Solve the problem and clearly explain each command line for the problem. USING MATLAB.
The Table below shows the combinations of tone frequencies used in a touch tone telephone keypad. Write a Matlab program that prompts the user to enter via keyboard a telephone number (ignore \'*\' and \'#\' keys), including the area code, and then plays (using the function sound ()) the corresponding dual tone multiple frequency (DTMF) sequence. Each tone MUST be played at 0.5 seconds at a sampling period of 1/8192 seconds. Your program MUST perform the following tasks: The telephone number entered via keyboard MUST be inputted as a SINGLE STRING. Your program MUST be able to retrieve the 10 digits and take care of different input formats such as: (123)456-7890, 123-456-7890, 1234567890, etc. Your program MUST also verify whether the telephone number entered (excluding characters) has ten digits. If not, your program must display a message to the user and allow him/her to reenter the number without the need to rerun the program. Use the Matlab built-in functions str2double() and isnan() to retrieve the numerical values. Plot the tones corresponding to the fourth and the eighth digits entered by the user in the same figure in the time interval [0.20, 0.22], Write inside each plot the corresponding digit and use appropriate axis labels for the plots. Your program MUST also allow the user to START OVER as often he/she wishes, WITHOUT THE NEED to rerun the program.Solution
1) clear %
clear memory
clf reset %
clear all figures
T = 10; %
signal duration Fs = 8000; %
sampling frequency f = 440;
% frequency of sound t = 0:1/Fs:T;
% time axis n = T*Fs;
% length of vector x = 4 * exp(-2*t).*sin(2*pi*f*t);
plot(t(1:n),x(1:n),’r’) grid xlabel(’time-secs’) ylabel(’signal value - volts’) title(’A Plot of a Simple Signal’) sound(x,Fs) % play the signal
