how to split signal in dtmf program

26 views (last 30 days)
MU
MU on 18 Feb 2013
I was doing decoding phone number project using FFT algorithm, i do not know how to set up an rule for setting an threshold to split signal into several segment, and also how to do it in matlab code, so can anyone help me please, here is what i did right now.
[y,Fs,bits] = wavread('PhoneNumberA_2013.wav');
Nsamps = length(y);
t = (1/Fs)*(1:Nsamps) %Prepare time data for plot
%Do Fourier Transform
y_fft = abs(fft(y)); %Retain Magnitude
%y_fft = y_fft(1:Nsamps/2); %Discard Half of Points
f = Fs*(0:Nsamps-1)/Nsamps; %Prepare freq data for plot
%Plot Sound File in Time Domain
figure(1)
plot(t, y)
xlabel('Time (s)')
ylabel('Amplitude')
title('PhoneNumberA frequency in Time Domain')
%Plot Sound File in Frequency Domain
figure(2)
plot(f, y_fft)
axis([0,1800 0 600])
%xlim([0,2000])
%ylim([0,800])
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('PhoneNumberA frequency in Frequency domain')
i am sorry because i do not how to upload my image, but i am pretty sure till now the code i upload is correct, please help me~
thank you

Answers (1)

Youssef  Khmou
Youssef Khmou on 18 Feb 2013
hi MU,
in DTMF ( Dual Tone Multi Freqency) the phone number is composed of 11 digits, so you need to divide the length of y or Nsamps according to your code into 11 equal segments y1,y2,.......y11 and for each yi compute the Amplitude spectrum ,extract the two frequencies (697 770 852 941 1209 1336 1477 ) Hz and use conditioning test to recognize the digits :
n=floor(Nsamps/11);
%construct a matrix that contains the segments A(n,11) :
A=zeros(n,11);
A(:,1)=y(1:n);
A(:,2)=y(n+1:2*n);
A(:,3)=y(2*n+1:3*n);
%.....
A(:,11)=y(10*n+1:end);
%Now compute the spectra : FFT(A(:,1)..................A(:,11)
% Extract the frequencies and store them in B(11x2) matrix such that every
% row contains one DTFM
% use conditioning test
I hope that helps
  2 Comments
Youssef  Khmou
Youssef Khmou on 18 Feb 2013
hi, alright, anyway he can define the number by counting the peaks in the time domain .

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!