Beispiel #1
0
                public static void OptimizeIIR(Complex[] Spectrum, int Sample_Freq, int filter_order, out double[] a, out double[] b)
                {
                    IIR_Spectrum_Objective obj = new IIR_Spectrum_Objective(filter_order, Spectrum, Sample_Freq);

                    //LibOptimization.Optimization.clsOptRealGAREX SA = new LibOptimization.Optimization.clsOptRealGAREX(obj);
                    //LibOptimization.Optimization.clsOptRealGABLX SA = new LibOptimization.Optimization.clsOptRealGABLX(obj);
                    LibOptimization.Optimization.clsOptSimulatedAnnealing SA = new LibOptimization.Optimization.clsOptSimulatedAnnealing(obj);
                    //LibOptimization.Optimization.clsOptNelderMead SA = new LibOptimization.Optimization.clsOptNelderMead(obj);
                    //SA.UseEliteStrategy(10);
                    //SA.PARAM_PopulationSize = Filter_Order * 50;
                    SA.PARAM_NEIGHBOR_RANGE = 0.00001;
                    //SA.PARAM_InitRange = 1;
                    //SA.PARAM_ChildrenSize = 20;
                    //SA.PARAM_MAX_ITERATION = 1000;
                    SA.Init();
                    SA.DoIteration();

                    DW2AB(SA.Result.ToArray(), null, out a, out b);
                }
                public static void OptimizeIIR(Complex[] Spectrum, int Sample_Freq, int filter_order, out double[] a, out double[] b)
                {
                    IIR_Spectrum_Objective obj = new IIR_Spectrum_Objective(filter_order, Spectrum, Sample_Freq);
                    //LibOptimization.Optimization.clsOptRealGAREX SA = new LibOptimization.Optimization.clsOptRealGAREX(obj);
                    //LibOptimization.Optimization.clsOptRealGABLX SA = new LibOptimization.Optimization.clsOptRealGABLX(obj);
                    LibOptimization.Optimization.clsOptSimulatedAnnealing SA = new LibOptimization.Optimization.clsOptSimulatedAnnealing(obj);
                    //LibOptimization.Optimization.clsOptNelderMead SA = new LibOptimization.Optimization.clsOptNelderMead(obj);
                    //SA.UseEliteStrategy(10);
                    //SA.PARAM_PopulationSize = Filter_Order * 50;
                    SA.PARAM_NEIGHBOR_RANGE = 0.00001;
                    //SA.PARAM_InitRange = 1;
                    //SA.PARAM_ChildrenSize = 20;
                    //SA.PARAM_MAX_ITERATION = 1000;
                    SA.Init();
                    SA.DoIteration();

                    DW2AB( SA.Result.ToArray(), null, out a, out b);
                }