25 #define _USE_MATH_DEFINES 58 double t1 = K/(wn*wn);
59 double t2 = 2*zeta/wn - 1/K;
61 double b0 = 2*K*(1.+t2/2.0f);
63 double b2 = 2*K*(1.-t2/2.0f);
65 double a0 = 1 + t1/2.0f;
67 double a2 = -1 + t1/2.0f;
69 qDebug(
"PhaseLockComplex::computeCoefficients: b_raw: %f %f %f", b0, b1, b2);
70 qDebug(
"PhaseLockComplex::computeCoefficients: a_raw: %f %f %f", a0, a1, a2);
80 qDebug(
"PhaseLockComplex::computeCoefficients: b: %f %f %f",
m_b0,
m_b1,
m_b2);
81 qDebug(
"PhaseLockComplex::computeCoefficients: a: 1.0 %f %f",
m_a1,
m_a2);
127 std::complex<float> x(re, im);
202 if ((dFreq > -0.01) && (dFreq < 0.01))
220 while (angle <= -
M_PI) {
223 while (angle >
M_PI) {
Fixed< IntType, IntBits > cos(Fixed< IntType, IntBits > const &x)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
std::complex< float > m_y
static float normalizeAngle(float angle)
Fixed< IntType, IntBits > sin(Fixed< IntType, IntBits > const &x)
std::complex< float > m_p
void computeCoefficients(Real wn, Real zeta, Real K)
float feed(const float &x)
void setPskOrder(unsigned int order)
void feed(float re, float im)
void setSampleRate(unsigned int sampleRate)