How to takeout the frequancy from FFT
Ältere Kommentare anzeigen
HI, i making the DTMF sound decoder
Actually the task is to find the DTMF coded numbers from DTMF sound, so i have somthing like phone number and i only need to separate this for each number or somthing like. And after somehow detect the frequancy. As i understand i need to use the FFT for this, but i don`t understand how to take the frequancy out from this graph
[sig1,Fs]=audioread('9234567.wav');
NFFT=512
WINDOW=NFFT;
NOVERLAP=NFFT/2
t1=0:Fs/NFFT:Fs/2-Fs/NFFT;
subplot(2,1,1)
X1 = fft(sig1,NFFT);
stem(t1,1/(NFFT/2)*abs(X1(1:NFFT/2)),'.');
subplot(2,1,2)
spectrogram (sig1,'yaxis', hamming(WINDOW), NOVERLAP, NFFT, Fs);
Please help me with this
5 Kommentare
You might want to preprocess the signal before doing the spectrogram of it. If you know the range of frequencies of the possible tones, then you can bandpass the signal around those frequencies to clean it up a bit. It might also be worth it to downsample your signal, because the audio file is likely sampled at 44100 Hz and your tones are in the low kHz range. It will make your frequency spectrum a little more sharp if you do this.
Then you'll need to select an appropriate window size. It kind of depends how quickly the tones a punched in (are they one after another with uniform time, or is the user punching in three numbers quickly, then pausing, then punching in more numbers etc). Then use spectrogram().
Instead of trying to choose a window size that works, you could try epoching your data in the time-domain to capture each individual tone. Then just run an FFT on each segment.
Once you get the signal(s) in the frequency spectrum, you can use findpeaks() to characterize each tone. Then you will have to compare these peaks to a calibration you need to have. That is, you first need to characterize the frequencies of each individual tone (where you know what the number is), and save this somewhere as your reference ground truth.
Edit: I looked up the DTMF protocol on Wikipedia and it seems that the frequencies are standardized. Each tone is made up of two frequencies. So you don't need to run a calibration. Just compare to that chart.
Danylo Begim
am 8 Nov. 2019
Bearbeitet: Danylo Begim
am 8 Nov. 2019
Star Strider
am 8 Nov. 2019
Search Answers for DTMF. There are a number of threads.
Danylo Begim
am 8 Nov. 2019
Daniel M
am 8 Nov. 2019
Follow the examples on the document page for fft
Antworten (1)
Kavya Vuriti
am 11 Nov. 2019
Bearbeitet: Kavya Vuriti
am 11 Nov. 2019
0 Stimmen
Hi,
To find frequencies corresponding to peaks after computing fft, you can try using findpeaks function. Specify second input argument to the findpeaks function as frequency to obtain the frequencies corresponding to peaks. Also, you can include other name-value pairs to get the desired result. You can refer this for more detailed information.
For more information on findpeaks function, refer: https://www.mathworks.com/help/signal/ref/findpeaks.html
Hope this helps.
Kategorien
Mehr zu DTMF finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!