Write Matlab script to plot the spectrum (-? to ? radians) of DTMF signal for keys 1, A and B. Choose an appropriate sampling frequency. The DTMF frequencies are indicated in table 1. Critically analyze the design specification.
Write Matlab script to plot the spectrum (-? to ? radians) of DTMF signal for keys 1, A and B. Choose an appropriate sampling frequency. The DTMF frequencies are indicated in table 1. Critically analyze the design specification. Table 1: DTMF frequencies Table 1: DTMF frequencies |
fs=8000;%sampling frequency
l=1.5; %length of the signal
t=0:1/fs:l;
%for button 1
f1=697;
f2=1209;
x1=sin(2*pi*f1*t)+sin(2*pi*f2*t);
subplot(3,2,1);
plot(x1);
X1=fft(x1);
subplot(3,2,2);
X1=abs(X1);
plot(X1);%THIS WILL PLOT MAGNITUDE SPECTRUM FOR BUTTON 1
%for Button A
f1=697;
f2=1633;
x2=sin(2*pi*f1*t)+sin(2*pi*f2*t);
subplot(3,2,3);
plot(x2);
X2=fft(x2);
subplot(3,2,4);
X2=abs(X2);
plot(X2);%THIS WILL PLOT MAGNITUDE SPECTRUM FOR BUTTON A
%for button B
f1=770;
f2=1633;
x3=sin(2*pi*f1*t)+sin(2*pi*f2*t);
subplot(3,2,5);
plot(x3);
X3=fft(x3);
subplot(3,2,6);
X3=abs(X3);
plot(X3);%THIS WILL PLOT MAGNITUDE SPECTRUM FOR BUTTON B
Get Answers For Free
Most questions answered within 1 hours.