⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fftlib.cs

📁 Programing SoundStudioCS
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Security;
using System.Runtime.InteropServices;
using System.Text;

namespace SoundStudioCS
{
    public class FFTLib
    {
        [DllImportAttribute("FFTlib.dll", EntryPoint = "ComputeF", CallingConvention = CallingConvention.Cdecl)]
        [SuppressUnmanagedCodeSecurityAttribute]
        public static extern int ComputeF([In]uint NumSamples, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] float[] pRealIn, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] float[] pImagIn, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] float[] pRealOut, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] float[] pImagOut, [In, MarshalAs(UnmanagedType.Bool)] bool bInverseTransform);

        [DllImportAttribute("FFTlib.dll", EntryPoint = "NormF", CallingConvention = CallingConvention.Cdecl)]
        [SuppressUnmanagedCodeSecurityAttribute]
        public static extern int NormF([In]uint NumSamples, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] float[] pReal, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] float[] pImag, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] float[] pAmpl);

        [DllImportAttribute("FFTlib.dll", EntryPoint = "PeakFrequencyF")]
        [SuppressUnmanagedCodeSecurityAttribute]
        public static extern double PeakFrequencyF([In]uint NumSamples, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] float[] pAmpl, float samplingRate, ref uint index);

        [DllImportAttribute("FFTlib.dll", EntryPoint = "ComputeD", CallingConvention = CallingConvention.Cdecl)]
        [SuppressUnmanagedCodeSecurityAttribute]
        public static extern int ComputeD([In]uint NumSamples, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] pRealIn, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] pImagIn, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] pRealOut, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] pImagOut, [In, MarshalAs(UnmanagedType.Bool)] bool bInverseTransform);

        [DllImportAttribute("FFTlib.dll", EntryPoint = "NormD", CallingConvention = CallingConvention.Cdecl)]
        [SuppressUnmanagedCodeSecurityAttribute]
        public static extern int NormD([In]uint NumSamples, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] pReal, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] pImag, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] pAmpl);

        [DllImportAttribute("FFTlib.dll", EntryPoint = "PeakFrequencyD")]
        [SuppressUnmanagedCodeSecurityAttribute]
        public static extern double PeakFrequencyD([In]uint NumSamples, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] pAmpl, double samplingRate, ref uint index);

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -