使用C创建频谱图 [英] Creating a Spectrogram using C

查看:113
本文介绍了使用C创建频谱图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试用C制作音频频谱图,并且我正在考虑使用BASS库:

http://www.un4seen.com [ ^ ].

我在Google和此处进行了搜索,但是大多数示例都使用C ++.如果您有任何相关经验或资源,请提供帮助;不胜感激.

所以这就是我想要做的:

1.从麦克风输入中读取.
2.采样数据.
3.应用短时傅立叶变换.
4.然后取该幅度并将其以特定频率绘制.

像这样的东西:

http://upload.wikimedia.org/wikipedia/commons/c/c5/Spectrogram- 19thC.png [ ^ ]

如果可以的话,那就太好了.它还是一个WINDOWS应用程序.

I am trying to make an audio spectrogram in C and I am thinking about using the BASS library:

http://www.un4seen.com[^].

I searched over Google and here, but majority of examples are in C++. If any of you have any experience or resource regarding this, please help; it would be much appreciated.

So this is what I want to do:

1. Read from mic input.
2. Sample the data.
3. Apply Short time Fourier transform.
4. Then take the magnitude and plot it at the certain frequency.

Something like this:

http://upload.wikimedia.org/wikipedia/commons/c/c5/Spectrogram-19thC.png[^]

If you can help it would be great. Also its a WINDOWS application

推荐答案

没有实际问题,涉及的主题数量实际上很广泛,但是这里是个推手. br/>
1.可能有一些库可以帮助您完成此操作,或者您可以使用 Windows Wave IO API [ ^ ]即可做到.
2.参见1,即抽样.
3.如果您知道数学,请自己动手.另一种方法是在网上搜索诸如 FFTW [
There''s no actual question and the number of topics covered is really broad in nature, but here''s a push start.

1. There''s probably libraries that''ll help you to do this, or you can use the Windows Wave IO API[^] to do it.
2. See 1, that is sampling.
3. If you know the math, do it yourself. Alternatitevly search the net for libraries such as FFTW[^].
4. Learn to plot, you can use any of the graphics libraries (GDI, GDI+, etc...).


这篇关于使用C创建频谱图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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