how can i make an array of frequency after doing fft which helps to identify the keypad number? i have included my script
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Daniel M
el 27 de Oct. de 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 comentarios
Daniel M
el 27 de Oct. de 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.
Ver también
Categorías
Más información sobre DTMF en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!