public void Analyze() { IMDType imdType = (IMDType)Enum.Parse(typeof(IMDType), comboBox_imdType.Text); // double frequency1, frequency2, amplitudeRatio, imd; // SeeSharpTools.JY.Audio.AudioAnalyzer.AnalyzeDualToneWave(readWaveform, sampleRate, imdType, out frequency1, out frequency2, out amplitudeRatio, out imd); _analyzer.SetAnalyzeParam(_globalInfo.AITask.GetSampleRate(), imdType); _analyzer.Analyze(_testData, _globalInfo.DelaySamples, _analyzeSize); }
/// <summary> /// 配置分析的参数 /// </summary> /// <param name="sampleRate">采样率</param> /// <param name="imdType">IMD类型</param> /// <param name="frequency1">频率1</param> /// <param name="frequency2">频率2</param> public void SetAnalyzeParam(double sampleRate, IMDType imdType, double frequency1 = 0, double frequency2 = 0) { analyzer.SetImdType((ImdType)imdType); analyzer.SetDataSampleRate(sampleRate); if (frequency1 > 0 && frequency2 > 0) { analyzer.SetTargetToneFrequency(frequency1, frequency2, sampleRate); } SampleRate = sampleRate; this.IsAnalyzeParamSet = true; }
/// <summary> /// 分析双音色波形 /// </summary> /// <param name="testData">测试波形</param> /// <param name="sampleRate">采样率</param> /// <param name="imdType">IMD类型</param> /// <param name="frequency1">第一频率</param> /// <param name="frequency2">第二频率</param> /// <param name="amplitudeRatio">幅度比</param> /// <param name="IMDInDb">IMD数值(dB)</param> public static void AnalyzeDualToneWave(double[] testData, double sampleRate, IMDType imdType, out double frequency1, out double frequency2, out double amplitudeRatio, out double IMDInDb) { DualToneAnalyzer analyzer = new DualToneAnalyzer(); analyzer.SetImdType((ImdType)imdType); analyzer.SetDataSampleRate(sampleRate); analyzer.Analyze(testData, (uint)testData.Length); frequency1 = analyzer.GetFrequency1(); frequency2 = analyzer.GetFrequency2(); amplitudeRatio = analyzer.GetAmplitudeRatioF1toF2(); IMDInDb = analyzer.GetIMD(); }
public int Next(IMDType pType, out ulong pInterfacePtr) { if (m_curr < m_data.Count) { pType = new MDType(m_data[m_curr].Type); pInterfacePtr = m_data[m_curr].InterfacePointer; m_curr++; return(HRESULTS.S_OK); } pType = null; pInterfacePtr = 0; if (m_curr == m_data.Count) { m_curr++; return(HRESULTS.S_FALSE); } return(HRESULTS.E_FAIL); }
public void GetObjectType(ulong addr, out IMDType ppType) { ppType = new MDType(m_heap.GetObjectType(addr)); }
void IMDException.GetGCHeapType(out IMDType ppType) { ppType = new MDType(m_ex.Type); }
public void GetArrayComponentType(out IMDType ppArrayComponentType) { ppArrayComponentType = Construct(m_type.ArrayComponentType); }
public void GetBaseType(out IMDType ppBaseType) { ppBaseType = Construct(m_type.BaseType); }
public void GetType(out IMDType ppType) { ppType = MDType.Construct(m_field.Type); }
public int Next(IMDType pType, out ulong pInterfacePtr) { if (m_curr < m_data.Count) { pType = new MDType(m_data[m_curr].Type); pInterfacePtr = m_data[m_curr].InterfacePointer; m_curr++; return HRESULTS.S_OK; } pType = null; pInterfacePtr = 0; if (m_curr == m_data.Count) { m_curr++; return HRESULTS.S_FALSE; } return HRESULTS.E_FAIL; }
public void GetType(out IMDType ppType) { ppType = null; }