61 class IIR_EXPORT LayoutBase
73 , m_maxPoles (maxPoles)
78 void setStorage (
const LayoutBase& other)
81 m_maxPoles = other.m_maxPoles;
82 m_pair = other.m_pair;
90 int getNumPoles ()
const
95 int getMaxPoles ()
const
100 void add (
const complex_t& pole,
const complex_t& zero)
103 throw_invalid_argument(errCantAdd2ndOrder);
104 if (Iir::is_nan(pole))
105 throw_invalid_argument(errPoleisNaN);
106 if (Iir::is_nan(zero))
107 throw_invalid_argument(errZeroisNaN);
112 void addPoleZeroConjugatePairs (
const complex_t& pole,
113 const complex_t& zero)
116 throw_invalid_argument(errCantAdd2ndOrder);
117 if (Iir::is_nan(pole))
118 throw_invalid_argument(errPoleisNaN);
119 if (Iir::is_nan(zero))
120 throw_invalid_argument(errZeroisNaN);
122 pole, zero, std::conj (pole), std::conj (zero));
129 throw_invalid_argument(errCantAdd2ndOrder);
131 throw_invalid_argument(errPolesNotComplexConj);
133 throw_invalid_argument(errZerosNotComplexConj);
134 m_pair[m_numPoles/2] =
PoleZeroPair (poles.first, zeros.first,
135 poles.second, zeros.second);
141 if ((pairIndex < 0) || (pairIndex >= (m_numPoles+1)/2))
142 throw_invalid_argument(pairIndexOutOfBounds);
143 return m_pair[pairIndex];
148 return getPair (pairIndex);
151 double getNormalW ()
const
156 double getNormalGain ()
const
161 void setNormal (
double w,
double g)
171 double m_normalW = 0;
172 double m_normalGain = 1;