如何使用快速傅里叶变换结果获得频率/持续时间对? [英] How do I use Fast Fourier Transform Results to get frequency/duration pairs?

查看:434
本文介绍了如何使用快速傅里叶变换结果获得频率/持续时间对?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将.wav文件读取到频率/持续时间对的数组,以便在Console.Beep(int,int)-type函数中使用。到目前为止,我已经将数据读入浮点数组并执行了FFT,但我无法对复数结果做出正面或反面。在互联网上搜索过,我似乎找不到我需要的东西。我应该如何使用FFT的输出到音高(以赫兹为单位)和持续时间(最好以毫秒为单位,但如果需要,我可以转换)。谢谢!

I need to read a .wav file to an array of frequency/duration pairs for use in a Console.Beep(int,int)-type function. So far, I have read the data into a float array and performed an FFT, but I can't make heads or tails of the complex number results. Having searched all over the internet, I can't seem to find quite what I need. How should I use the outputs of the FFT to a pitch (in Hertz) and a duration (preferably in milliseconds, but I can convert if I need to). Thanks!

推荐答案

请看我对这个问题的评论。这个问题非常复杂,据我所知,像图像识别,只适用于音乐。我尝试了一些软件产品,即使我使用非常清晰的波形,它们也都工作得很差。



所以,抱歉没有回答你的问题,这可能是一件困难的事情。我相信解决这样的问题应该是可能的,但我从来没有看到过很好的解决方案。



在你能解决问题之前,你应该先了解如何制定它。你没有正确地做到这一点 - 我试图在我对这个问题的评论中提供一些提示来理解为什么。只是为了弄清楚问题的形成,你应该更好地理解频谱和傅立叶分析/变换的工作原理以及它的真正含义。我担心它比你现在想象的更复杂(甚至是一般的理解)。你可以从这里开始:

http://en.wikipedia.org/wiki/Discrete_Fourier_transform [ ^ ],

http://en.wikipedia.org/wiki/Fourier_transform [ ^ ],

http://en.wikipedia.org/w/index.php?title=Special:Search&search=Fourier+analysis&profile=default [ ^ ]。



-SA
Please see my comment to the question. This problem is quite complex, as far as I can understand it, something like "image recognition", only for music. I tried some software product doing that, and they all worked quite poorly, even when I used a very clear waveform.

So, sorry for not answering your question, it could be a difficult thing. I believe solving such problem should be possible, but I never saw really good solutions.

Before you can even get to the problem, you should first understand how to formulate it. You are not doing it correctly — I tried to provide some hints to understanding why in my comment to the question. Just for figuring out the formulation of the problem, you should better understand how spectrum and Fourier analysis/transform works and what it really means. I'm afraid it's more complex (even for general understanding) than you imagine right now. You can start here:
http://en.wikipedia.org/wiki/Discrete_Fourier_transform[^],
http://en.wikipedia.org/wiki/Fourier_transform[^],
http://en.wikipedia.org/w/index.php?title=Special:Search&search=Fourier+analysis&profile=default[^].

—SA


这篇关于如何使用快速傅里叶变换结果获得频率/持续时间对?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