JPS6382012A - Digital filter device - Google Patents

Digital filter device

Info

Publication number
JPS6382012A
JPS6382012A JP22669986A JP22669986A JPS6382012A JP S6382012 A JPS6382012 A JP S6382012A JP 22669986 A JP22669986 A JP 22669986A JP 22669986 A JP22669986 A JP 22669986A JP S6382012 A JPS6382012 A JP S6382012A
Authority
JP
Japan
Prior art keywords
value
bit
stored
digital
input signal
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.)
Granted
Application number
JP22669986A
Other languages
Japanese (ja)
Other versions
JPH0770960B2 (en
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 JP22669986A priority Critical patent/JPH0770960B2/en
Publication of JPS6382012A publication Critical patent/JPS6382012A/en
Publication of JPH0770960B2 publication Critical patent/JPH0770960B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)
  • Feedback Control In General (AREA)

Abstract

PURPOSE:To shorten the time of arithmetic from input to output while improving calculation accuracy by dividing a stored signal value into two parts and storing them as digital values with signs. CONSTITUTION:An input part 21 samples an input signal such as the detection signal of a controller and the sampled value is converted into a 16-bit digital value, which is inputted to a central processing part 23. The central processing part 23 performs filter calculation processing by using an information storage part 25 consisting of RAM and sends the calculation result to an output part 22. The 1st stored value W1 and the 2nd stored value W2 have sign bits individually and the least significant digit bit of the 1st stored value W1 corresponds numerically to the 4th digit bit (Q=4) of the 2nd stored value W2. Consequently, the accuracy of the filter arithmetic using the input signal value is improve and bit absence is eliminated or reduced greatly.

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.

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

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

(1)式の係数には、サンプリング時間と第3図の折点
周波数f。により定まる定数である。制御装置に用いる
P■制御用フィルタにおいては、係数には1よりも十分
に小さな値になっている。たとえば、サンプリング時間
 T、 = 1 (msec) 、折点周波数 f。−
10(Hz)の時には、k#24−0.0625となる
The coefficients of equation (1) include the sampling time and the corner frequency f in FIG. It is a constant determined by In the P■ control filter used in the control device, the coefficient has a value sufficiently smaller than 1. For example, sampling time T, = 1 (msec), corner frequency f. −
At 10 (Hz), k#24-0.0625.

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

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

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

yI ””I−1+xI  ”I−1十k”I−1・・
・・・・(2) (33) <ブロック33〉 保存信号値y1を出力する。
yI ””I-1+xI ”I-10k”I-1...
...(2) (33) <Block 33> Output the stored signal value y1.

(34) <ブロック34〉 Xiとylをそれぞれxl−1とyl−1にする。(34) <Block 34> Let Xi and yl be xl-1 and yl-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 the above operations (31) to (35) and calculating, the characteristics of the PI control filter of formula +1 can be accurately realized.

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

まず、第1の方法として、第4図のフローチャートのy
lやyl−1をそれぞれ16ビツト長の1ワードのデジ
タル値によって記憶・計算することが考えられる。ここ
で、16ビツト長のデジタル値は、最上位ビットが符号
ビットであり、負の数は2の補数により表現されている
ものとする。すなわち、16ビツト長のデジタル値を整
数と考えると、−32768から32767までの数値
が表現できる。このとき、(2)式のkXl−1の計算
は、算術右シフトを利用して計算できる。ここで、1ビ
ツトの算術右シフトは実質的にη倍に相当する。
First, as the first method, y
It is conceivable that l and yl-1 are each stored and calculated as one-word digital values of 16-bit length. 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, kXl-1 in equation (2) can be calculated using arithmetic right shift. Here, a 1-bit arithmetic shift to the right substantially corresponds to η times.

