hello, i have a wav file, which use dtmf i do spectrogram on the file and i receive 10 amplitude peak how can i return the 2 frequency of each peak (high and low frequency)
Best Answer
You did not post your data so I cannot be specific. You can get the frequency and time output as vectors fromspectrogram:
[S,F,T] = spectrogram(...) returns a vector of frequencies,F , and a vector of times,T , at which the spectrogram is computed.F has length equal to the number of rows ofS .T has lengthk (defined above) and the values inT correspond to the center of each segment.
There is probably no neat and efficient way to do what you want. I would loop throughS at each time,sort and threshold the amplitudes to find the indices of the values >-35dB or so, then use the indices returned bysort to determine the frequencies. (Using thefind function is also a possibility, but I am not certain it would make this more efficient.)
Best Answer