如何判断iPhone中输入录音的频率?

发布于 2024-08-23 15:02:39 字数 92 浏览 18 评论 0原文

我是 iPhone 开发新手。我正在研究 iPhone 中的录音。我已经从苹果公司下载了“speak here”示例程序。我想确定 iPhone 中录制的我的声音的频率。

I am new to iPhone development. I am doing research on voice recording in iPhone. I have downloaded the "speak here" sample program from Apple. I want to determine the frequency of my voice that is recorded in iPhone.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦巷 2024-08-30 15:02:39

在处理人类语音的背景下,实际上不存在“频率”这样的东西。
信号将是许多不同频率的混合,因此从频谱的角度来思考可能比单个频率更有效。即使你正在谈论
具有固定音高的持续音符,除了音符的基频之外,还会存在大量泛音和和声。而对于实际的演讲来说,
由于元音和辅音的音调特征不同,即使在很短的剪辑内,频谱也会发生巨大变化。

话虽如此,考虑录音的峰值频率确实有意义。
您可以计算语音片段的快速傅立叶变换,然后找到频率
bin 具有最大的响应。您可能还对频谱图的概念感兴趣,它表示信号的音频频谱如何随着时间的推移而变化。

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.

灯下孤影 2024-08-30 15:02:39

使用大胆。录制一段典型语音的小录音,并将其缩减为一个波长,从一个峰值到另一个峰值。减去两次,然后用 1 除以该数字,您将得到波的频率(以 Hz 为单位)。

示例:

在我的音频剪辑中,波形的运行时间为 0.0760 到 0.0803 秒。

0.0803-0.0760 = 0.0043

1/0.0043 = 232.558 Hz,我的典型语音频率

这可能为您创建分析器提供良好的基础。您需要检测波峰以及波峰之间的时间,并对结果进行平均计算。

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.

孤凫 2024-08-30 15:02:39

您需要使用 Apple 的 Accelerate 框架对相关音频进行 FFT。 FFT 将时域中的音频转换到频域中。 Accelerate 框架支持 FFT,允许您实时进行频率分析。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文