查找麦克风中正弦波的频率

发布于 2024-12-23 13:47:38 字数 109 浏览 0 评论 0原文

我正在寻找一种方法,从插入 Windows PC 麦克风插座的录音机获取正弦波的频率。这是一个小项目,我正在研究是否可以在录音带上存储数据,因此我将在磁带上读取和写入频率以存储数据。

谢谢

I am looking for a way to get the frequency of a sine wave from a tape recorder plugged into a microphone socket on a Windows PC. It's for a small project I'm working on to see if I can store data on sound tapes, so I'll be reading and writing frequencies to the tape to store data.

Thanks

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

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

发布评论

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

评论(2

蓝海似她心 2024-12-30 13:47:38

估计正弦波频率的一种简单方法是进行频谱分析并(粗略地)查找“最大声”频率:

  1. 从音频中取出一块音频(例如 256 个样本)
    文件,或从音频输入
  2. 窗口中音频块^
  3. 计算其功率谱(使用FFT算法^^)
  4. 寻找主频率,这应该是正弦波
  5. 重复的频率,直到你有音频数据

我希望它能工作很好用简单的音调。

^ 请参阅 http://en.wikipedia.org/wiki/Window_function

^^ 有很多可用的 FFT 实现,例如 http://www.fftw.org/

A simple way to estimate the frequency of a sine wave is doing a spectrum analysis and look for the "loudest" frequency (roughly):

  1. take one chunk of audio (for example 256 samples) from the audio
    file, or from the audio input
  2. window the audio chunk ^
  3. compute its power spectrum (using an FFT algorithm^^)
  4. look for the dominant frequency, which should be the frequency of the sine wave
  5. repeat until you have audio data

I expect it to work well with simple tones.

^ see http://en.wikipedia.org/wiki/Window_function

^^ there are plenty of FFT implementations available, for example http://www.fftw.org/

泡沫很甜 2024-12-30 13:47:38

如果在任何给定时间只有一个正弦波,您可以计算信号每秒将其值从正变为负(IOW,穿过 0)或相反的次数,这将为您提供频率。或者您可以测量连续过零之间的时间。这是一个非常简单且便宜的解决方案。

If there's only one sine wave at any given time, you can count how many times per second the signal changes its value from positive to negative (IOW, crosses 0) or the other way around and that will give you the frequency. Or you can measure the time between consecutive zero crossings. This is a pretty simple and cheap solution.

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