how can i make an array of frequency after doing fft which helps to identify the keypad number? i have included my script

1 view (last 30 days)
Fs = 8000;
Duration = 3;
recObj = audiorecorder(Fs,8,1);
disp('Press the dialpad for number');
pause(3)
disp('stop recording');
recordblocking(recObj, Duration);
y = getaudiodata(recObj);
Ts = 1/Fs;
Freq = Fs/2;
t = 0 : Ts : Duration-Ts;
deltaU = 1/(length(t)*Ts);
F = -0.5*Fs:deltaU:0.5*Fs-deltaU;
yfft = abs(fftshift(fft(y)));
figure
plot(F,yfft)
hold on
xlabel('Frequency(Hz)')
ylabel('Spectrum Amplitude')
title('FFT of DTMF tone')
grid

Answers (1)

Daniel M
Daniel M on 27 Oct 2019
You would have to calibrate each keypad to a specific frequency first, then compare what the user typed in to your calibrated peaks. There are several ways you could do this, but it would vary based on what your actual signals look like (spectral resolution), how robust you would like to be, if you want to check for errors (like punching in two numbers at once), etc.
  2 Comments
Sitaram karki
Sitaram karki on 27 Oct 2019
i have calibrated the frequency so as to reduce errors but i am looking to identify the frequency array first so that i can match the tone combination with the code i have.
Daniel M
Daniel M on 27 Oct 2019
Did you not already define your frequency array with the variable F above? I haven't looked at the code too closely, but it looks OK at a glance. Look up the doc on fft and fftshift if you're not sure about how you've defined your frequencies.

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!