Esempio n. 1
0
 /* add an analyzer to the spec list */
 public static void AddAnalyzerToEffectSpecList(
     EffectSpecListRec EffectSpecList,
     AnalyzerSpecRec AnalyzerSpec,
     bool EnabledFlag)
 {
     AddGenericToEffectSpecList(EffectSpecList, EffectTypes.eAnalyzerEffect, AnalyzerSpec, EnabledFlag);
 }
Esempio n. 2
0
        /* 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);
        }
Esempio n. 3
0
        /* 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);
        }
Esempio n. 4
0
        /* 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;
        }
Esempio n. 5
0
            /* 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);
 }
Esempio n. 7
0
 /* find out if power estimator is enabled */
 public static bool IsAnalyzerSpecPowerEstimatorEnabled(AnalyzerSpecRec Analyzer)
 {
     return(Analyzer.PowerEstimatorEnable);
 }
Esempio n. 8
0
 /* get actual heap block analyzer identifier string */
 public static string GetAnalyzerSpecString(AnalyzerSpecRec Analyzer)
 {
     return(Analyzer.String);
 }