従って、k−24の時は4ビツトの算術右シフトが行わ
れる。ところが、xl−1やkXl−1が有限のビット
数(16ビツト)によって表現されていることから、k
Xl−1の計算において4ビツトの算術右シフトを行う
と、下位4ビット分の情報のビット落ち(下位のビット
値が失われる現象)が発生する。これにより(2)式の
計算精度が大幅に低下する。特に、PI制御用フィルタ
が積分形のフィルタであることから、このビット落ちの
影響が累積し、フィルタ精度が大幅に劣化する。その結
果、制御装置に利用した場合に、制御性能の劣化を生じ
ていた。
Therefore, when k-24, a 4-bit arithmetic right shift is performed. However, since xl-1 and kXl-1 are expressed by a finite number of bits (16 bits), k
If a 4-bit arithmetic right shift is performed in the calculation of Xl-1, a bit drop (a phenomenon in which the lower bit value is lost) of information for the lower 4 bits occurs. This significantly reduces the calculation accuracy of equation (2). 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ビツトのデジタル値としてylやyl−1を表現し、
(2)式の計算を行うことが考えられる。しかしながら
、このような場合には、上位ワードと下位ワードの両方
にまたがる計算が生じるために、計算が非常に煩雑にな
る。たとえば、下位ワードから上位ワードへの桁上がり
や桁下゛がりが生じた場合に、32ビツトのデジタル値
として正数の桁上がり、正数の桁下がり、負数の桁上が
り、負数の桁下がりの4つの場合のどれであるかを判定
する必要が生じる。この判定には、多くの比較計算や条
件分岐が必要である。その結果、計算時間が非常に長く
なるという欠点がある。このPI″M御用フィルタの入
力から出力までの演算時間は、制御装置の制御時間遅れ
に相当する。制御時間遅れが大きくなると、制御装置全
体の安定性を確保するためには、制御利得を小さくしな
ければならない、従って、PII制御用フィルタの演算
時間は極力小さいことが要求される。
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 yl and yl-1 as 2-bit digital values,
It is conceivable to calculate equation (2). 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 fall occurs from a lower word to a higher word, the 32-bit digital value includes a positive number carry, a positive number carry down, a negative number carry up, and a negative number carry down. It becomes necessary to determine which of the four cases it is. 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''M filter corresponds to the control time delay of the control device.If the control time delay becomes large, the control gain must be reduced to ensure the stability of the entire control device. Therefore, the calculation time of the PII 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.

問題点を解決するための手段 本発明では、少なくとも1個の入力信号値と少なくとも
1個の保存信号値を算術合成演算し、その演算結果を新
しい前記保存信号値とするデジタルフィルタ器であって
、前記保存信号値を少なくともnビット長(ここに、n
は4以上の整数)の第1保存値と第2保存値にわけて保
存し、前記第1保存値と前記第2保存値はそれぞれ符号
ビットを有し、前記第1保存値の最下位ビットが数値的
に前記第2保存値の第0位ビット(ここに、Qは1<Q
<nなる整数)に対応するようにし、かつ、前記第2保
存値と前記入力信号値の算術合成演算によって得られる
前記第1保存値への補正値を1サンプリング時点前、も
しくはそれ以前の入力信号値を使ってあらかじめ計算す
るように構成することによって、上記の問題点を解決し
たものである。
Means for Solving the Problems The present invention provides a digital filter that performs an arithmetic synthesis operation on at least one input signal value and at least one stored signal value, and uses the result of the calculation as a new stored signal value. , the stored signal value is at least n bits long (where n
is an integer of 4 or more), and the first and second stored values each have a sign bit, and the least significant bit of the first stored value is numerically the 0th-order bit of the second stored value (here, Q is 1<Q
<n integer), and a correction value to the first stored value obtained by arithmetic synthesis operation of the second stored value and the input signal value is input one sampling time or earlier. The above problem is solved by configuring the system to perform calculations in advance using signal values.

