开发者

How to determine the frequency of the input recorded voice in iphone?

开发者 https://www.devze.com 2022-12-22 02:39 出处:网络
I am new to iphone development.I am doing research on voice recording in i开发者_开发知识库phone .I have downloaded the \"speak here \" sample program from Apple.I want to determine the frequency of m

I am new to iphone development.I am doing research on voice recording in i开发者_开发知识库phone .I have downloaded the "speak here " sample program from Apple.I want to determine the frequency of my voice that is recorded in iphone.Please guide me .Please help me out.Thanks.


In the context of processing human speech, there's really no such thing as "the" frequency. The signal will be a mix of many different frequencies, so it might be more fruitful to think in terms of a spectrum, rather than a single frequency. Even if you're talking about a sustained musical note with a fixed pitch, there will be plenty of overtones and harmonics present, in addition to the fundamental frequency of the note. And for actual speech, the frequency spectrum will change drastically even within a short clip, due to the different tonal characteristics of vowels and consonants.

With that said, it does make some sense to consider the peak frequency of a voice recording. You could calculate the Fast Fourier Transform of your voice clip, then find the frequency bin with the largest response. You may also be interested in the concept of a spectrogram, which represents how the audio spectrum of a signal varies over time.


Use Audacity. Take a small recording of typical speech, and cut it down to one wavelength, from one peak to another peak. Subtract the two times, and divide 1 by that number and you'll get the frequency of your wave in Hz.

Example:

In my audio clip, my waveform runs from 0.0760 to 0.0803 seconds.

0.0803-0.0760 = 0.0043

1/0.0043 = 232.558 Hz, my typical speech frequency

This might give you a good basis to create an analyzer. You'd need to detect the peaks, and time between the peaks of the wave and do an average calculation of the result.


You'll need to use Apple's Accelerate framework to take an FFT of the relevant audio. The FFT will convert the audio in the time domain to the frequency domain. The Accelerate framework supports the FFT and will allow you to do frequency analysis in real-time.

0

精彩评论

暂无评论...
验证码 换一张
取 消