public IIRFilterBlockComplex(ComplexRationalPolynomial p) { mH = p; mDelayX = new DelayComplex(p.NumerDegree() + 1); mDelayY = new DelayComplex(p.DenomDegree() + 1); mB = new WWComplex[p.NumerDegree() + 1]; for (int i = 0; i < mB.Length; ++i) { mB[i] = p.N(i); } mA = new WWComplex[p.DenomDegree() + 1]; mA[0] = WWComplex.Unity(); for (int i = 1; i < mA.Length; ++i) { mA[i] = WWComplex.Minus(p.D(i)); } }
public IIRFilterBlockReal128(ComplexRationalPolynomial p) { mH = p; mMaxOrder = p.NumerDegree(); if (mMaxOrder < p.DenomDegree()) { mMaxOrder = p.DenomDegree(); } mV = new decimal[mMaxOrder + 1]; mB = new decimal[mMaxOrder + 1]; for (int i = 0; i < mB.Length; ++i) { mB[i] = (decimal)p.N(i).real; } mA = new decimal[mMaxOrder + 1]; mA[0] = 1; for (int i = 1; i < mA.Length; ++i) { mA[i] = (decimal)(-p.D(i).real); } }