本発明のより具体的な構成では、サンプリング周期毎に
nビット長の入力信号値を得る入力手段と、サンプリン
グ間の前記入力信号値の差分値に対応した値と第1保存
値と補正値の算術合成値を表すnビット長の第1のデジ
タル値を得る第1の演算手段と、前記第1のデジタル値
に対応した出力信号値を出力する出力手段と、前記第1
のデジタル値を新しい前記第1保存値とする第1の更新
手段と、現時点、もしくはそれ以前の前記入力信号値に
対応した値と第2保存値を算術合成演算してnビット長
の第2のデジタル値を得る第2の演算手段と、前記第2
のデジタル値を実質的に(Q−1)ビット(ここに、Q
はl<Q<nなる整数)の算術右シフトし、次のサンプ
リング時点、もしくはそれ以後のサンプリング時点の前
記第1の演算手段において使用するnビア)長の前記補
正値を得る補正値演算手段と、最下位ビットから第(Q
−1)位ビットまでの下位(Q−1)ビットの内容を前
起筆2のデジタル値の下位(Q−1>ビットの内容と一
致させ、最上位ビットから第0位ビットまでの上位(n
−Q+1)ビットの各ビット値を前記第2のデジタル値
の符号ビットと同じ値にしたnビット長の第3のデジタ
ル値を得る第3の演算手段と、前記第3のデジタル値を
新しい前記第2保存値とする第2の更新手段を具備する
デジタルフィルタ器とすることによって、上記の問題点
を解決している。
A more specific configuration of the present invention includes an input means for obtaining an input signal value of n bit length for each sampling period, and a value corresponding to a difference value of the input signal value between samplings, a first storage value, and a correction value. a first calculation means for obtaining an n-bit first digital value representing an arithmetic composite value; an output means for outputting an output signal value corresponding to the first digital value;
a first updating means for making a digital value of the first stored value a new first stored value; a second arithmetic means for obtaining a digital value;
The digital value of is effectively (Q-1) bits (here, Q
is an integer such that l<Q<n), and obtains the correction value of n via length to be used in the first calculation means at the next sampling time or a subsequent sampling time. and the (Q
-1) Match the contents of the lower (Q-1) bits up to the 0th bit with the contents of the lower (Q-1> bit) of the digital value in previous writing 2, and match the contents of the lower (Q-1) bits up to the 0th bit
-Q+1) bits to obtain a third digital value having an n-bit length by setting each bit value to the same value as the sign bit of the second digital value; The above-mentioned problem is solved by using a digital filter device that is equipped with a second updating means for setting a second stored value.

