示例#1
0
 protected override void Execute()
 {
     for (int i = 0; i < DetailValues.Length; i++)
     {
         DetailValues[i] = "";
     }
     for (int i = 0; i < this.DataBuf.Count; i++)
     {
         ToneAnalysisResult result = HarmonicAnalyzer.ToneAnalysis(
             this.DataBuf[i], 1.0 / GlobalInfo.SampleRate);
         DetailValues[0] += Utility.GetShowValue(result.THD, i);
         DetailValues[1] += Utility.GetShowValue(result.THDplusN, i);
         DetailValues[2] += Utility.GetShowValue(result.SINAD, i);
         DetailValues[3] += Utility.GetShowValue(result.SNR, i);
         DetailValues[4] += Utility.GetShowValue(result.NoiseFloor, i);
         DetailValues[5] += Utility.GetShowValue(result.ENOB, i);
     }
 }
示例#2
0
        protected override void Execute()
        {
            int channelCount = GlobalInfo.Channels.Count(item => item.Enabled);
            int sampleCount  = GlobalInfo.SamplesInChart;

            for (int i = 0; i < DetailValues.Length; i++)
            {
                DetailValues[i] = "";
            }
            for (int i = 0; i < channelCount; i++)
            {
                ToneAnalysisResult result = HarmonicAnalysis.ToneAnalysis(DataBuf.GetRange(i * sampleCount, sampleCount).ToArray(),
                                                                          1.0 / GlobalInfo.SampleRate);
                DetailValues[0] += $"{result.THD:f6} ";
                DetailValues[1] += $"{result.THDplusN:f6} ";
                DetailValues[2] += $"{result.SINAD:f6} ";
                DetailValues[3] += $"{result.SNR:f6} ";
                DetailValues[4] += $"{result.NoiseFloor:f6} ";
                DetailValues[5] += $"{result.ENOB:f6} ";
            }
        }