Main Content

定点精度规则for Avoiding Overflow in FIR Filters

定点FIR滤波器通常在数字信号处理器,FPGA和ASIC上实现。固定点过滤器使用定点算术,并由具有固定点系数的方程式表示。如果FIR滤波器的累加器和输出没有足够的位来表示其数据,则溢出会发生并扭曲信号。使用这两个规则自动确定FIR过滤精度设置。目的是在避免溢出的同时最大程度地减少资源利用率(内存/存储和处理元素)。由于规则是根据输入精度,系数精度和系数值进行优化的,因此FIR滤波器必须具有非延期系数。

The precision rules define the minimum and the maximum values of the FIR filter output. To determine these values, perform min/max analysis on the FIR filter coefficients.

FIR过滤器的输出限制

FIR滤波器定义为:

y [[ n 这是给予的 = k = 0 n - 1 H k X [[ n - k 这是给予的

  • X[[n这是给予的是输入信号。

  • y [n]是输出信号。

  • Hk一世s thekTh过滤系数。

  • n一世s the length of the filter.

具有真实输入和真实系数的FIR过滤器的输出限制

Let the minimum value of the input signal beX最小, 在哪里X最小≤ 0,最大值是Xm一个X, 在哪里Xm一个X≥ 0。The minimum output occurs when you multiply the positive coefficients byX最小和负系数Xm一个X。Similarly, the maximum output occurs when you multiply the positive coefficients byXm一个X和负系数X最小

如果Thesum of all the positive coefficients is

G + = k = 0 ,,,, H k > 0 n - 1 H k

一个nd the sum of all the negative coefficients is denoted as

G - = k = 0 ,,,, H k < 0 n - 1 H k

Thenyou can express the minimum output of the filter as

y 最小 = G + X 最小 + G - X m一个X

和过滤器的最大输出为

y m一个X = G + X m一个X + G - X 最小

因此,滤波器的输出位于间隔[y最小,,,,ym一个X]。

复杂的滤波卷积方程

您可以根据其信号和系数的真实部分和虚构部分来定义复杂的过滤器(复杂的输入和复杂系数):

回覆 (( y [[ n 这是给予的 = k = 0 n - 1 回覆 (( H k 回覆 (( X [[ n - k 这是给予的 - k = 0 n - 1 Im (( H k Im (( X [[ n - k 这是给予的 Im (( y [[ n 这是给予的 = k = 0 n - 1 回覆 (( H k Im (( X [[ n - k 这是给予的 + k = 0 n - 1 Im (( H k 回覆 (( X [[ n - k 这是给予的

如信号流程图中所示,将复合滤波器分解为四个实际过滤器。每个信号都用一个间隔表示范围注释。

具有复杂输入和复杂系数的FIR过滤器的输出限制

you can extend the real filter min/max analysis to complex filters. Assume that both the real and imaginary parts of the input signal lie in the interval [X最小,,,,Xm一个X]。

复杂的过滤器包含两个实例回覆(Hk。两个过滤器都具有相同的输入范围,因此在间隔中相同的输出范围[v回覆最小,,,,v回覆m一个X]。同样,复杂的过滤器包含两个实例Im(Hk。两个过滤器在间隔中具有相同的输出范围[v我是最小,,,,v我是m一个X]。

根据对真实过滤器的最小/最大分析,您可以表达v回覆最小,,,,v回覆m一个X,,,,v我是最小,,,,一个ndv我是m一个X作为:

v 最小 r e = G r e + X 最小 + G r e - X m一个X v m一个X r e = G r e + X m一个X + G r e - X 最小 v 最小 一世 m = G 一世 m + X 最小 + G 一世 m - X m一个X v m一个X 一世 m = G 一世 m + X m一个X + G 一世 m - X 最小

  • G+回覆一世s the sum of the positive real parts ofHk,由

    G r e + = k = 0 ,,,, 回覆 (( H k > 0 n - 1 回覆 (( H k

  • G-回覆是负面实际部分的总和Hk,由

    G r e - = k = 0 ,,,, 回覆 (( H k < 0 n - 1 回覆 (( H k

  • G+我是一世s the sum of the positive imaginary parts ofHk,由

    G 一世 m + = k = 0 ,,,, Im (( H k > 0 n - 1 Im (( H k

  • G-我是是负面虚构部分的总和Hk,由

    G 一世 m - = k = 0 ,,,, Im (( H k < 0 n - 1 Im (( H k

The minimum and maximum values of the real and imaginary parts of the output are:

y 最小 r e = v 最小 r e - v m一个X 一世 m y m一个X r e = v m一个X r e - v 最小 一世 m y 最小 一世 m = v 最小 r e + v 最小 一世 m y m一个X 一世 m = v m一个X r e + v m一个X 一世 m

输出的真实或虚构部分最低和最大值的最小值和最大值由

y 最小 = 最小 (( y 最小 r e ,,,, y 最小 一世 m y m一个X = m一个X (( y m一个X r e ,,,, y m一个X 一世 m

定点精度规则

定点精度规则根据累加器单词长度和分数长度来定义过滤器的输出单词长度和分数。

完整精确的蓄能器规则

假设输入是带有单词长度的签名或未签名的固定点信号wX和分数长度FX。Also assume that the coefficients are signed or unsigned fixed-point values with fraction lengthFH。现在,您可以定义完整fixed-p精度oint settings that minimize the word length of the accumulator while avoiding overflow or any loss of precision.

  • 累加器分数长度等于产品分数长度,这是输入和系数分数长度的总和。

    F 一个 = F X + F H

  • 如果y最小= 0,然后累加器没有单词长度

    w 一个 = log 2 (( y m一个X 2 F 一个 + 1

如果y最小<0,然后累加器用单词长度签名

w 一个 = log 2 (( m一个X (( - y 最小 2 F 一个 ,,,, y m一个X 2 F 一个 + 1 + 1

CEIL操作员向最近的整数朝向 +∞。

Output Same Word Length as Input Rule

This rule sets the output word length to be the same as the input word length. Then, it adjusts the fraction length to avoid overflow.w一世s the output word length andF是输出分数长度。

截断累加器以使输出单词长度与输入单词长度相同。

w = w X

设置输出分数长度F

F = F 一个 - (( w 一个 - w X

多相插值器和删除器

您可以将这些规则扩展到多相FIR插值器和清除器。

FIR Interpolators

Treat each polyphase branch of the FIR interpolator as a separate FIR filter. The output data type of the FIR interpolator is the worst-case data type of all the polyphase branches.

FIR Decimators

For decimators, the polyphase branches add up at the output. Hence, the output data type is computed as if it were a single FIR filter with all the coefficients of all the polyphase branches.

回覆lated Topics