JXI C# DSP Tools, Spectrum Analysis
聚星针对C#平台开发了数字信号处理工具包。 这里讲解频谱分析用法:
引用
SeeSharpTools.JXI.DSP C:SeeSharpJXInstSeeSharpToolsDSPBinSeeSharpTools.JXI.DSP.dll
代码
Complex[] readData = new Complex[AILength];
double[] spectrum = new double[AILength];
...
SpectrumTask _spectrumAnalyzer;
_spectrumAnalyzer = new SpectrumTask();
_spectrumAnalyzer.InputDataType = InputDataType.Complex;
_spectrumAnalyzer.SampleRate = aiTask.SampleRate;
_spectrumAnalyzer.WindowType = FFTWindowType.Blackman_Harris;
_spectrumAnalyzer.Unit.Type = SpectrumOutputUnit.dBm;
_spectrumAnalyzer.Unit.Impedance = 50;
_spectrumAnalyzer.Unit.IsPSD = checkBoxPSD.Checked;
_spectrumAnalyzer.Output.NumberOfLines = AILength;
_spectrumAnalyzer.GetSpectrum(readData, ref spectrum);
aiTask.SampleRate
checkBoxPSD.Checked
spectralLines
readData
spectrum
应该根据实际情况改成你的程序里面的变量。 其中readData是输入时域波形,spectrum是频谱。