# series_iir()series_iir()

• 计算序列的累计和to calculate the cumulative sum of the series
• 应用平滑操作to apply smoothing operations
• 应用各种高通、带通和低通滤波器to apply various high-pass, band-pass, and low-pass filters

## 语法Syntax

`series_iir(`x`,` b `,` a`)``series_iir(`x`,` b `,` a`)`

## 参数Arguments

• x：动态数组单元格（数值数组），通常是 make-seriesmake_list 运算符生成的输出。x : Dynamic array cell that is an array of numeric values, typically the resulting output of make-series or make_list operators.
• b：一个常量表达式，其中包含滤波器的分子系数（存储为由数值组成的动态数组）。b : A constant expression containing the numerator coefficients of the filter (stored as a dynamic array of numeric values).
• a：一个常量表达式，例如 b。a : A constant expression, like b . 包含滤波器的分母系数。Containing the denominator coefficients of the filter.

`a` 的第一个元素（即 `a[0]`）不得为零，以避免除以 0 的现象发生。The first element of `a` (that is, `a[0]`) mustn't be zero, to avoid division by 0. 请查看下面的公式See the formula below.

## 滤波器的递归公式The filter's recursive formula

• 假设输入数组为 X，系数数组 a 和 b 的长度分别为 n_a 和 n_b。Consider an input array X, and coefficients arrays a and b of lengths n_a and n_b respectively. 滤波器的传递函数（会生成输出数组 Y）的定义如下：The transfer function of the filter that will generate the output array Y, is defined by:
Yi = a0-1(b0Xi + b1Xi-1 + ... + bnb-1Xi-nb-1 - a1Yi-1-a2Yi-2 - ... - ana-1Yi-na-1)Yi = a0-1(b0Xi + b1Xi-1 + ... + bnb-1Xi-nb-1 - a1Yi-1-a2Yi-2 - ... - ana-1Yi-na-1)

## 示例Example

``````let x = range(1.0, 10, 1);
print x=x, y = series_iir(x, dynamic([1]), dynamic([1,-1]))
| mv-expand x, y
``````
xx yy
1.01.0 1.01.0
2.02.0 3.03.0
3.03.0 6.06.0
4.04.0 10.010.0

``````let vector_sum=(x:dynamic)
{
let y=array_length(x) - 1;
toreal(series_iir(x, dynamic([1]), dynamic([1, -1]))[y])
};
print d=dynamic([0, 1, 2, 3, 4])
| extend dd=vector_sum(d)
``````
dd dddd
`[0,1,2,3,4]` `10`