using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; /* @author Geir K. Nilsen (geir.kjetil.nilsen@gmail.com) 2017 */ namespace ParametricEqualizer { public class ParametricEqualizer { private int numberOfSections; private List
section; private double[] G0; private double[] G; private double[] GB; private double[] f0; private double[] Bf; public ParametricEqualizer(int numberOfSections, int fs, double[] f0, double[] Bf, double[] GB, double[] G0, double[] G) { this.numberOfSections = numberOfSections; this.G0 = G0; this.G = G; this.GB = GB; this.f0 = f0; this.Bf = Bf; section = new List
(); for (int sectionNumber = 0; sectionNumber < numberOfSections; sectionNumber++) { section.Add(new Section(f0[sectionNumber], Bf[sectionNumber], GB[sectionNumber], G0[sectionNumber], G[sectionNumber], fs)); } } public void run(List x, ref List y) { for (int sectionNumber = 0; sectionNumber < numberOfSections; sectionNumber++) { section[sectionNumber].run(x, out y); x = y; // next section } } } }