JPS6379409A - Digital filter device - Google Patents

Digital filter device

Info

Publication number
JPS6379409A
JPS6379409A JP22443986A JP22443986A JPS6379409A JP S6379409 A JPS6379409 A JP S6379409A JP 22443986 A JP22443986 A JP 22443986A JP 22443986 A JP22443986 A JP 22443986A JP S6379409 A JPS6379409 A JP S6379409A
Authority
JP
Japan
Prior art keywords
value
bit
digital
bits
stored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP22443986A
Other languages
Japanese (ja)
Inventor
Makoto Goto
誠 後藤
Eiji Ueda
英司 上田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP22443986A priority Critical patent/JPS6379409A/en
Publication of JPS6379409A publication Critical patent/JPS6379409A/en
Pending legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

PURPOSE:To improve the calculation accuracy of a filter by storing a preserved signal value while dividing it into a present sampling value and a preceding sampling value and making a substantial bit number longer so as to eliminate missing of bits. CONSTITUTION:A CPU 23 applies computing processing sequentially according to an instruction stored in an instruction storage section 24. The instruction storage section 24 consists of a ROM, in which the calculation processing of algorithm of the digital filter is stored. An input section 21 samples an input signal and inputs a preceding sampling as required to an information storage section 25. The CPU 23 uses a data of the information storage section 25 comprising RAM to apply filter calculation/processing and outputs (22) the result. In the digital filter device comprising an input section 21, the output section 22, the CPU 23, the instruction storage section 24 and the information storage section 25, the contents of the instruction storage section 24 are constituted properly to form the digital filter. Thus, missing of bits is eliminated and the accuracy of filter is improved.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、所要のフィルタ特性を有する再帰形のデジタ
ルフィルタ器に関するものであり、特に、計算精度が良
く、入力から出力までの演算時間の短いデジタルフィル
タ器を提供するものである。
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention relates to a recursive digital filter having required filter characteristics, and in particular to a digital filter with good calculation accuracy and short calculation time from input to output. The present invention provides a filter device.

