public void CalculateCoefficients(FFT.Algorithm algorithm, FFT.FilterType filter) { // Generate the actual coefficients this.CurrentAlgorithm = algorithm; this.CurrentFilter = filter; if (algorithm == FFT.Algorithm.Kaiser) { // For kaiser window function we need to set the attentuation this.StopBandAttenuation = 60; // Kaiser also requires transition band this.TransitionBand = 500; } if (this.myFreqFrom == 0.0f && this.myFreqTo == 0.0f) { this.myFFT.FreqFrom = 1000; this.myFFT.FreqTo = 1000f; } else { this.myFFT.FreqFrom = this.myFreqFrom; this.myFFT.FreqTo = this.myFreqTo; } this.myCoeff = this.myFFT.GenerateCoefficients(this.CurrentFilter, this.CurrentAlgorithm); }
/// <summary> /// Main constructor. Resets all settings within the FFT algorithm object. /// </summary> public FIRFilters() { //Create a new FFT object this.myFFT = new FFT(); //Default algorithm to Kaiser this.CurrentAlgorithm = FFT.Algorithm.Kaiser; //Default taps to 35 this.myTaps = 35; }