/* add an analyzer to the spec list */ public static void AddAnalyzerToEffectSpecList( EffectSpecListRec EffectSpecList, AnalyzerSpecRec AnalyzerSpec, bool EnabledFlag) { AddGenericToEffectSpecList(EffectSpecList, EffectTypes.eAnalyzerEffect, AnalyzerSpec, EnabledFlag); }
/* create a new analyzer spec */ public static AnalyzerSpecRec NewAnalyzerSpec(string Identifier) { AnalyzerSpecRec Analyzer = new AnalyzerSpecRec(); Analyzer.String = Identifier; Analyzer.PowerEstimatorCutoff = 10; //Analyzer.PowerEstimatorEnable = false; return(Analyzer); }
/* get cutoff frequency for power estimator */ public static double GetAnalyzerSpecPowerEstimatorCutoff(AnalyzerSpecRec Analyzer) { #if DEBUG if (!Analyzer.PowerEstimatorEnable) { Debug.Assert(false); throw new ArgumentException(); } #endif return(Analyzer.PowerEstimatorCutoff); }
/* enable power estimation and set frequency */ public static void AnalyzerSpecEnablePowerEstimator( AnalyzerSpecRec Analyzer, double FilterCutoff, AnalyzerPowerEstType Method) { #if DEBUG if ((Method != AnalyzerPowerEstType.eAnalyzerPowerAbsVal) && (Method != AnalyzerPowerEstType.eAnalyzerPowerRMS)) { Debug.Assert(false); throw new ArgumentException(); } #endif Analyzer.PowerEstimatorEnable = true; Analyzer.PowerEstimatorCutoff = FilterCutoff; Analyzer.PowerEstimatorMethod = Method; }
/* create a new analyzer processor */ public static AnalyzerRec NewAnalyzer( AnalyzerSpecRec Template, SynthParamRec SynthParams) { AnalyzerRec Analyzer = new AnalyzerRec(); Analyzer.AnalyzerString = GetAnalyzerSpecString(Template); Analyzer.LeftMinimum = Int32.MaxValue; Analyzer.LeftMaximum = Int32.MinValue; Analyzer.RightMinimum = Int32.MaxValue; Analyzer.RightMaximum = Int32.MinValue; Analyzer.FrameCount = 0; Analyzer.LeftPowerMaximum = Int32.MinValue; Analyzer.RightPowerMaximum = Int32.MinValue; Analyzer.PowerEnabled = IsAnalyzerSpecPowerEstimatorEnabled(Template); if (Analyzer.PowerEnabled) { Analyzer.LeftLowpass = new FirstOrderLowpassRec(); FirstOrderLowpassRec.SetFirstOrderLowpassCoefficients( Analyzer.LeftLowpass, GetAnalyzerSpecPowerEstimatorCutoff(Template), SynthParams.dSamplingRate); Analyzer.RightLowpass = new FirstOrderLowpassRec(); FirstOrderLowpassRec.SetFirstOrderLowpassCoefficients( Analyzer.RightLowpass, GetAnalyzerSpecPowerEstimatorCutoff(Template), SynthParams.dSamplingRate); Analyzer.PowerMethod = GetAnalyzerSpecPowerEstimatorMethod(Template); #if DEBUG if ((Analyzer.PowerMethod != AnalyzerPowerEstType.eAnalyzerPowerAbsVal) && (Analyzer.PowerMethod != AnalyzerPowerEstType.eAnalyzerPowerRMS)) { Debug.Assert(false); throw new ArgumentException(); } #endif } return(Analyzer); }
/* check analyzer effect */ public static SynthErrorCodes CheckAnalyzerEffectForUnreferencedSamples( AnalyzerSpecRec AnalyzerEffect, CheckUnrefParamRec Param) { return(SynthErrorCodes.eSynthDone); }
/* find out if power estimator is enabled */ public static bool IsAnalyzerSpecPowerEstimatorEnabled(AnalyzerSpecRec Analyzer) { return(Analyzer.PowerEstimatorEnable); }
/* get actual heap block analyzer identifier string */ public static string GetAnalyzerSpecString(AnalyzerSpecRec Analyzer) { return(Analyzer.String); }