No BSD License  

Highlights from
DTMF Encoder/Decoder with GUI using FFT,goertzel,Filter Banks

image thumbnail

DTMF Encoder/Decoder with GUI using FFT,goertzel,Filter Banks

by

 

A phone-like DTMF Encoding/Decoding tool

[n,signal]=phone_pad(k);
function [n,signal]=phone_pad(k);
%   Phone_pad : Computes the DTMF signal of digit k.
%   [n,signal]=phone_pad(k)
%   If k~={1,2,3,4,5,6,7,8,9,0,'*','#'} then ,
%   
%       
%       Input :
%       k  : to plhktro to opoio path8hke.
%       
%

%       Output:
%       n : To mege8os to DTMF shmatos.
%
%       signal : To DTMF shma.
%   
%   elseif k~={1,2,3,4,5,6,7,8,9,0,'*','#'},
%       unknown format.
%   end   
%   Copyright 2005 (R)
%   Author : Zouzias Anastasios
%   Email : zouzias@ceid.upatras.gr
%   $Date: 2005/08/31 18:03:00 $

N=204; 
n=0:N-1;
fs=8192; 
F_c=[697;770;852;941]*ones(1,3);
F_c=F_c';F_c=F_c(:)';
F_r=[1209;1336;1477]*ones(1,4);
F_r=F_r(:)';
F=2*pi/fs*[F_c;F_r];


switch k
case {1,2,3,4,5,6,7,8,9}
signal=cos(F(:,k)*n);

signal=sum(signal);

signal=[signal zeros(size(signal))];
case '*'
signal=cos(F(:,10)*n);

signal=sum(signal);

signal=[signal zeros(size(signal))];
case '#'
    signal=cos(F(:,12)*n);

    signal=sum(signal);

    signal=[signal zeros(size(signal))];
    
    
    
case 0   
    signal=cos(F(:,11)*n);

    signal=sum(signal);

    signal=[signal zeros(size(signal))];
    
otherwise disp('Unknown digit')
end
signal=signal';
sound(signal,fs);
%plot([1: length(signal)]',signal, 'r')
n=1:size(signal,1);

Contact us