従来の技術 近年、制御装置の中にマイクロプロセッサを使用して、
PI制御用フィルタをデジタル的に構成するようになっ
てきた。ここに、Pは比例動作、■は積分動作を意味す
る。このようなPl制御用のデジタルフィルタとしては
、再帰形のデジタルフィルタが利用できる。たとえば、
下記の(11弐に示すパルス伝達関数G (z)を有す
るPI制御用フィルタは、低周波領域に於いて積分特性
を示し、制御装置の特性改善に好適である(公知ではな
い)。
Prior Art In recent years, using microprocessors in control devices,
PI control filters have come to be configured digitally. Here, P means proportional action and ■ means integral action. As such a digital filter for Pl control, a recursive digital filter can be used. for example,
A PI control filter having a pulse transfer function G (z) shown in (112) below exhibits integral characteristics in a low frequency region, and is suitable for improving the characteristics of a control device (not publicly known).

ここに、z −1は1サンプリング時間の遅延を表し、
kは一定値の係数である。第3図に(1)式のデジタル
フィルタの折線近似の周波数特性を示す。第3図の折点
周波数fc以下の低周波領域において、利得(G(z)
の絶対値〕は一6dB10ctの周波数特性となり、低
い周波数になる程利得が太き(なる積分特性になってい
る。また、折点周波数fc以上の周波数領域では、利得
が一定値(約0dB)の比例特性になっている。
Here, z −1 represents a delay of one sampling time,
k is a constant value coefficient. FIG. 3 shows the frequency characteristics of the digital filter of formula (1) approximated by a broken line. In the low frequency region below the corner frequency fc in Fig. 3, the gain (G(z)
] has a frequency characteristic of -6 dB10 ct, and the lower the frequency, the thicker the gain (the integral characteristic becomes. Also, in the frequency region above the corner frequency fc, the gain is a constant value (approximately 0 dB). It has a proportional characteristic.

(1)弐の係数には、サンプリング時間と第3図の折点
周波数fcにより定まる定数である。制御装置に用いる
PI制御用フィルタにおいては、係数には1よりも十分
に小さな値になっている。たとえば、サンプリング時間
T s = 1  (msec) 、折点周波数f c
 =10 (fiz)の時には、k#ν’=0.062
5となる。
(1) The second coefficient is a constant determined by the sampling time and the corner frequency fc in FIG. In a PI control filter used in a control device, the coefficient has a value sufficiently smaller than 1. For example, sampling time T s = 1 (msec), corner frequency f c
When =10 (fiz), k#ν'=0.062
It becomes 5.

次に、(1)式のPI制御用フィルタの計算方法の一例
について、第4図のフローチャートを参照して説明する
。第4図において、Xi、yiはそれぞれ新しい入力信
号値と保存信号値であり、xi−1+yi−Iはそれぞ
れ1サンプリング時点前の入力信号値と保存信号値であ
る。なお、ここでは、各信号値は実数、または無限長の
デジタル値とする。
Next, an example of a method for calculating the PI control filter of equation (1) will be described with reference to the flowchart of FIG. 4. In FIG. 4, Xi and yi are the new input signal value and the saved signal value, respectively, and xi-1+yi-I are the input signal value and the saved signal value, respectively, one sampling time before. Here, each signal value is a real number or an infinitely long digital value.

(31) <ブロック31〉 新しい入力信号値X、をサンプリングする。(31) <Block 31> Sample a new input signal value, X,.

(32)  <ブロック32〉 次式により新しい保存信号値yiを計算する。(32) <Block 32> A new stored signal value yi is calculated by the following equation.

Y i = Y ;−+  +Xi   Xi−+  
” kxi  −−−・−−−−[2)(33) <ブ
ロック33〉 保存信号値yiを出力する。
Y i = Y ;-+ +Xi Xi-+
” kxi ---・----[2) (33) <Block 33> Output the stored signal value yi.

(34)  <ブロック34〉 Xiとy、をそれぞれXl−1とy8−1にする。(34) <Block 34> Let Xi and y be Xl-1 and y8-1, respectively.

(35)  <ブロック35〉 次のサンブリング時点まで遅延した後に、(31)の動
作に移る。
(35) <Block 35> After a delay until the next sampling point, the operation moves to (31).

上記の(31)〜(35)の動作を繰り返して計算すれ
ば、(1)式のPI制御用フィルタの特性を正確に実現
できる。
By repeating and calculating the operations (31) to (35) above, the characteristics of the PI control filter in equation (1) can be accurately realized.

発明が解決しようとする問題点 しかしながら、実際には、マイクロプロセ・ノサによっ
て処理できるデジタル値は有限のビット長であり、有限
精度の計算しか行えない。そのため、打ち切り誤差が発
生し、これによりデジタルフィルタの特性が劣化し、制
御装置に悪影響を生じていた。特に、上記(1)式〇P
I制御用フィルタは積分特性を有するため、打ち切り誤
差の影響が累積して現れてしまう。これについて、16
ビツト長のマイクロプロセッサを使用し、第4図のフロ
ーチャートを実行する場合について説明する。ただし、
ここではに−2−4とする。
Problems to be Solved by the Invention However, in reality, the digital values that can be processed by the microprocessor have a finite bit length and can only perform calculations with finite precision. Therefore, a truncation error occurs, which deteriorates the characteristics of the digital filter and adversely affects the control device. In particular, the above formula (1)〇P
Since the I control filter has integral characteristics, the effects of truncation errors appear cumulatively. Regarding this, 16
A case will be described in which a bit-length microprocessor is used to execute the flowchart in FIG. however,
Here, it is set to -2-4.

まず、第1の方法として、第4図のフローチャートのy
、やyi、、lをそれぞれ16ビツト長の1ワードのデ
ジタル値によって記憶・計算することが考えられる。こ
こで、16ビツト長のデジタル値は、最上位ビットが符
号ビットであり、負の数は2の補数により表現されてい
るものとする。すなわち、16ビツト長のデジタル値を
整数と考えると、−32768から32767までの数
値が表現できる。このとき、デジタルフィルタのkxH
−、の計算は、算術右シフトを利用して計算できる。こ
こで、1ビツトの算術右シフトは実質的に1/2倍に相
当する。従って、K=2−’の時は4ビツトの算術右シ
フトが行われる。ところが、Xl−1やkxよ−1が有
限のビット数(16ビツト)によって表現されているこ
とから、kxi−、の計算において4ビツトの算術右シ
フトを行うと、下位4ビット分の情報のビット落ち(下
位のビット値が失われる現象)が発生する。これにより
フィルタの計算精度が大幅に低下する。特に、PI制御
用フィルタが積分形のフィルタであることから、このビ
ット落ちの影響が累積し、フィルタ精度が大幅に劣化す
る。その結果、制御装置に利用した場合に、制御性能の
劣化を生じていた。
First, as the first method, y
It is conceivable that , yi, , l are each stored and calculated using one word of digital value having a length of 16 bits. Here, it is assumed that in a 16-bit digital value, the most significant bit is a sign bit, and negative numbers are expressed by two's complement. That is, if a 16-bit digital value is considered an integer, a numerical value from -32768 to 32767 can be expressed. At this time, kxH of the digital filter
−, can be calculated using arithmetic right shift. Here, a 1-bit arithmetic shift to the right substantially corresponds to 1/2. Therefore, when K=2-', a 4-bit arithmetic right shift is performed. However, since Xl-1 and kx-1 are expressed by a finite number of bits (16 bits), if a 4-bit arithmetic right shift is performed in the calculation of kxi-, the information for the lower 4 bits is Bit loss (a phenomenon in which lower bit values are lost) occurs. This significantly reduces the calculation accuracy of the filter. In particular, since the PI control filter is an integral type filter, the influence of bit loss accumulates, significantly deteriorating the filter accuracy. As a result, when used in a control device, control performance deteriorates.

このような計算精度の劣化を防止するために、第2の方
法として、16ビツト長の2ワードを使って実質的に3
2ビツトのデジタル値としてyiやYi−+を表現し、
フィルタ計算を行うことが考えられる。
In order to prevent such deterioration in calculation accuracy, a second method is to use two words of 16 bits to effectively calculate 3
Express yi and Yi-+ as 2-bit digital values,
It is conceivable to perform filter calculations.

しかしながら、このような場合には、上位ワードと下位
ワードの両方にまたがる計算が生じるために、計算が非
常に煩雑になる。たとえば、下位ワードから上位ワード
への桁上がりや桁下がりが生じた場合に、32ビツトの
デジタル値として正数の桁上がり、正数の桁下がり、負
数の桁上がり、負数の桁下がりの4つの場合のどれであ
るかを判定する必要が生じる。この判定には、多くの比
較計算や条件分岐が必要である。その結果、計算時間が
非常に長くなるという欠点がある。このPI制御用フィ
ルタの入力から出力までの演算時間は、制御装置の制御
時間遅れに相当する。制御時間遅れが大きくなると、制
御装置全体の安定性を確保するためには、制御利得を小
さくしなければならない。従って、PI制御用フィルタ
の演算時間は極力小さいことが要求される。
However, in such a case, calculations involving both the upper and lower words occur, making the calculations extremely complicated. For example, when a carry or a carry down occurs from a lower word to a higher word, there are four types of 32-bit digital value: positive number carry, positive number carry down, negative number carry, and negative number carry down. It becomes necessary to determine which of the cases is the case. This determination requires many comparative calculations and conditional branches. As a result, the disadvantage is that the calculation time becomes very long. The calculation time from the input to the output of this PI control filter corresponds to the control time delay of the control device. When the control time delay becomes large, the control gain must be reduced in order to ensure the stability of the entire control device. Therefore, the calculation time of the PI control filter is required to be as short as possible.

本発明は、このような点を考慮して、計算精度を向上さ
せながらも、入力から出力までの演算時間を短くしたデ
ジタルフィルタ器を提供するものである。
The present invention takes these points into consideration and provides a digital filter that shortens the calculation time from input to output while improving calculation accuracy.

問題点を解決するための手段 本発明では、サンプリング周期毎にnビット長の入力信
号値を得る入力手段と、前記入力信号値と第1保存値を
算術演算して出力信号値を得る出力演算手段と、前記出
力信号値を出力する出力手段と、現時点、もしくはそれ
以前のサンプリング時点の前記入力信号値に対応した値
と第2保存値を算術演算してnビット長の第1のデジタ
ル値を得る第1の演算手段と、前記第1のデジタル値を
実質的にJビット(ここに、Jは1≦Jonなる整数)
の算術右シフトしたnビット長の第2のデジタル値を得
る第2の演算手段と、第1保存値と前記第2のデジタル
値の算術合成値を表すnビット長の第3のデジタル値を
得る第3の演算手段と、前記第3のデジタル値を新しい
前記第1保存値とする第1の更新手段と、最下位ビット
から第3位ビットまでの下位Jビットの内容を前記第1
のデジタル値の下位Jビットの内容と一致させ、最上位
ビットから第(J+1)位ビットまでの上位(n−J)
ビットの各ビット値を前記第1のデジタル値の符号ビッ
トと同じ値にしたnビット長の第4のデジタル値を得る
第4の演算手段と、前記第4のデジタル値を新しい前記
第2保存値とする第2の更新手段を具備するデジタルフ
ィルタ器とすることによって、上記の問題点を解決して
いる。
Means for Solving the Problems The present invention includes an input means for obtaining an input signal value of n-bit length for each sampling period, and an output operation for performing an arithmetic operation on the input signal value and a first stored value to obtain an output signal value. means for outputting the output signal value; and a first digital value having an n-bit length by performing an arithmetic operation on a value corresponding to the input signal value at the current or previous sampling time and a second stored value. a first arithmetic means for obtaining the first digital value, and substantially J bits (here, J is an integer such that 1≦Jon);
a second arithmetic means for obtaining an n-bit long second digital value which is arithmetic right-shifted; and an n-bit third digital value representing an arithmetic composite value of the first stored value and the second digital value. a third calculating means for calculating the third digital value; a first updating means for setting the third digital value as a new first stored value;
The contents of the lower J bits of the digital value are matched, and the upper (n-J) from the most significant bit to the (J+1)th bit are
a fourth arithmetic means for obtaining a fourth digital value having an n-bit length in which each bit value is set to the same value as the sign bit of the first digital value; The above problem is solved by using a digital filter device that is equipped with a second updating means for updating the value.

作用 本発明では上記の構成にすることによって、保存信号値
が第1保存値と第2保存値に分けて保存されているため
に、保存信号値の実質的なビット長がnビットよりも長
くなり、ビット落ちがなくなる、もしくは非常に少なく
なる。その結果、フィルタ計算の精度が向上する。また
、第1保存値と第2保存値がそれぞれ符号付きのデジタ
ル値であることから、第2保存値と入力信号値の演算結
果の第(J+l)位ビット以上の数値を第1保存値に加
減算することが簡単になる。さらに、入力信号値と第1
保存値を算術演算するだけで出力信号値を得ているので
、入力から出力までの演算時間が極めて短い。
Operation In the present invention, with the above configuration, the stored signal value is stored separately into the first stored value and the second stored value, so the actual bit length of the stored signal value is longer than n bits. This results in no bit loss or very little bit loss. As a result, the accuracy of filter calculations is improved. In addition, since the first stored value and the second stored value are each signed digital values, a value equal to or higher than the (J+l)th bit of the operation result of the second stored value and the input signal value is set as the first stored value. It becomes easy to add and subtract. Furthermore, the input signal value and the first
Since the output signal value is obtained by simply performing arithmetic operations on the stored values, the calculation time from input to output is extremely short.

実施例 以下に本発明のデジタルフィルタ器の一実施例について
、図面を参照しながら説明する。
Embodiment An embodiment of the digital filter according to the present invention will be described below with reference to the drawings.

第2図に本発明のデジタルフィルタ器のハードウェアの
基本構成図を示す。中央処理部23は、命令記憶部24
に記憶されている命令に従って順次計算・処理を行う。
FIG. 2 shows a basic configuration diagram of the hardware of the digital filter device of the present invention. The central processing unit 23 has an instruction storage unit 24
Calculations and processing are performed sequentially according to the instructions stored in the .

命令記憶部24は、ロム(ROM : ReadOnl
y Memory)によって構成され、デジタルフィル
タの計算処理アルゴリズムが格納されている。入力部2
1は、制御装置の検出信号等の入力信号をサンプリング
し、16ビツト長のデジタル値になおして中央処理部2
3に入力する。中央処理部23では、ラム(RAM:R
andam Access Memory)により構成
された情報記憶部25を使用してフィルタ計算・処理を
行い、その計算結果を出力部22に送る。出力部22に
送られた出力信号値は、制御装置の制御信号として利用
される。このような人力部21.出力部22゜中央処理
部23(マイクロプロセッサ)、命令記憶部24.情報
記憶部25からなるデジタルフィルタ器では、命令記憶
部24の内容を適当に構成することによって、(1)式
のパルス伝達関数G (z)を有するデジタルフィルタ
を実現することができる。
The instruction storage unit 24 is a ROM (ROM: ReadOnl).
y Memory), and stores the calculation processing algorithm of the digital filter. Input section 2
1 samples an input signal such as a detection signal of a control device, converts it into a 16-bit digital value, and sends it to the central processing unit 2.
Enter 3. In the central processing unit 23, RAM (RAM: R
Filter calculations and processing are performed using the information storage unit 25 configured with a memory (andam access memory), and the calculation results are sent to the output unit 22. The output signal value sent to the output unit 22 is used as a control signal for the control device. Such a human resources department 21. Output unit 22°, central processing unit 23 (microprocessor), instruction storage unit 24. In the digital filter device including the information storage section 25, by appropriately configuring the contents of the instruction storage section 24, it is possible to realize a digital filter having the pulse transfer function G (z) of equation (1).

第1図に(1)式のデジタルフィルタを実現するための
本発明のデジタルフィルタ器の動作フローチャートを示
す。なお、以下の説明においては、中央処理部23や情
報記憶部25の処理ビット数を16ビツトとし、(11
式の係数はに=2−’とする。また、第1図のX、R,
U、Wはそれぞれ16ビツト長(n=16)のデジタル
値であり、最上位ビットを符号ピントとし、負の数値は
2の補数により表現されているものとする。
FIG. 1 shows an operation flowchart of the digital filter device of the present invention for realizing the digital filter of formula (1). In the following explanation, it is assumed that the number of processing bits of the central processing unit 23 and the information storage unit 25 is 16 bits, and (11
The coefficient of the equation is 2-'. Also, X, R,
It is assumed that U and W are each 16-bit digital values (n=16), the most significant bit is the sign focus, and negative numbers are expressed as two's complement numbers.

(1)〈ブロック1:入力ブロック〉 入力部2工から16ビツト長のデジタル値として入力信
号値Xiを入力する。
(1) <Block 1: Input block> The input signal value Xi is input as a 16-bit digital value from the input section 2.

(2)<ブロック2:出力演算ブロック〉入力信号値X
iと情報記憶部25に記憶しておいた第1保存値Wl 
 (後述)を算術加算した出力信号値Yiを得る。
(2) <Block 2: Output calculation block> Input signal value X
i and the first stored value Wl stored in the information storage unit 25
(described later) is arithmetic added to obtain an output signal value Yi.

(3)<ブロック3:出力ブロック〉 出力信号値Yiを出力部22に出力する。(3) <Block 3: Output block> The output signal value Yi is output to the output section 22.

(4)<ブロック4:第1の演算ブロック〉入力信号値
Xiを1ビツト算術右シフトしたデジタル値R1を計算
する。次に、情報記憶部25に記憶しておいた第2保存
値W2(後述)とデジタル値R1を算術加算し、第1の
デジタル値U1を得る。
(4) <Block 4: First calculation block> A digital value R1 is calculated by arithmetic shifting the input signal value Xi by 1 bit to the right. Next, the second stored value W2 (described later) stored in the information storage unit 25 and the digital value R1 are arithmetically added to obtain the first digital value U1.

(5)<ブロック5:第2の演算ブロック〉第1のデジ
タル値U1を3ビツト算術右シフトした第2のデジタル
値U2を得る。
(5) <Block 5: Second calculation block> A second digital value U2 is obtained by arithmetic right-shifting the first digital value U1 by 3 bits.

(6)<ブロック6:第3の演算ブロック〉第1保存値
Wlと第2のデジタル値U2を算術加算した第3のデジ
タル値U3を得る。
(6) <Block 6: Third calculation block> A third digital value U3 is obtained by arithmetically adding the first stored value Wl and the second digital value U2.

(7)〈ブロック7:第1の更新ブロック〉第3のデジ
タル値U3を新しい第1保存値W1として情報記憶部2
5に更新保存する。
(7) <Block 7: First update block> The information storage unit 2 uses the third digital value U3 as the new first stored value W1.
Update and save to 5.

(8)<ブロック8:第4の演算ブロック〉第1のデジ
タル値U1と16進数値8000)1の論理積(AND
)をと、す、デジタル値R2を作る。デジタル値R2を
12ビツト算術右シフトしたデジタル値R3を得る。こ
れにより、デジタル値R3は、最下位ビット(第1位ビ
ット)から第3位ビットまでの下位3ビツトの各ビット
値がO2第4ビツトから最上位ビット(第16位ビット
)までの上位13ビツトの各ビット値が第1のデジタル
値U1の符号ビットの値に等しくなる。
(8) <Block 8: Fourth calculation block> Logical product (AND) of first digital value U1 and hexadecimal value 8000)
) to create a digital value R2. A digital value R3 is obtained by arithmetic right-shifting the digital value R2 by 12 bits. As a result, in the digital value R3, each bit value of the lower 3 bits from the least significant bit (1st bit) to the 3rd bit is O2, and the higher 13 bit values from the 4th bit to the most significant bit (16th bit) The value of each bit of the bit is equal to the value of the sign bit of the first digital value U1.

次に、第1のデジタル値U1と16進数値000711
の論理積(AND)をとり、デジタル値R4を作る。さ
らに、デジタル値R3とデジタル値R4の論理和(OR
)を計算し、第4のデジタル値U4を得る。これにより
、第4のデジタル値U4の最下位ビットから第3位ビッ
トまでの下位3ビツトの内容は上記第1のデジタル値U
1の下位3ビツトの内容と一致し、第4のデジタル値U
4の第4位ビットから最上位ビットまでの上位13ビツ
トの各ビット値は上記第1のデジタル値U1の符号ビッ
トと同じ値になる。
Next, the first digital value U1 and the hexadecimal value 000711
A logical product (AND) is taken to create a digital value R4. Furthermore, the logical sum (OR) of the digital value R3 and the digital value R4 is
) to obtain the fourth digital value U4. As a result, the contents of the lower 3 bits from the least significant bit to the 3rd bit of the fourth digital value U4 are the same as those of the first digital value U.
1, and the fourth digital value U
Each bit value of the upper 13 bits from the 4th bit to the most significant bit of 4 becomes the same value as the sign bit of the first digital value U1.

(9)〈ブロック9:第2の更新ブロック〉第4のデジ
タル値U4を新しい第2保存値W2として情報記憶部2
5に更新保存する。
(9) <Block 9: Second update block> The information storage unit 2 uses the fourth digital value U4 as the new second stored value W2.
Update and save to 5.

αψ くブロック10:遅延ブロック〉次のサンプリン
グ時点まで遅延した後に、ブロック1の動作(1)に復
帰する。
αψ Block 10: Delay block> After delaying until the next sampling point, the operation returns to block 1 (1).

上記の本実施例の構成によって、(1)式のデジタルフ
ィルタが実現されている。これについて説明する。まず
、ブロック4からブロック9において、入力信号値Xi
を保存信号値(第1保存値W1と第2保存値W2)に累
積保存している。特に、R1の計算時の1ビツト算術右
シフトとU2の計算時の3ビツト算術右シフトによって
、係数に=21倍が行われている。この保存信号値(W
lとW2)は、第2保存値W2の数値が下位3ビツトに
よって表される数値に制限され(ブロック8とプロ・ν
り9)、それ以上の数値については第1保存値W1が有
するようにしている(ブロック4からブロツク7)。1
サンプリング時点前に計算されtいる第1保存値W1と
人力信号値Xiを加算して出力信号値Yiが計算されて
いる(ブロック2)。
The configuration of this embodiment described above realizes the digital filter of formula (1). This will be explained. First, in blocks 4 to 9, the input signal value Xi
are cumulatively stored as stored signal values (first stored value W1 and second stored value W2). In particular, the 1-bit arithmetic right shift when calculating R1 and the 3-bit arithmetic right shift when calculating U2 cause the coefficient to be multiplied by =21. This stored signal value (W
l and W2), the numerical value of the second stored value W2 is limited to the numerical value represented by the lower 3 bits (block 8 and pro-v).
9), and the first stored value W1 has values larger than that (blocks 4 to 7). 1
The output signal value Yi is calculated by adding the first stored value W1 calculated before the sampling time and the human input signal value Xi (block 2).

その結果、入力信号値Xiから出力信号値Yiへの伝達
関数は(11式と一致する。
As a result, the transfer function from the input signal value Xi to the output signal value Yi matches Equation 11.

このように構成した本実施例では、第1保存値W1と第
2保存値W2を使って保存信号値を更新・保存している
。特に、第1保存値W1と第2保存値W2がそれぞれ独
立に符号ビットを有し、かつ、第1保存値W1の最下位
ビットが数値的に第2保存値W2の第4位ビットに相当
するようにしている。従って、保存信号値のビット数は
実質的に16ビツト (n=16)よりも3ビツト分〔
J=3ビット分〕長くなる。これにより、入力信号値X
iを用いたフィルタ演算の精度が向上し、ビット落ちを
なくす、もしくは非常に少なくすることができる。なお
、第2保存値W2の保存数値を下位の3ビツト〔Jビッ
ト〕で表せる数値に制限し、これよりも大きな数値に関
しては第1保存値W1の方に移すようにして、第1保存
値Wlと第2保存値W2が補い合って保存信号値を表す
ようにしている。
In this embodiment configured in this manner, the stored signal value is updated and stored using the first stored value W1 and the second stored value W2. In particular, the first stored value W1 and the second stored value W2 each independently have a sign bit, and the least significant bit of the first stored value W1 numerically corresponds to the fourth-order bit of the second stored value W2. I try to do that. Therefore, the number of bits of the stored signal value is actually 3 bits rather than 16 bits (n=16).
J = 3 bits] longer. As a result, the input signal value
The accuracy of the filter calculation using i is improved, and bit loss can be eliminated or significantly reduced. Note that the stored numerical value of the second stored value W2 is limited to a value that can be expressed by the lower 3 bits (J bits), and larger numerical values are moved to the first stored value W1. Wl and the second stored value W2 complement each other to represent the stored signal value.

また、新しい入力信号(!Xiを入力した時から新しい
出力信号値Yiを得るまでの演算処理には(ブロック1
からブロック3)、比較計算や条件分岐を全く使ってい
ない。従って、この間の演算時間は非常に小さな一定値
になる。特に、入力信号値Xiとあらかじめ計算してお
いた第1保存値W1を算術加算するだけで出力信号値Y
iが得られるので、新しい入力信号値Xiを得てから新
しい出力信号値Yiを得るまでの演算時間は極めて短い
。これにより、本実施例のデジタルフィルタ器を制御装
置のPI制御用フィルタに使用した場合に、制御時間遅
れの小さいフィルタが実現できる。
In addition, for calculation processing from inputting a new input signal (!Xi) to obtaining a new output signal value Yi, (block 1
From block 3), no comparison calculations or conditional branching are used. Therefore, the computation time during this period is a very small constant value. In particular, the output signal value Y can be calculated simply by arithmetic addition of the input signal value Xi and the first stored value W1 calculated in advance.
Since i is obtained, the computation time from obtaining a new input signal value Xi to obtaining a new output signal value Yi is extremely short. As a result, when the digital filter device of this embodiment is used as a PI control filter of a control device, a filter with small control time delay can be realized.

また、(1)式のパルス伝達関数G (z)を実現した
前述の実施例において、ブロック4のR1の計算を適時
変更すれば、(11式の係数kが2の負の整数束でない
場合でも実現可能である。さらに、Xi+W2がオーバ
ーフローをほとんど生じることがないと思われる場合に
は、R1をxiに等しくすることも可能である。
In addition, in the above-mentioned embodiment in which the pulse transfer function G (z) of equation (1) is realized, if the calculation of R1 in block 4 is changed appropriately, (if the coefficient k of equation 11 is not a negative integer bundle of 2) Furthermore, if it is believed that Xi+W2 will hardly cause overflow, it is also possible to make R1 equal to xi.

−aに、サンプリング周期毎にnビット長の入力信号値
を得る入力手段と、前記人力信号値と第1保存値を算術
演算して出力信号値を得る出力演算手段と、前記出力信
号値を出力する出力手段と、現時点、もしくはそれ以前
のサンプリング時点の前記入力信号値に対応した値と第
2保存値を算術演算してnビット長の第1のデジタル値
を得る第1の演算手段と、前記第1のデジタル値を実質
的にJビット(ここに、Jは1≦Jonなる整数)の算
術右シフトしたnビット長の第2のデジタル値を得る第
2の演算手段と、第1保存値と前記第2のデジタル値の
算術合成値を表すnビット長の第3のデジタル値を得る
第3の演算手段と、前記第3のデジタル値を新しい前記
第1保存値とする第1の更新手段と、最下位ビットから
第3位ビットまでの下位Jビットの内容を前記第1のデ
ジタル値の下位Jビットの内容と一致させ、最上位ビッ
トから第(J+1)位ビットまでの上位(n−J)ビッ
トの各ビット値を前記第1のデジタル値の符号ビットと
同じ値にしたnビット長の第4のデジタル値を得る第4
の演算手段と、前記第4のデジタル値を新しい前記第2
保存値とする第2の更新手段を具備するデジタルフィル
タ器を構成するならば、(1)式のパルス伝達関数G 
(z)と同じ、もしくはほぼ同じフィルタ特性を有する
デジタルフィルタを高精度に実現できる。また、入力か
ら出力までの演算時間も短くなる。
-a, an input means for obtaining an input signal value of n bit length for each sampling period; an output calculation means for performing an arithmetic operation on the human input signal value and the first stored value to obtain an output signal value; an output means for outputting an output, and a first calculation means for performing an arithmetic operation on a value corresponding to the input signal value at the present time or a previous sampling time and a second stored value to obtain a first digital value having an n-bit length. , a second arithmetic means for obtaining a second digital value having an n-bit length by substantially arithmetic right-shifting the first digital value by J bits (here, J is an integer such that 1≦Jon); third arithmetic means for obtaining a third digital value of n bit length representing an arithmetic composite value of the stored value and the second digital value; updating means, the contents of the lower J bits from the least significant bit to the third bit are made to match the contents of the lower J bits of the first digital value, and the contents of the lower J bits from the most significant bit to the (J+1)th bit are updated. A fourth method for obtaining an n-bit long fourth digital value in which each bit value of (n-J) bits is set to the same value as the sign bit of the first digital value.
calculating means for converting the fourth digital value into a new second digital value.
If a digital filter equipped with a second updating means for storing values is constructed, the pulse transfer function G of equation (1)
A digital filter having the same or almost the same filter characteristics as (z) can be realized with high precision. Furthermore, the calculation time from input to output is also shortened.

なお、前述の実施例の情報記憶部25には、記憶内容の
書換え可能なレジスタやラムメモリが使用される。また
、前述の実施例では、入力部21と出力部22を独立に
構成したが、実際には、入力部21や出力部22を情報
記憶部25のメモリやレジスタによって代用しても良く
、本発明に含まれることは言うまでもない。また、制御
装置の検出信号等を使ってサンプリング周期を決めるよ
うにしても良く、本発明に含まれることは言うまでもな
い。さらに、中央処理部23が空き時間にフィルタ計算
以外の他の計算・処理をすることも可能である。その他
、本発明の主旨をかえずして種々の変形が可能で有る。
Note that the information storage section 25 in the above-described embodiment uses a register or a RAM memory whose storage contents can be rewritten. Further, in the above embodiment, the input section 21 and the output section 22 are configured independently, but in reality, the input section 21 and the output section 22 may be substituted by the memory or register of the information storage section 25; Needless to say, it is included in the invention. Further, the sampling period may be determined using the detection signal of the control device, etc., and it goes without saying that this is included in the present invention. Furthermore, it is also possible for the central processing unit 23 to perform calculations and processes other than filter calculations during free time. In addition, various modifications can be made without changing the spirit of the present invention.

発明の効果 本発明のデジタルフィルタ器は、計算精度が良く、入力
から出力までの演算時間も極めて短い。
Effects of the Invention The digital filter device of the present invention has good calculation accuracy and extremely short calculation time from input to output.

従って、本発明に基づき、制御装置のPI制御用フィル
タを実現するデジタルフィルタ器を構成するならば、高
性能な制御装置が実現できる。
Therefore, if a digital filter device that realizes a PI control filter of a control device is constructed based on the present invention, a high-performance control device can be realized.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明のデジタルフィルタ器の動作を表すフロ
ーチャート図、第2図は本発明のデジタルフィルタ器の
ハードウェアの基本構成図、第3図はデジタルフィルタ
の周波数特性図、第4図はデジタルフィルタの計算方法
の一例を示すフローチャート図である。 21・・・・・・入力部、22・・・・・・出力部、2
3・・・・・・中央処理部、24・・・・・・命令記憶
部、25・・・・・・情報記憶部。 代理人の氏名 弁理士 中尾敏男 はか1名第2図 2+        23       22第3図
FIG. 1 is a flowchart showing the operation of the digital filter of the present invention, FIG. 2 is a basic configuration diagram of the hardware of the digital filter of the present invention, FIG. 3 is a frequency characteristic diagram of the digital filter, and FIG. 4 is a diagram of the frequency characteristics of the digital filter. FIG. 2 is a flowchart diagram illustrating an example of a digital filter calculation method. 21...Input section, 22...Output section, 2
3...Central processing unit, 24...Instruction storage unit, 25...Information storage unit. Name of agent: Patent attorney Toshio Nakao (1 person) Figure 2 2+ 23 22 Figure 3

Claims (1)

【特許請求の範囲】[Claims] サンプリング周期毎にnビット長の入力信号値を得る入
力手段と、前記入力信号値と第1保存値を算術演算して
出力信号値を得る出力演算手段と、前記出力信号値を出
力する出力手段と、現時点、もしくはそれ以前のサンプ
リング時点の前記入力信号値に対応した値と第2保存値
を算術演算してnビット長の第1のデジタル値を得る第
1の演算手段と、前記第1のデジタル値を実質的にJビ
ット(ここに、Jは1≦J<nなる整数)の算術右シフ
トしたnビット長の第2のデジタル値を得る第2の演算
手段と、第1保存値と前記第2のデジタル値の算術合成
値を表すnビット長の第3のデジタル値を得る第3の演
算手段と、前記第3のデジタル値を新しい前記第1保存
値とする第1の更新手段と、最下位ビットから第J位ビ
ットまでの下位Jビットの内容を前記第1のデジタル値
の下位Jビットの内容と一致させ、最上位ビットから第
(J+1)位ビットまでの上位(n−J)ビットの各ビ
ット値を前記第1のデジタル値の符号ビットと同じ値に
したnビット長の第4のデジタル値を得る第4の演算手
段と、前記第4のデジタル値を新しい前記第2保存値と
する第2の更新手段を具備するデジタルフィルタ器。
an input means for obtaining an input signal value of n-bit length every sampling period; an output calculation means for performing an arithmetic operation on the input signal value and a first stored value to obtain an output signal value; and an output means for outputting the output signal value. and a first calculation means for calculating a first digital value having an n-bit length by performing an arithmetic operation on a value corresponding to the input signal value at the current point in time or a previous sampling point and a second stored value; a second arithmetic means for obtaining a second digital value having an n-bit length by substantially arithmetic right-shifting the digital value by J bits (here, J is an integer such that 1≦J<n); and a first storage value. and third arithmetic means for obtaining a third digital value of n bit length representing an arithmetic composite value of the second digital value; and a first update for making the third digital value a new first stored value. means, the contents of the lower J bits from the least significant bit to the J-th bit are made to match the contents of the lower J bits of the first digital value, and the contents of the lower J bits from the most significant bit to the (J+1)th bit are - J) fourth arithmetic means for obtaining a fourth digital value of n-bit length in which each bit value of the bits is set to the same value as the sign bit of the first digital value; A digital filter device comprising second updating means for setting a second stored value.
JP22443986A 1986-09-22 1986-09-22 Digital filter device Pending JPS6379409A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22443986A JPS6379409A (en) 1986-09-22 1986-09-22 Digital filter device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22443986A JPS6379409A (en) 1986-09-22 1986-09-22 Digital filter device

Publications (1)

Publication Number Publication Date
JPS6379409A true JPS6379409A (en) 1988-04-09

Family

ID=16813787

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22443986A Pending JPS6379409A (en) 1986-09-22 1986-09-22 Digital filter device

Country Status (1)

Country Link
JP (1) JPS6379409A (en)

Similar Documents

Publication Publication Date Title
JP7096828B2 (en) Devices and methods for processing input operand values
JPS63245518A (en) Dividing arithmetic unit
JPH04291418A (en) Pre-processor for division circuit
JPH0519170B2 (en)
JPS6379409A (en) Digital filter device
JPS6378607A (en) Digital filter instrument
Pan Parallel complexity of computations with general and Toeplitz-like matrices filled with integers and extensions
JPS6378606A (en) Digital filter instrument
JPS6382012A (en) Digital filter device
JPS63186329A (en) Pre-processor for trigonometric function
JPS6379410A (en) Digital filter device
JPS63234712A (en) Digital filter device for control
JP2508286B2 (en) Square root calculator
JP2951685B2 (en) Fixed-point arithmetic unit
JPH0585924B2 (en)
JP2777265B2 (en) High radix square root arithmetic unit
JPS63125013A (en) Digital filter device
JPS63107308A (en) Digital filter device
JP2584516B2 (en) Opening calculator
JP2550597B2 (en) Squarer
JPH0419571B2 (en)
JPS5939773B2 (en) Logarithmic function calculation method
JPS62182841A (en) Square root arithmetic system
JPH05313856A (en) Arithmetic processing method for digital filter
JPS63168772A (en) Accumulator