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

1 次查看(过去 30 天)
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

回答(1 个)

Daniel M
Daniel M 2019-10-27
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 个评论
Sitaram karki
Sitaram karki 2019-10-27
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 2019-10-27
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.

请先登录,再进行评论。

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by