Phi*_*hil 4 c# audio signal-processing fft
可能重复:
c#中的快速傅里叶变换
我正在寻找一个在C#中执行线路输入或麦克风音频数据的实时FFT(快速傅立叶变换)的示例.我的目标是实时确定音频数据中是否存在特定音符.任何例子都赞赏.
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);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13135 次 |
| 最近记录: |