TMS320F280049C: 自适应陷波滤波器的各个系数计算原理

Part Number: TMS320F280049C
Other Parts Discussed in Thread: PMP23338

TI专家您好!

在示例项目PMP23338中关于自适应陷波滤波器的离散形式系数的计算有疑问要请教下:

在函数SPLL_1PH_NOTCH_coeff_calc中关于A0, A1, A2, B0, B1, B2的表达方式不理解,temp1和temp2的值是如何得到的?

我看了SPRABT3A–July 2013–Revised July 2017这篇文章,但里面关于使用ZOH对陷波滤波器离散化后,没有进一步的各个系数表示方法,只有如下的形式,麻烦帮空解答下,谢谢了!

image.png

//! \brief Calculates the coefficients for SPLL_1PH_NOTCH filter
//! \param *spll_obj The SPLL_1PH_NOTCH structure pointer
//! \param c1 c1 Notch paramater
//! \param c2 c2 Notch Parameter
//! \return None
//!
static inline void SPLL_1PH_NOTCH_coeff_calc(SPLL_1PH_NOTCH *spll_obj,
                                             float32_t c1, float32_t c2)
{
    float32_t notch_freq;
    float32_t temp1,temp2;
    float32_t wn2;
    float32_t Ts, Fs;

    notch_freq=2*3.14159265f*spll_obj->fn;
    Ts = spll_obj->delta_t;
    Fs=1/Ts;

    //
    // pre warp the notch frequency
    //    
    wn2=2*Fs*tanf(notch_freq* ((float32_t)3.141592653589)*Ts);

 

   //下面这些行的系数计算是如何得到的?
    temp1= 4*Fs*Fs + 4* wn2 * c2 * Fs + wn2*wn2;
    temp2= 1/ ( 4*Fs*Fs + 4* wn2 * c1 * Fs + wn2*wn2);

    spll_obj->notch_coeff.b0 = temp1* temp2;
    spll_obj->notch_coeff.b1 = (-8*Fs*Fs + 2* wn2* wn2)* temp2;
    spll_obj->notch_coeff.b2 = (4*Fs*Fs-4*wn2*c2*Fs+wn2*wn2)*temp2;
    spll_obj->notch_coeff.a1 = (-8*Fs*Fs + 2* wn2* wn2)*temp2;
    spll_obj->notch_coeff.a2 = (4*Fs*Fs-4*wn2*c1*Fs+wn2*wn2)*temp2;
}

  • 您好

    已经收到了您的案例,调查需要些时间,感谢您的耐心等待

  • 您好

    The coefficients are derived using the **Bilinear Transform (Tustin's method)** with **frequency pre-warping** to convert the continuous-time notch filter to discrete-time.

    The continuous-time notch filter transfer function: H(s) = (s² + 2·c2·ωₙ·s + ωₙ²) / (s² + 2·c1·ωₙ·s + ωₙ²)
    Where:
    - **ωₙ** = notch frequency (rad/s)
    - **c1** = denominator damping coefficient
    - **c2** = numerator damping coefficient (typically 0 for pure notch)

    Bilinear Transform with Pre-warping: The
     code applies the bilinear transform substitution:
     
    s = (2·Fs) · (z - 1)/(z + 1) Where "Fs" is the sampling frequency.

    Pre-warping corrects frequency distortion: wn2 = 2*Fs*tanf(notch_freq * π * Ts);  // Pre-warped notch frequency
     
    Coefficient Derivation

    After applying the bilinear transform and expanding the transfer function, the discrete-time form becomes:
     
    H(z) = (b0 + b1·z⁻¹ + b2·z⁻²) / (1 + a1·z⁻¹ + a2·z⁻²)
     

    The numerator and denominator polynomials in z have the form:

    Numerator: [4Fs² + 4·wn2·c2·Fs + wn2²]·z² + [-8Fs² + 2·wn2²]·z + [4Fs² - 4·wn2·c2·Fs + wn2²]

    Denominator: [4Fs² + 4·wn2·c1·Fs + wn2²]·z² + [-8Fs² + 2·wn2²]·z + [4Fs² - 4·wn2·c1·Fs + wn2²]

    Regarding temp1 and 2

    temp1 = 
    4*Fs*Fs + 4*wn2*c2*Fs + wn2*wn2;  // Numerator z² coefficient
    temp2 = 1 / (4*Fs*Fs + 4*wn2*c1*Fs + wn2*wn2);  // 1/(Denominator z² coefficient)

    - temp1: The leading coefficient of the numerator polynomial (coefficient of z²)
    - temp2: Normalization factor = reciprocal of the denominator's leading coefficient

    This normalization ensures the denominator's z² coefficient equals 1, which is the standard form for digital filters.

    Final Coefficients

    All coefficients are multiplied by `temp2` to normalize:
    b0 = temp1 * temp2;  // Normalized numerator z⁰ coefficient
    b1 = (-8*Fs*Fs + 2*wn2*wn2) * temp2;  // Numerator z⁻¹ coefficient
    b2 = (4*Fs*Fs - 4*wn2*c2*Fs + wn2*wn2) * temp2;  // Numerator z⁻² coefficient
    a1 = (-8*Fs*Fs + 2*wn2*wn2) * temp2;  // Denominator z⁻¹ coefficient
    a2 = (4*Fs*Fs - 4*wn2*c1*Fs + wn2*wn2) * temp2;  // Denominator z⁻² coefficient

    Why These Specific Forms?

    The polynomial coefficients arise from expanding `(z±1)²` terms in the bilinear transform:

    - 4Fs²: From (2Fs)² when expanding (z-1)² and (z+1)²
    - 4·wn2·c·Fs: From cross-product terms 2·(2Fs)·(c·wn2)
    - wn2²: From the constant ωₙ² term
    - -8Fs²: From -2·(2Fs)² in the z¹ coefficient
    - 2·wn2²: From 2·wn2² in the z¹ coefficient
  • 非常感谢您这么详细的解答,我一直以为文档中所说 自适应陷波滤波器是使用ZOH方法进行离散化处理,原来使用的是双线性方式。