C# 中的快速傅立叶变换

发布于 2024-09-26 04:39:35 字数 251 浏览 0 评论 0原文

可能的重复:
c# 中的快速傅立叶变换

我正在寻找执行实时 FFT 的示例( C# 中线路输入或麦克风音频数据的快速傅立叶变换。我的目标是实时确定音频数据中是否存在特定音符。任何例子表示赞赏。

Possible Duplicate:
Fast fourier transform in c#

I am looking for an example of performing a real time FFT (Fast Fourier Transform) of line in or mic audio data in C#. My goal is to determine in real time if a particular note is present in the audio data. Any examples appreciated.

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

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

发布评论

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

评论(1

樱娆 2024-10-03 04:39:35

AForge.NET 是一个支持快速傅立叶变换的开源库。
ExocortexDSP 也是另一种选择。

ExocortexDSP 示例如下所示:

   Exocortex.DSP.ComplexF[] complexData = new Exocortex.DSP.ComplexF[512];
   for (int i = 0; i < 512; ++i)
   {
      // Fill the complex data
      complexData[i].Re = 1; // Add your real part here
      complexData[i].Im = 2; // Add your imaginary part here
   }

   // FFT the time domain data to get frequency domain data
   Exocortex.DSP.Fourier.FFT(complexData, Exocortex.DSP.FourierDirection.Forward);

   float[] mag_dat_buffer = new float[complexData.Length];
   // Loop through FFT'ed data and do something with it
   for (int i = 0; i < complexData.Length; ++i)
   {
      // Calculate magnitude or do something with the new complex data
      mag_data_buffer[i] = ImaginaryNumberMagnitude(complexData[i].Im, complexData[i].Re);
   }

AForge.NET is an open-source library with Fast Fourier Transform support.
ExocortexDSP is also another option.

ExocortexDSP example would look something like this:

   Exocortex.DSP.ComplexF[] complexData = new Exocortex.DSP.ComplexF[512];
   for (int i = 0; i < 512; ++i)
   {
      // Fill the complex data
      complexData[i].Re = 1; // Add your real part here
      complexData[i].Im = 2; // Add your imaginary part here
   }

   // FFT the time domain data to get frequency domain data
   Exocortex.DSP.Fourier.FFT(complexData, Exocortex.DSP.FourierDirection.Forward);

   float[] mag_dat_buffer = new float[complexData.Length];
   // Loop through FFT'ed data and do something with it
   for (int i = 0; i < complexData.Length; ++i)
   {
      // Calculate magnitude or do something with the new complex data
      mag_data_buffer[i] = ImaginaryNumberMagnitude(complexData[i].Im, complexData[i].Re);
   }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文