查找麦克风中正弦波的频率
我正在寻找一种方法,从插入 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
估计正弦波频率的一种简单方法是进行频谱分析并(粗略地)查找“最大声”频率:
文件,或从音频输入
我希望它能工作很好用简单的音调。
^ 请参阅 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):
file, or from the audio input
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/
如果在任何给定时间只有一个正弦波,您可以计算信号每秒将其值从正变为负(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.