In: Electrical Engineering
9.8.2 Generation of DTMF Tone
Using firpm function of MATLAB, design a lowpass and a highpass
filter to filter
out highpass and lowpass components of DTMF tones, respectively. Do
not use very
high-order FIR filters.
1. Generate the signal for DTMF tone ’2’
2. Plot a couple of periods of the signal you generated
3. Plot the spectrum of the signal you generated, comment on the
spectrum
MATLAB CODE
clc;
clear all;
symbol_matrix =
{'1','2','3','A','4','5','6','B','7','8','9','C','*','0','#','D'};
low_frquency_group = [697 770 852 941]; % Low frequency group
high_frquency_group = [1209 1336 1477 1633]; % High frequency
group
f = [];
for i=1:4
for j=1:4
f = [ f [low_frquency_group(i);high_frquency_group(j)] ];
end
end
Fs = 10000; % Sampling frequency `10 kHz
N = 800; % Tones of 100 ms
t = (0:N-1)/Fs; % 800 samples at Fs
pit = 2*pi*t;
tones = zeros(N,size(f,2));
for toneChoice=1:16
% Generate tone
tones(:,toneChoice) = sum(sin(f(:,toneChoice)*pit))';
% Plot tone
subplot(4,4,toneChoice),plot(t*1e3,tones(:,toneChoice));
title(['Symbol "', symbol_matrix{toneChoice},'":
[',num2str(f(1,toneChoice)),',',num2str(f(2,toneChoice)),']'])
set(gca, 'Xlim', [0 25]);
ylabel('Amplitude');
end
set(gcf, 'Color', [1 1 1 1 ], 'Position', [1 1 1280 1024])
annotation(gcf,'textbox', 'Position',[0.38 0.96 0.45
0.026],...
'EdgeColor',[1 1 1],...
'String', '\bf Time response of each tone of the telephone pad',
...
'FitBoxToText','on');
Spectrum of whole keyboard