You are on page 1of 1

%%% %%%%%%%%%%%%%%Super saiyan7%%%%%%%%%%%%%%%%%%%%% %%%

%% DTMF
%
% filters a,b
A=inline('[1 -2*(cos(a)+cos(b)) 2*(1+2*cos(a)*cos(b)) -2*(cos(a)+cos(b)) 1]','a'
,'b');
B=inline('[sin(a)+sin(b) -2*sin(a+b) sin(a)+sin(b)]','a','b');
a1=inline('2*pi*f/8000','f');fs=8000
%% impulse
delt=[1 zeros(1,299)];%%for impulse
%% digital frequency
f_r=[1:length(delt)]*fs*0.98/length(delt); k=2;
%% DTMF frequencies ASSIging
fv=[1209 1336 1477 ];
fh=[697
770
852 ]; f_s=[941 1336];
for i=1:3
for j=1:3
f_s(k,:)=[fh(i) fv(j)];
k=k+1;
end
end
%% INPUT NUMBERS
x = inputdlg('Enter 10 digit phone number separated by space:', 'Telephone', [1
14]);
x = str2num(x{:}); y_T=[];
display(x)%%numbers
%% GEneration && Frequency response
for i=1:length(x)
a=a1(f_s(x(i)+1,1));b=a1(f_s(x(i)+1,2));
y=filter(B(a,b),A(a,b),delt);
figure(i)
plot(f_r,abs(fft(y))),title(strcat('For NO =',num2str(x(i)),'---','frequencies--',num2str(f_s(x(i)+1,1)),'---',num2str(f_s(x(i)+1,2))))
y_T=[y_T y];
y_T=[y_T zeros(1,50)];
end
figure(length(x)+1),plot([1:length(y_T)]/fs,y_T),axis tight
%%end
% li tan, Rob schiling

You might also like