作用 本発明では上記の構成にすることによって、保存信号値
が第1保存値と第2保存値に分けて保存されているため
に、保存信号値の実質的なビット長がnビットよりも長
くなり、ビット落ちがなくなる、もしくは非常に少なく
なる。その結果、フィルタ計算の精度が向上する。また
、第1保存値と第2保存値がそれぞれ符号付きのデジタ
ル値であることから、第2保存値の第0位ビット以上の
数値(補正([)の第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, it is easy to add or subtract the correction ([) to the first stored value. In particular, since the correction value is calculated in advance at or before one sampling point, the calculation time from input to output at the next sampling point can be significantly shortened.

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

第2図に本発明のデジタルフィルタ器のハードウェアの
基本構成図を示す、中央処理部23は、命令記憶部24
に記憶されている命令に従って順次計算・処理を行う、
命令記憶部24は、ロム(ROM : Read 0n
ly Memory)によって構成され、デジタルフィ
ルタの計算処理アルゴリズムが格納されている。入力部
21は、制御装置の検出信号等の入力信号をサンプリン
グし、16ビツト長のデジタル値になおして中央処理部
23に入力する。中央処理部23では、ラム(RAM:
Randam Access Mesory)により構
成された情報記憶部25を使用してフィルタ計算・処理
を行い、その計算結果を出力部22に送る。出力部22
に送られた出力信号値は、制御装置の制御′f5信号と
して利用される。このような入力部21.出力部22、
中央処理部23 (マイクロプロセッサ)。
FIG. 2 shows a basic configuration diagram of the hardware of the digital filter device of the present invention.
Perform calculations and processes sequentially according to instructions stored in
The instruction storage unit 24 is a ROM (ROM: Read On
ly Memory), and stores the calculation processing algorithm of the digital filter. The input section 21 samples an input signal such as a detection signal of a control device, converts it into a 16-bit digital value, and inputs it to the central processing section 23 . In the central processing unit 23, RAM (RAM:
Filter calculation and processing are performed using the information storage unit 25 configured by Random Access Memory (Random Access Memory), and the calculation results are sent to the output unit 22. Output section 22
The output signal value sent to is used as the control 'f5 signal of the control device. Such an input section 21. output section 22,
Central processing unit 23 (microprocessor).

命令記憶部24.情報記憶部25からなるデジタルフィ
ルタ器では、命令記憶部24の内容を適当に構成するこ
とによって、+1)式のパルス伝達関数G (Zlを有
するデジタルフィルタを実現することができる。
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 (Zl of the formula +1).

第1図に(1)式のデジタルフィルタを実現するための
本発明のデジタルフィルタ器の動作フローチャートを示
す、なお、以下の説明においては、中央処理部23や情
報記憶部25の処理ビット数を16ビツトとし、(1)
式の係数はに一=24とする。
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, the number of processing bits of the central processing unit 23 and the information storage unit 25 is 16 bits, (1)
The coefficient of the equation is 24.

また、第1図のX、R,U、W、Eはそれぞれ16ビツ
ト長(n−16)のデジタル値であり、最上位ビットを
符号ビットとし、負の数値は2の補数により表現されて
いるものとする。
In addition, X, R, U, W, and E in Figure 1 are each 16-bit long (n-16) digital values, the most significant bit is the sign bit, and negative numbers are expressed by two's complement. It is assumed that there is

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

(2)〈ブロック2:第1の演算ブロック〉サンプリン
グ周期間の入力信号値の差分値(X、−X、、)と情報
記憶部25に記憶しておいた第1保存値Wl(後述)と
補正値E(後述)を算術加算した第1のデジタル値U1
を得る。
(2) <Block 2: First calculation block> The difference value (X, -X, .) of the input signal value between sampling periods and the first storage value Wl stored in the information storage unit 25 (described later) A first digital value U1 obtained by arithmetic addition of and a correction value E (described later)
get.

(3)<ブロック3:出力ブロック〉 デジタルフィルタの出力信号値として、第1のデジタル
値U1を出力部22に出力する。
(3) <Block 3: Output Block> The first digital value U1 is output to the output section 22 as the output signal value of the digital filter.

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

(5)<ブロック5:第2の演算ブロック〉入力信号値
x1を1ビツト算術右シフトしたデジタル値R1を計算
する9次に、情報記憶部25に記憶しておいた第2保存
値W2 (後述)とデジタル値R1を算術加算し、第2
のデジタル値U2を得る。
(5) <Block 5: Second calculation block> Calculate the digital value R1 by arithmetic right-shifting the input signal value x1 by 1 bit.Next, the second storage value W2 stored in the information storage section 25 ( (described later) and the digital value R1, and the second
Obtain the digital value U2.

(6)<ブロック6:補正値演算ブロック〉第2のデジ
タル値U2を3ビツト算術右シフトして補正値Eを得る
。この補正値Eは、次のサンプリング時点のブロック2
(第1の演算ブロック)において使用される。すなわち
、次のサンプリング時点において使用する補正値Eをあ
らかじめ計算しておく。
(6) <Block 6: Correction value calculation block> The second digital value U2 is arithmetic shifted to the right by 3 bits to obtain the correction value E. This correction value E is applied to block 2 at the next sampling point.
(first calculation block). That is, the correction value E to be used at the next sampling time is calculated in advance.

(7)<ブロック7:第3の演算ブロック〉第2のデジ
タル値U2と16進数値8000Hの論理積(AND)
をとり、デジタル値R2を作る。デジタル値R2を12
ビツト算術右シフトしたデジタル値R3を得る。これに
より、デジタル値R3は、最下位ビット(第1位ビット
)から第3位ビットまでの下位3ビツトの各ビット値が
O8第4位ビットから最上位ビット(第16位ビット)
までの上位13ビツトの各ビット値が第2のデジタル値
U2の符号ビットの値に等しくなる0次に、第2のデジ
タル値U2と16進数値0007Hの論理積(AND)
をとり、デジタル値R4を作る。さらに、デジタル値R
4とデジタル値R3の論理和(OR)を計算し、第3の
デジタル値U3を得る。これにより、第3のデジタル値
U3の最下位ビットから第3位ビットまでの下位3ビツ
トの内容は上記第2のデジタル値U2の下位3ビツトの
内容と一致し、第3のデジタル値U3の第4位ビットか
ら最上位ビットまでの上位13ビツトの各ビット値は上
記第2のデジタル値U2の符号ビットと同じ値になる。
(7) <Block 7: Third calculation block> Logical product (AND) of second digital value U2 and hexadecimal value 8000H
and create a digital value R2. Digital value R2 is 12
Obtain the digital value R3 which is arithmetic shifted to the right by a bit. 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 O8 from the 4th bit to the most significant bit (16th bit).
Each bit value of the upper 13 bits up to is equal to the value of the sign bit of the second digital value U2. Then, the logical product (AND) of the second digital value U2 and the hexadecimal value 0007H.
and create a digital value R4. Furthermore, the digital value R
4 and the digital value R3 to obtain the third digital value U3. As a result, the content of the lower 3 bits from the least significant bit to the 3rd bit of the third digital value U3 matches the content of the lower 3 bits of the second digital value U2, and the content of the lower 3 bits of the third digital value U3 matches the content of the lower 3 bits of the second digital value U2. Each bit value of the upper 13 bits from the fourth bit to the most significant bit becomes the same value as the sign bit of the second digital value U2.

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

(9)〈ブロック9:入力保存ブロック〉入力信号値X
、をXl−1に移して保存する。
(9) <Block 9: Input storage block> Input signal value X
, is transferred to Xl-1 and stored.

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

このように構成した本実施例では、第1保存値W1と第
2保存値W2を使って保存信号値を更新・保存している
。特に、第1保存値W1と第2保存値W2がそれぞれ独
立に符号ビットを有し、第1保存値W1の最下位ビット
が数値的に第2保存値W2の第4位ビット(Q−4)に
相当するようにしている。従って、保存信号値のビット
数は実質的に16ビツト(n−16)よりも3ビツト分
[(Q−1)ビット分]長くなる。これにより、入力信
号値X1やXl−1を用いたフィルタ演算の精度が向上
し、ビット落ちをなくす、もしくは非常に少なくするこ
とができる。なお、第2保存値W2の保存数値を下位の
3ビツト[(Q−1)ビット]で表せる数値に制限し、
これよりも大きな数値に関しては補正値Eとして第1保
存値W1の方に移すようにして、第1保存値W1と第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 is numerically the fourth-order bit (Q-4) of the second stored value W2. ). Therefore, the number of bits of the stored signal value is substantially 3 bits [(Q-1) bits] longer than 16 bits (n-16). This improves the accuracy of filter calculations using the input signal values X1 and Xl-1, and eliminates or significantly reduces bit loss. Note that the stored numerical value of the second stored value W2 is limited to a numerical value that can be expressed by the lower 3 bits [(Q-1) bits],
For numerical values larger than this, the correction value E is transferred to the first saved value W1, and the first saved value W1 and the second saved value
The stored values W2 complement each other to represent the stored signal value.

また、新しい入力信号値Xlを入力した時から新しい出
力信号値U1を得るまでの演算処理には(ブロック1か
らブロック3)、比較計算や条件分岐を全く使っていな
い、従って、この間の演算時間は非常に小さな一定値に
なる。特に、第2保存値W2と入力信号値との算術合成
演算によって生じる第1保存値Wlへの補正値Eをあら
かじめ1サンプリング時点前に計算しであるので、新し
い入力信号値XIが得られると直ちに出力信号値U1を
計算できる。その結果、入力から出力までの演算時間は
極めて小さくなる。これにより、本実施例のデジタルフ
ィルタ器を制御装置のPI制御用フィルタに使用した場
合に、制御時間遅れの小さいフィルタが実現できる。
In addition, the calculation process from inputting the new input signal value Xl to obtaining the new output signal value U1 (block 1 to block 3) does not use any comparison calculations or conditional branching. Therefore, the calculation time during this period is is a very small constant value. In particular, since the correction value E to the first stored value Wl resulting from the arithmetic synthesis operation of the second stored value W2 and the input signal value is calculated in advance one sampling point in time, when a new input signal value XI is obtained, The output signal value U1 can be calculated immediately. As a result, the calculation time from input to output becomes 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個の入力信号値と少なくとも1個
の保存信号値を算術合成演算し、その演算結果を新しい
前記保存信号値とするデジタルフィルタ器であって、前
記保存信号値を少なくともnビット長(ここに、nは4
以上の整数)の第1保存値と第2保存値にわけて保存し
、前記第1保存値と前記第2保存値はそれぞれ符号ビア
)を有し、前記第1保存値の最下位ビットが数値的に前
記第2保存値の第0位ビット(ここに、Qは1<Q<n
なる整数)に対応するようにし、かつ、前記第2保存値
と前記入力信号値の算術合成演算によって得られる前記
第1保存値への補正値を1サンプリング時点前、もしく
はそれ以前の入力信号値を使ってあらかじめ計算するよ
うに構成するならば、上記の効果を得ることができる。
Generally, a digital filter performs an arithmetic synthesis operation on at least one input signal value and at least one stored signal value, and uses the result of the calculation as a new stored signal value, the digital filter having a length of at least n bits. (Here, n is 4
The first stored value and the second stored value each have a sign via), and the least significant bit of the first stored value is Numerically, the 0th bit of the second stored value (where Q is 1<Q<n
(an integer), and the correction value to the first stored value obtained by arithmetic synthesis of the second stored value and the input signal value is set to the input signal value at or before one sampling point. The above effect can be obtained by configuring the system to be calculated in advance using .

このような構成および効果は、一般の再帰形のデジタル
フィルタを制御装置の制御用フィルタとして使用すると
きに、非常に有用である。
Such a configuration and effect are very useful when a general recursive digital filter is used as a control filter for a control device.

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

−aに、サンプリング周期毎にnビット長の入力信号値
を得る入力手段と、サンプリング間の前記入力信号値の
差分値に対応した値と第1保存値と補正値の算術合成値
を表すnビット長の第1のデジタル値を得る第1の演算
手段と、前記第1のデジタル値に対応した出力信号値を
出力する出力手段と、前記第1のデジタル値を新しい前
記第1保存値とする第1の更新手段と、現時点、もしく
はそれ以前の前記入力信号値に対応した値と第2保存値
を算術合成演算してnビット長の第2のデジタル値を得
る第2の演算手段と、前記第2のデジタル値を実質的に
(Q−1)ビット(ここに、Qは1<Q<nなる整数)
の算術右シフトし、次のサンプリング時点、もしくはそ
れ以後のサンプリング時点の前記第1の演算手段におい
て使用するnビット長の前記補正値を得る補正値演算手
段と、最下位ビットから第(Q−1)位ビットまでの下
位(Q−1)ビットの内容を前記第2のデジタル値の下
位(Q−1)ビットの内容と一致させ、最上位ビットか
ら第0位ビットまでの上位(n−Q+1)ビットの各ビ
ット値を前記第2のデジタル値の符号ビットと同じ値に
したnビット長の第3のデジタル値を得る第3の演算手
段と、前記第3のデジタル値を新しい前記第2保存値と
する第2の更新手段を具備するデジタルフィルタ器を構
成するならば、(1)式のパルス伝達関数GIZIと同
じ、もしくはほぼ同じフィルタ特性を有するデジタルフ
ィルタを高精度に実現できる。また、人力から出力まで
の演算時間も極めて短くなる。
−a, an input means for obtaining an input signal value of n bit length for each sampling period, and n representing an arithmetic composite value of a value corresponding to the difference value of the input signal value between samplings, a first stored value, and a correction value. a first calculation means for obtaining a first digital value of a bit length; an output means for outputting an output signal value corresponding to the first digital value; and a first calculation means for outputting an output signal value corresponding to the first digital value; a first updating means for performing an arithmetic synthesis operation on a value corresponding to the input signal value at or before the present time and a second stored value to obtain a second digital value having an n-bit length; , the second digital value is substantially (Q-1) bits (where Q is an integer such that 1<Q<n)
arithmetic right-shifting of n bits to obtain the n-bit correction value to be used in the first calculation means at the next sampling time or a subsequent sampling time; 1) Match the contents of the lower (Q-1) bits up to the digit bit with the contents of the lower (Q-1) bit of the second digital value, and Q+1) bits each having the same value as the sign bit of the second digital value to obtain a third digital value having an n-bit length; By configuring a digital filter equipped with a second update means for storing 2 values, a digital filter having the same or almost the same filter characteristics as the pulse transfer function GIZI of equation (1) can be realized with high precision. In addition, the calculation time from human power to output is extremely short.

なお、前述の実施例の情報記憶部25には、記憶内容の
書換え可能なレジスタやラムメモリが使用される。また
、制御装置の検出信号等を使ってサンプリング周期を決
めるようにしても良く、本発明に含まれることは言うま
でもない、その他、本発明の主旨をかえずして種々の変
形が可能で有る。
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, the sampling period may be determined using the detection signal of the control device, etc., which is, of course, included in the present invention, and various other modifications are possible without changing the gist of the present invention.

発明の効果 本発明のデジタルフィルタ器は、計算情度が良く、入力
から出力までの演算時間が極めて短い。
Effects of the Invention The digital filter device of the present invention is computationally efficient and requires 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名第1図 第2図 第3図 一浪数(H1’)
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. It is a basic flowchart figure. 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 and one other person Figure 1 Figure 2 Figure 3 Ichiro Kazu (H1')

Claims (3)

【特許請求の範囲】[Claims] (1)少なくとも1個の入力信号値と少なくとも1個の
保存信号値を算術合成演算し、その演算結果を新しい前
記保存信号値とするデジタルフィルタ器であって、前記
保存信号値を少なくともnビット長(ここに、nは4以
上の整数)の第1保存値と第2保存値にわけて保存し、
前記第1保存値と前記第2保存値はそれぞれ符号ビット
を有し、前記第1保存値の最下位ビットが数値的に前記
第2保存値の第Q位ビット(ここに、Qは1<Q<nな
る整数)に対応するようにし、かつ、前記第2保存値と
前記入力信号値の算術合成演算によって得られる前記第
1保存値への補正値を1サンプリング時点前、もしくは
それ以前の入力信号値を使ってあらかじめ計算するよう
にしたデジタルフィルタ器。
(1) A digital filter that performs an arithmetic synthesis operation on at least one input signal value and at least one stored signal value, and uses the result of the calculation as a new stored signal value, the digital filter having at least n bits of the stored signal value. It is stored separately as a first storage value and a second storage value of length (where n is an integer of 4 or more),
The first stored value and the second stored value each have a sign bit, and the least significant bit of the first stored value is numerically the Q-th bit of the second stored value (where Q is 1< Q < n integer), and the correction value to the first stored value obtained by arithmetic synthesis of the second stored value and the input signal value is set at one sampling point or earlier. A digital filter that calculates in advance using the input signal value.
(2)第2保存値の第Q位ビットから最上位ビットまで
の各ビット値を前記第2保存値の符号ビットの値に等し
くしたことを特徴とする特許請求の範囲第(1)項に記
載のデジタルフィルタ器。
(2) According to claim (1), each bit value from the Q-th bit to the most significant bit of the second saved value is made equal to the value of the sign bit of the second saved value. The digital filter device described.
(3)サンプリング周期毎にnビット長の入力信号値を
得る入力手段と、サンプリング間の前記入力信号値の差
分値に対応した値と第1保存値と補正値の算術合成値を
表すnビット長の第1のデジタル値を得る第1の演算手
段と、前記第1のデジタル値に対応した出力信号値を出
力する出力手段と、前記第1のデジタル値を新しい前記
第1保存値とする第1の更新手段と、現時点、もしくは
それ以前の前記入力信号値に対応した値と第2保存値を
算術合成演算してnビット長の第2のデジタル値を得る
第2の演算手段と、前記第2のデジタル値を実質的に(
Q−1)ビット(ここに、Qは1<Q<nなる整数)の
算術右シフトし、次のサンプリング時点、もしくはそれ
以後のサンプリング時点の前記第1の演算手段において
使用するnビット長の前記補正値を得る補正値演算手段
と、最下位ビットから第(Q−1)位ビットまでの下位
(Q−1)ビットの内容を前記第2のデジタル値の下位
(Q−1)ビットの内容と一致させ、最上位ビットから
第Q位ビットまでの上位(n−Q+1)ビットの各ビッ
ト値を前記第2のデジタル値の符号ビットと同じ値にし
たnビット長の第3のデジタル値を得る第3の演算手段
と、前記第3のデジタル値を新しい前記第2保存値とす
る第2の更新手段を具備するデジタルフィルタ器。
(3) Input means for obtaining an input signal value of n bit length for each sampling period, and n bits representing an arithmetic composite value of a value corresponding to a difference value of the input signal value between samplings, a first stored value, and a correction value. a first calculation means for obtaining a first digital value of the length; an output means for outputting an output signal value corresponding to the first digital value; and setting the first digital value as a new first storage value. a first updating means; a second calculating means for performing an arithmetic synthesis operation on a value corresponding to the input signal value at or before the present time and a second stored value to obtain a second digital value having an n-bit length; The second digital value is substantially (
Q-1) arithmetic right shift of bits (here, Q is an integer such that 1<Q<n), and an n-bit length to be used in the first calculation means at the next sampling time or a subsequent sampling time. a correction value calculation means for obtaining the correction value; a third digital value of n-bit length, in which each bit value of the upper (n-Q+1) bits from the most significant bit to the Q-th bit is set to the same value as the sign bit of the second digital value; and a second updating means for making the third digital value the new second stored value.
JP22669986A 1986-09-25 1986-09-25 Digital filter Expired - Fee Related JPH0770960B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22669986A JPH0770960B2 (en) 1986-09-25 1986-09-25 Digital filter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22669986A JPH0770960B2 (en) 1986-09-25 1986-09-25 Digital filter

Publications (2)

Publication Number Publication Date
JPS6382012A true JPS6382012A (en) 1988-04-12
JPH0770960B2 JPH0770960B2 (en) 1995-07-31

Family

ID=16849263

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22669986A Expired - Fee Related JPH0770960B2 (en) 1986-09-25 1986-09-25 Digital filter

Country Status (1)

Country Link
JP (1) JPH0770960B2 (en)

Also Published As

Publication number Publication date
JPH0770960B2 (en) 1995-07-31

Similar Documents

Publication Publication Date Title
JPS62191926A (en) Arithmetic unit
JPS6382012A (en) Digital filter device
JPH0519170B2 (en)
JPS6379410A (en) Digital filter device
Bomar Low-roundoff-noise limit-cycle-free implementation of recursive transfer functions on a fixed-point digital signal processor
JPS6379409A (en) Digital filter device
JPS6378607A (en) Digital filter instrument
JPS6378606A (en) Digital filter instrument
JPS63234712A (en) Digital filter device for control
JPS63107308A (en) Digital filter device
JPS63125013A (en) Digital filter device
JPS622328B2 (en)
JPH04192910A (en) Digital signal processor
JPS61213926A (en) Dsp arithmetic processing system
JPH05313856A (en) Arithmetic processing method for digital filter
JP2508286B2 (en) Square root calculator
JPH0419571B2 (en)
JPS5939773B2 (en) Logarithmic function calculation method
JPH03288927A (en) Square root calculator
JP2011023927A (en) Digital filter and program
JPH0828646B2 (en) Digital filter
JPS63168772A (en) Accumulator
JPH01263812A (en) Table reading circuit
JPS63129463A (en) Trapezoidal integrated circuit
JPH044464A (en) Accumulator

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees