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
0 个评论
回答(1 个)
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 个评论
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 DTMF 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!