Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0654241B2 - Data processing device - Google Patents
[go: Go Back, main page]

JPH0654241B2 - Data processing device - Google Patents

Data processing device

Info

Publication number
JPH0654241B2
JPH0654241B2 JP63087299A JP8729988A JPH0654241B2 JP H0654241 B2 JPH0654241 B2 JP H0654241B2 JP 63087299 A JP63087299 A JP 63087299A JP 8729988 A JP8729988 A JP 8729988A JP H0654241 B2 JPH0654241 B2 JP H0654241B2
Authority
JP
Japan
Prior art keywords
value
data
memory
moving average
input data
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.)
Expired - Lifetime
Application number
JP63087299A
Other languages
Japanese (ja)
Other versions
JPH01260314A (en
Inventor
信一 中島
充広 野沢
安一 佐野
伸生 平田
重一 三谷
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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric 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 Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP63087299A priority Critical patent/JPH0654241B2/en
Publication of JPH01260314A publication Critical patent/JPH01260314A/en
Publication of JPH0654241B2 publication Critical patent/JPH0654241B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Testing Electric Properties And Detecting Electric Faults (AREA)
  • Indication And Recording Devices For Special Purposes And Tariff Metering Devices (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は計測値や信号データ等の入力データの補正を行
うデータ処理装置に関する。
The present invention relates to a data processing device for correcting input data such as measured values and signal data.

〔従来の技術〕[Conventional technology]

従来、計測結果を例えばA/D 変換器によりデジタル値に
変換して出力する計測器がある。このような計測器にお
いては周囲の影響によりノイズが発生し、上記デジタル
値に微小な変動が生じ、例えばミクロン単位のシートの
厚みを計測する場合には、特にノイズによるデジタル値
の変動を除去する必要にせまられている。
Conventionally, there is a measuring device that converts a measurement result into a digital value by an A / D converter and outputs the digital value. In such a measuring instrument, noise is generated due to the influence of the surroundings, and a slight variation occurs in the digital value. For example, when measuring the thickness of the sheet in microns, the variation of the digital value due to noise is removed. It is needed.

このため、従来の計測器は上記ノイズの影響を考慮し
て、順次にサンプリングした計測結果を記憶しておき、
ある時点Tでサンプリングした計測結果とサンプリング
時点Tより前にサンプリングした所定個数の計測結果の
平均をデータ処理装置により求め、この平均値をサンプ
リグン時点Tの計測結果に対する補正値として用いてい
る。
Therefore, the conventional measuring device stores the measurement results sequentially sampled in consideration of the influence of the noise.
An average of the measurement result sampled at a certain time point T and a predetermined number of measurement results sampled before the sampling time point T is obtained by the data processing device, and this average value is used as a correction value for the measurement result at the sampling time point T.

ところが、計測データの精度を上げるために、平均演算
を用いる計測結果の数を増やすと、データ処理装置にお
ける計測結果を記憶するメモリの容量が大幅に増大して
しまうという解決すべき課題があった。この点について
詳しく説明する。
However, if the number of measurement results using the average calculation is increased in order to improve the accuracy of the measurement data, there is a problem to be solved that the capacity of the memory for storing the measurement results in the data processing device increases significantly. . This point will be described in detail.

従来のデータ処理装置において、ある時点での補正値は
次式により算出される。
In the conventional data processing device, the correction value at a certain time is calculated by the following equation.

ここで は補正後の計測結果、xnはn回目にサンプリングされた
計測結果、Nは平均演算処理に用いる計測結果の個数
(ピックアップ個数)であり、固定設定され、n-N 回目
からn回目のデータが用いられる。
here Is the measurement result after correction, x n is the measurement result sampled at the nth time, N is the number of the measurement results (pickup number) used for the average calculation process, which is fixedly set and the data from the nNth time to the nth time is used. To be

データ処理装置は計測結果を記憶するN個のメモリおよ
び(1) 式における すなわち、前回の計測結果のサンプリング時におけるN
個の計測結果の合計を記憶するメモリを設けている。
The data processing device has N memories for storing the measurement result and in the equation (1). That is, N at the time of sampling of the previous measurement result
A memory is provided for storing the total of the individual measurement results.

これらのメモリを用いた(1) 式の演算処理手順を第4図
および第5図を参照して具体的に説明する。
The calculation processing procedure of the equation (1) using these memories will be specifically described with reference to FIGS. 4 and 5.

ここで、(1) 式においてピックアップ個数Nを“3”に
設定し、メモリM1〜M3を計測結果xnの格納用に、メモリ
M4を計測結果の合計値 の格納用に、さらにメモリM5を計測結果xn-Nの格納用に
割り当てるものとする。
Here, in the equation (1), the number N of pickups is set to “3”, and the memories M1 to M3 are used as memory for storing the measurement result x n.
M4 is the total value of the measurement results , And the memory M5 is further allocated to store the measurement result x nN .

第4図に示すように、第1回目の計測結果x1が得られる
とデータ処理装置はメモリM1に計測結果x1をメモリM1に
格納する。この時点では“3”個の計測結果が得られな
いのでメモリM2〜M5には“0”が記憶されている。次
に、第2回目の計測結果x2が得られると、データ処理装
置は、メモリM2の記憶内容をメモリM3へ、メモリM1の記
憶内容x1をメモリM2にシフト記憶し、メモリM1には第2
回目の計測結果x2を記憶する。このようにしてデータ処
理装置は得られる計測結果を順次メモリM1〜M3にシフト
記憶する。第2回目の計測結果が得られると、データ処
理装置は(1) 式における としてx1をメモリM4に格納する。以下、以下、データ処
理装置は得られる計測結果をメモリM1〜M3にシフト記憶
する。第4回目の計測結果x4が得られたとき、メモリM1
〜M3にはそれぞれx4,x3,x2が記憶され、これまでメモ
リM3に記憶されていたx1がxn-Nの値としてメモリM5にシ
フト記憶される。また、メモリM4には、x1+x2+x3の合
計値が記憶される。xn-Nの値としてx1が、格納されるの
で、データ処理装置は(1) 式に基いて(メモリM1の値+
メモリM4の値−メモリM5の値)/3を演算する。この演
算結果 が第4回目の計測値x4に対する補正値としてデータ処理
装置から出力される。データ処理装置は以下、順次新し
い計測結果得られる毎にメモリM1〜M3、メモリM4、メモ
リM5の値をシフト記憶し、これらのメモリの値に基いて
演算処理を行っている。
As shown in FIG. 4, when the first measurement result x 1 is obtained, the data processing device stores the measurement result x 1 in the memory M1. Since "3" measurement results cannot be obtained at this time, "0" is stored in the memories M2 to M5. Next, when the second measurement result x 2 is obtained, the data processing device shifts the storage content of the memory M2 to the memory M3 and the storage content x 1 of the memory M1 to the memory M2, and the memory M1 stores the same. Second
Memorize the second measurement result x 2 . In this way, the data processing device sequentially shifts and stores the obtained measurement results in the memories M1 to M3. When the second measurement result is obtained, the data processing device And stores x 1 in the memory M4. Hereinafter, hereinafter, the data processing device shifts and stores the obtained measurement results in the memories M1 to M3. When the fourth measurement result x 4 is obtained, the memory M1
~M3 x 4, x 3, x 2 , respectively are stored in this x 1 which has been stored in the memory M3 until is shifted stored in the memory M5 as the value of x nN. Further, the total value of x 1 + x 2 + x 3 is stored in the memory M4. Since x 1 is stored as the value of x nN , the data processing device calculates (value of memory M1 +
The value of the memory M4−the value of the memory M5) / 3 is calculated. This operation result Is output from the data processing device as a correction value for the fourth measurement value x 4 . Hereinafter, the data processing device shift-stores the values of the memories M1 to M3, the memory M4, and the memory M5 each time a new measurement result is obtained, and performs arithmetic processing based on the values of these memories.

このような補正演算は計測結果が新しく得られる毎に、
平均演算に用いるデータが第5図に示すように次々と移
動するので移動平均とも呼ばれている。
Such a correction calculation is performed every time a new measurement result is obtained.
This is also called a moving average because the data used for the average calculation moves one after another as shown in FIG.

〔発明が解決しようとする課題〕[Problems to be Solved by the Invention]

以上説明した移動平均をデータ処理装置により求める場
合には、移動平均に用いる計測結果の個分だけメモリを
用意する必要があり、特に、出力データの精度を良くす
るために指定平均回数(ピックアップ個数)を125 回と
か256 回、512 回などと多数回を指定すると、指定平均
回数に応じて平均すべき計測結果を記憶しておくデータ
メモリの数も多数となる。
When the moving average described above is obtained by the data processing device, it is necessary to prepare the memory for the number of measurement results used for the moving average. In particular, in order to improve the accuracy of the output data, the specified average number (pickup number If 125), 256 times, 512 times, etc. are specified for a large number of times, the number of data memories for storing the measurement results to be averaged according to the specified average times also becomes large.

この結果、データメモリの増加に伴ってデータ処理時間
も長くなる。例えば、データサンプリング速度が1ms 以
下で行い、512 回の移動平均処理を行ったとき、1回の
移動平均処理時間は約0.5 秒となる。連続して流れるシ
ート材の厚みや幅を測定する場合には、指定平均回数を
512 回としてもデータ精度的には不足の場合もあるとい
われている。
As a result, the data processing time increases as the data memory increases. For example, when the data sampling speed is 1 ms or less and 512 moving averages are performed, the moving average processing time for one time is about 0.5 seconds. When measuring the thickness and width of continuously flowing sheet material, specify the specified number of averages.
It is said that the data accuracy may be insufficient even if it is 512 times.

ちなみに、2バイト長のデータ512 個を移動平均する場
合、約1Kバイトのメモリを必要とする。測定器の小型化
のために1チップの中央演算処理装置(CPU) を利用して
測定データの補正処理を行なおうとすると、現在市販さ
れてい1チップCPU の内蔵メモリでは、エメリ容量が不
足し、外部にメモリを増設しなければならず、測定器を
小型化できないという不具合につながる。
By the way, moving average of 512 2-byte data requires about 1 Kbyte of memory. When attempting to correct the measurement data using a 1-chip central processing unit (CPU) to reduce the size of the measuring instrument, the built-in memory of the 1-chip CPU currently on the market lacks the emery capacity. , It is necessary to add memory to the outside, which leads to a problem that the measuring device cannot be downsized.

また、CPU がアクセスすべきメモリが多くなる程演算時
間も長くなるので、データサンプリング速度に制限を受
けるという不具合も生じる。
In addition, the more memory the CPU has to access, the longer the computation time, resulting in a problem that the data sampling speed is limited.

そこで、本発明の目的は、上述の問題点を解決し、測定
結果の移動平均補正を行う際に用意すべきデータメモリ
数を減少させ、かつ高速で近似的な移動平均値を求める
ことができるデータ処理装置を提供することにある。
Therefore, an object of the present invention is to solve the above-described problems, reduce the number of data memories to be prepared when performing moving average correction of measurement results, and obtain an approximate moving average value at high speed. It is to provide a data processing device.

〔課題を解決するための手段〕[Means for Solving the Problems]

このような目的を達成するために、本発明は、2以上の
整数である所定値Nと変数nとがn>Nとして、前回ま
でサンプリングされて入力されたn-N 回目の入力データ
xn-Nからn-1 回目の入力データ、xn-1のN個の入力デー
タを用いて今回のn回目にサンプリングされた入力デー
タxnに対してノイズ補正を行った移動平均値 を求めるデータ処理装置において、前回のn-1 回目の入
力データxn-1に対する移動平均値を とすると、次式 を用いて、今回のn回目の入力データxnに対する移動平
を求め、今回求めた の値を次回の演算の際には として上記式に代入することにより上記 を順次演算して、出力する演算手段を具備したことを特
徴とする。
In order to achieve such an object, according to the present invention, a predetermined value N, which is an integer of 2 or more, and a variable n are set as n> N, and the nN-th input data sampled and input up to the previous time is input.
A moving average value obtained by performing noise correction on the input data x n sampled at the n-th time using the n-th input data from x nN and N input data of x n-1 In the data processor that obtains the moving average value for the previous n-1th input data x n-1 Then, Is used to calculate the moving average for the nth input data x n I asked for this time The value of will be calculated next time By substituting into the above equation as It is characterized by comprising a calculation means for sequentially calculating and outputting.

〔作 用〕[Work]

本発明は、高速でサンプリングされるデータ値に大きい
誤差がないことに着目し、移動平均値を求める際に最新
の入力データ値xnをこれまでにサンプリングした移動平
均に用いる入力データの合計値に加え、前回求められた
移動平均値を減じて移動平均の補正演算を行うようにし
たので、移動平均に用いるサンプリングデータを全て記
憶しておく必要がなくなり、従来のデータ処理装置に比
べ、補正演算は使用するメモリの数を大幅に減ずること
ができる。
The present invention focuses on the fact that there is no large error in the data values sampled at high speed, and when obtaining the moving average value, the latest input data value x n is the total value of the input data used for the moving average sampled so far. In addition, since the moving average value calculated last time is subtracted to perform the moving average correction calculation, it is not necessary to store all the sampling data used for the moving average, and correction can be made compared to conventional data processing devices. Arithmetic can significantly reduce the number of memories used.

〔実施例〕〔Example〕

以下、図面を参照して本発明を詳細に説明する。 Hereinafter, the present invention will be described in detail with reference to the drawings.

第1図は本発明実施例の具体的構成を示す。FIG. 1 shows a concrete configuration of the embodiment of the present invention.

第1図において、200 は2以上の整数である所定値Nと
変数nとがn>Nとして、入力装置100 から前回までサ
ンプリングされて入力されたn-N 回目の入力データxn-N
からn-1 回目の入力データ、xn-1のN個の入力データを
用いて今回のn回目にサンプリングされた入力データxn
に対してノイズ補正を行った移動平均値 を求めるデータ処理装置である。
In FIG. 1, 200 is a predetermined value N that is an integer of 2 or more and a variable n is n> N, and the nNth input data x nN sampled and input from the input device 100 to the previous time is input.
N-1-th input data from, x n-1 of N this time by using the input data n th the sampled input data x n
Noise-corrected moving average value Is a data processing device that seeks.

300 は前回のn-1 回目の入力データxn-1に対する移動平
均値を とすると、次式 を用いて、今回のn回目の入力データxnに対する移動平
均値 を求め、今回求めた の値を次回の演算の際には として上記式に代入することにより上記 を順次演算して、出力する演算手段である。
300 is the moving average value for the previous n-1th input data x n-1 Then, Using, the moving average value for the nth input data x n I asked for this time The value of will be calculated next time By substituting into the above equation as Is a calculation means for sequentially calculating and outputting.

第2図は本発明の実施例の具体的な回路構成を示す。第
2図において1は被測定物の測定、例えばシートの厚み
を測定し、その測定結果をアナログ信号で出力するセン
サである。2はセンサ1より得られたアナログ信号を後
処理可能なレベルまでアナログ信号を増幅するアンプで
ある。4はアンプ2より得られた増幅信号をアナログ値
からデジタル値に変換するアナログ−デジタル(A/D) 変
換器である。
FIG. 2 shows a concrete circuit configuration of the embodiment of the present invention. In FIG. 2, reference numeral 1 is a sensor for measuring an object to be measured, for example, measuring the thickness of a sheet, and outputting the measurement result as an analog signal. Reference numeral 2 is an amplifier that amplifies the analog signal obtained from the sensor 1 to a level at which it can be post-processed. Reference numeral 4 is an analog-digital (A / D) converter for converting the amplified signal obtained from the amplifier 2 from an analog value to a digital value.

4は中央演算処理装置(CPU) であり、3図(A),(B) に
示すプログラムを実行し、測定データの補正を行う。な
おA/D 変換器3がCPU4に内蔵されている場合もある。
A central processing unit (CPU) 4 executes the programs shown in FIGS. 3 (A) and 3 (B) to correct the measurement data. The A / D converter 3 may be built in the CPU 4.

CPU4はA/D 変換器3からの測定データを記憶するランダ
ムアクセスメモリ(RAM) を内部に有し、同じく第3図
(B) に示す移動平均を求めるプログラムを予め記憶する
リードオンメモリ(ROM) を有する。CPU4により補正演算
された結果が補正後の測定結果としてデジタル信号で外
部出力される。
The CPU4 has a random access memory (RAM) inside which stores the measurement data from the A / D converter 3, and FIG.
It has a read-on memory (ROM) that stores in advance a program for obtaining a moving average shown in (B). The result of the correction calculation by the CPU 4 is externally output as a digital signal as the corrected measurement result.

また、CPU4のRAM 内には第3図(A) 〜(B) の制御手順の
基にCPU4が実行する補正演算の演算データを記憶するメ
モリM11 〜M13 、カウンタ等が設けられている。
Further, in the RAM of the CPU 4, memories M11 to M13 for storing the calculation data of the correction calculation executed by the CPU 4 based on the control procedure of FIGS. 3A to 3B, a counter and the like are provided.

次に、本実施例の動作を第3図(A) 〜(C) のフローチャ
ートを参照して説明する。第3図(A) は第2図に示すCP
U4により実行される計測データの補正処理に関する主制
御手順を示す。
Next, the operation of this embodiment will be described with reference to the flow charts of FIGS. 3 (A) to (C). Figure 3 (A) is the CP shown in Figure 2.
The main control procedure regarding the correction processing of the measurement data executed by U4 is shown.

第3図(B) は第3図(A) の主制御手順におけるイニシャ
ル処理(ステップS10)の詳細な制御手順を示す。第3
図(C)は第3図(A)の主制御手順における計測結果の補正
処理の詳細な制御手順を示す。
FIG. 3 (B) shows a detailed control procedure of the initial process (step S10) in the main control procedure of FIG. 3 (A). Third
FIG. 3C shows a detailed control procedure of the correction processing of the measurement result in the main control procedure of FIG.

本例において移動平均のための演算式は、 n≦Nの場合 n>Nの場合 なる式を用いる。In this example, when n ≦ N, the arithmetic expression for the moving average is When n> N Is used.

第3図(A) において、CPU4に電源が投入されると、CPU4
はステップS10 においてCPU4内の各メモリのイニシャラ
イズ処理を行う。CPU4は第3図(B) に示す従手順に移
り、CPU4のROM に予め記憶してある平均演算のためのデ
ータ個数(ピックアップ個数)NをRAM に記憶する。本
例はこのデータ個数を固定値としているが、任意に設定
したい場合には、キーボードからデータ個数Nを入力す
るようにしてもよい。
In FIG. 3 (A), when the CPU4 is powered on, the CPU4
Executes initialization processing of each memory in the CPU 4 in step S10. The CPU 4 shifts to the sub-procedure shown in FIG. 3 (B) and stores in the RAM the number of data (pickup number) N for the average calculation which is stored in the ROM of the CPU 4 in advance. In this example, this number of data is a fixed value, but if desired to be set arbitrarily, the number N of data may be input from the keyboard.

次に、CPU4はカウンタに初期値“0”を設定する。カウ
ンタはサンプリングデータのサンプリング個数を計数
し、サンプリングデータの個数nがN個に達したか否か
を測定するために用いるカウンタであり、本例において
はRAM 内に設けている。
Next, the CPU 4 sets an initial value "0" in the counter. The counter is a counter used for counting the number of samplings of the sampling data and measuring whether or not the number n of sampling data has reached N, and is provided in the RAM in this example.

CPU4はその他、補正処理に用いるデータの初期値の設定
を終了し、次の手順に進む(ステップS11 〜S13 )。
In addition, the CPU 4 finishes setting the initial value of the data used for the correction process, and proceeds to the next procedure (steps S11 to S13).

CPU4は、一定周期でA/D 変換器3から送られてくる計測
結果を入力(データサンプリング)し、その計測結果の
移動平均を算出するための補正処理を行う(ステップS2
0 〜S30 )。
The CPU 4 inputs (data sampling) the measurement result sent from the A / D converter 3 at a constant cycle and performs a correction process for calculating a moving average of the measurement result (step S2
0-S30).

ここで、n回目の計測結果xnが得られたとすると、CPU4
は入力された値xnをRAM 内のメモリM11 に記憶する(第
3図(C) ステップS31)。
If the nth measurement result x n is obtained, the CPU 4
Stores the input value x n in the memory M11 in the RAM (step S31 in FIG. 3 (C)).

次に、CPU4の内部カウンタの値を“1”加算してサンプ
リング回数を計数する。カウンタ値≦サンプリングデー
タ個数Nと判定したときは上述の(3) 式を用いた演算処
理を行う。また、カウンタが計数したサンプリング回数
n≧N+1を判定したときは、(4) 式を用いた演算を行
う(ステップS32 〜S33)。
Next, the value of the internal counter of the CPU 4 is incremented by "1" to count the number of samplings. When it is determined that the counter value is equal to or less than the number N of sampling data, the arithmetic processing using the above-mentioned equation (3) is performed. When it is determined that the counter has counted the number of samplings n ≧ N + 1, the calculation using the equation (4) is performed (steps S32 to S33).

ステップS34 〜S36 は(2) 式の演算処理過程を示す。CP
U4はRAM 内に設けられたメモリM12 からこれまでのサン
プリングデータの合計値、を読み出すと、最新のデータ
値xnを合計値に加算し、xnが加算された合計値をメモリ
M12 に再記憶する。次に、この合計値をカウンタ値nで
除し(2) 式に基づく演算処理を行う。この計算結果はメ
モリM13 に記憶され、次のサプリングデータの補正演算
処理に用いられる(ステップS34 〜S36)。
Steps S34 to S36 show the arithmetic processing steps of the equation (2). CP
U4 reads the total value of the sampling data so far from the memory M12 provided in the RAM, adds the latest data value x n to the total value, and adds the total value of x n to the memory.
Re-store in M12. Next, this total value is divided by the counter value n, and arithmetic processing based on the equation (2) is performed. The calculation result is stored in the memory M13 and is used for the correction calculation process of the next sampling data (steps S34 to S36).

一方、カウンタ値が示すサンプリング回数n≧N+1の
ときは、メモリM11 に記憶された最新の計測結果Xnをメ
モリ12に記憶されたN個の計測値 れた前回計算された移動平均値 を減算し、その減算結果をメモリ12に記憶する(ステッ
プS40 〜S41)。
On the other hand, when the sampling number n ≧ N + 1 indicated by the counter value, the latest measurement result X n stored in the memory M11 is the N measurement values stored in the memory 12. Previously calculated moving average value Is subtracted and the result of the subtraction is stored in the memory 12 (steps S40 to S41).

次にメモリ12の値をN値で除して、n回目における移動
平均値を計算する。この計算結果はメモリ13に記憶さ
れ、次回の移動平均演算に用いられる。このように計算
された移動平均値がサンプリングされた計測値に対する
補正値として外部出力される(ステップS42 〜48 →S37
)。
Next, the value in the memory 12 is divided by the N value to calculate the moving average value at the nth time. The calculation result is stored in the memory 13 and used for the next moving average calculation. The moving average value thus calculated is externally output as a correction value for the sampled measured value (steps S42 to 48 → S37).
).

次に、従来例との比較を行うために、従来技術において
説明した演算例と同一条件での具体的演算過程を簡単に
説明する。
Next, in order to make a comparison with the conventional example, a specific calculation process under the same conditions as the calculation example described in the related art will be briefly described.

ここで、移動平均に用いるデータ個数をN=3に設定す
る。第1回目(n=1) の計測結果x1が得られると、計測結
果かメモリ11に記憶され、カウンタの値は“1”に設定
される(ステップS31 →S32 )。
Here, the number of data used for the moving average is set to N = 3. When the first measurement result x 1 (n = 1) is obtained, the measurement result is stored in the memory 11 and the value of the counter is set to “1” (steps S31 → S32).

次に、カウンタ値(1) ≦N(3) なのでメモリM12 にはN
個の計測結果の合計値とて が記憶され、移動平均の計算の結果x1がメモリM13 に記
憶されると共に、外部出力される(ステップS33 〜S3
7)。
Next, since the counter value (1) ≤ N (3), N is stored in the memory M12.
As the total value of the individual measurement results Is stored, and the result x 1 of the moving average calculation is stored in the memory M13 and is output to the outside (steps S33 to S3).
7).

以下順次、第2回目から第3回目まで同様の手順で移動
平均の演算が行なわれ、第3回目の移動平均演算の終了
時にはメモリM11 には計測結果x3、メモリM12 にはx1
x2+x3の合計値、メモリM13 は の計算値が格納されている。
Subsequently, the moving average calculation is sequentially performed from the second time to the third time in the same procedure. At the end of the third moving average calculation, the measurement result x 3 is stored in the memory M11 and x 1 + is stored in the memory M12.
x 2 + x 3 total value, memory M13 The calculated value of is stored.

第4回目の計測値X が得られると、手順はステップS3
1 →S32 →S34 →S40 と進み、これまでの合計値に最新
の計測値X が加えられ、前回の移動平均値 が減算され、この計算結果、 がメモリM12 に記憶される(ステップS40 〜S41)。
When the fourth measured value X 1 is obtained, the procedure is step S3.
1 → S32 → S34 → S40 and the latest measured value X is added to the total value so far, and the previous moving average value Is subtracted and the result of this calculation is Is stored in the memory M12 (steps S40 to S41).

次に、移動平均の演算が行なわれ、移動平均値 がメモリM13 に記憶される。以下同様の手順で、5回目
以降の演算処理が行なわれる。なお、計算値が高速でサ
ンプリングされる場合、上述の例でx1と近似的に等しく、結果としては従来技術の説明で行っ
た4回目の移動平均値 とほぼ同じ値を得ることができる(ステップS42 〜S4
8)。
Next, the moving average is calculated, and the moving average value is calculated. Is stored in the memory M13. The fifth and subsequent arithmetic processes are performed in the same procedure. Note that if the calculated value is sampled at high speed, then x 1 is Is approximately equal to, and the result is the fourth moving average value described in the description of the prior art. It is possible to obtain almost the same value as (steps S42 to S4
8).

また、本実施例における移動平均処理ではサンプリング
回数を記憶するカウンタメモリ1個、加算結果を格納す
るメモリ1個(M12),平均値を格納するメモリ(M13) 1
個、平均値指定個数Nを記憶するメモリ1個および最新
の計測結果を記憶するメモリ(M11) 1個の合計5個だけ
を用意すれば移動平均値を求めることができる。
In addition, in the moving average processing in this embodiment, one counter memory for storing the number of samplings, one memory for storing the addition result (M12), and one memory (M13) for storing the average value 1
The moving average value can be obtained by preparing only a total of five pieces, one memory for storing the designated number N of average values and one memory (M11) for storing the latest measurement result.

また、平均値指定個数Nが数百個となっても必要なメモ
リ個数は5個でよく、従来のように平均値回数分だけデ
ータを記憶するメモリを用意する必要がないので、デー
タ処理装置のメモリ容量を大幅に減ずることができる。
さらにCPU4がアクセスするメモリの数が少ないので、移
動平均に関する処理時間を短縮することも可能となる。
本実施例においては、サンプリング回数n≦Nのときは
上記(3) 式を用いたがピックアップ個数Nを用い としてもよく、また として いもよい。
Further, even if the specified number N of average values is several hundred, the number of memories required is five, and it is not necessary to prepare a memory for storing data for the number of average values as in the conventional case. Can significantly reduce the memory capacity of.
Furthermore, since the number of memories accessed by the CPU 4 is small, it is possible to shorten the processing time related to the moving average.
In this embodiment, when the number of sampling times n ≦ N, the above equation (3) is used, but the number N of pickups is used. Well, again It is okay.

また、本実施例は計測サンプリングデータをノイズ補正
する例について説明したが、画像処理データなど高速、
かつ大多数のデータに対して移動平均処理する場合に本
発明を適用できることは言うまでもない。
In addition, although the present embodiment has described the example in which the measurement sampling data is noise-corrected, high-speed processing such as image processing data,
Needless to say, the present invention can be applied to the case where moving average processing is performed on the majority of data.

〔発明の効果〕〔The invention's effect〕

以上、説明したように、本発明によれば、移動平均値を
求める際に最新の入力データ値xnをこれまでにサンプリ
ングした移動平均に求いる入力データの合計値を加え、
前回求められた移動平均値を減じて移動平均の補正演算
を行うようにしたので、移動平均に用いるサンプリング
データを全て記憶しておく必要がなくなり、従来のデー
タ処理装置に比べ、補正演算は使用するメモリの数を大
幅に減ずることができる。
As described above, according to the present invention, when calculating the moving average value, the latest input data value x n is added to the total value of the input data found in the moving average sampled so far,
Since the moving average value calculated last time is subtracted to perform the moving average correction calculation, it is not necessary to store all the sampling data used for the moving average, and the correction calculation is used compared to the conventional data processing device. The number of memories to be used can be significantly reduced.

また、メモリ数の減少に伴って、1チップのCPU をも使
用することができ装置の小型化に寄与すると共に、演算
手段がメモリとアクセスする時間が短縮され、その結
果、演算処理時間も短縮されるので、より高速に計測値
をサンプリングすることができるので、計測値の精度を
向上することができるという効果が得られる。
Further, as the number of memories decreases, a one-chip CPU can be used, which contributes to downsizing of the device, and the time for the arithmetic means to access the memory is shortened, and as a result, the arithmetic processing time is also shortened. Since the measurement values can be sampled at higher speed, the accuracy of the measurement values can be improved.

【図面の簡単な説明】[Brief description of drawings]

第1図は本発明実施例の基本構成を示すブロック図、 第2図は本発明実施例の具体的構成を示すブロック図、 第3図(A) 〜(C) は本発明実施例のCPU4が実行する制御
手順を示すフローチャート、 第4図は従来例の移動平均の演算過程を示す説明図、 第5図は従来例の移動平均演算を示す説明図である。 1……センサ、 2……アンプ、 3……A/D 変換器3、 4……CPU 。
FIG. 1 is a block diagram showing the basic constitution of the embodiment of the present invention, FIG. 2 is a block diagram showing the concrete constitution of the embodiment of the present invention, and FIGS. 3 (A) to (C) are CPU4 of the embodiment of the present invention. FIG. 4 is an explanatory view showing a moving average calculation process of a conventional example, and FIG. 5 is an explanatory view showing a moving average calculation of a conventional example. 1 ... Sensor, 2 ... Amplifier, 3 ... A / D converter 3, 4 ... CPU.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 平田 伸生 神奈川県川崎市川崎区田辺新田1番1号 富士電機株式会社内 (72)発明者 三谷 重一 神奈川県川崎市川崎区田辺新田1番1号 富士電機株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Nobuo Hirata Inventor No. 1 Tanabe Shinden, Kawasaki-ku, Kawasaki-shi, Kanagawa Fuji Electric Co., Ltd. (72) Shigekazu Mitani 1 Tanabe Nitta, Kawasaki-ku, Kawasaki-shi, Kanagawa No. 1 within Fuji Electric Co., Ltd.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】2以上の整数である所定値Nと変数nとが
n>Nとして、 前回までサンプリングされて入力されたn-N 回目の入力
データXn-Nからn-1 回目の入力データ、xn-1のN個の入
力データを用いて今回のn回目にサンプリングされた入
力データxnに対してノイズ補正を行った移動平均値 を求めるデータ処理装置において、 前回のn-1 回目の入力データxn-1に対する移動平均値を とすると、次式 を用いて、今回のn回目の入力データxnに対する移動平
均値 を求め、今回求めた の値を次回の演算の際には として上記式に代入することにより上記 を順次演算して、出力する演算手段を具備したことを特
徴とするデータ処理装置。
1. A predetermined value N, which is an integer of 2 or more, and a variable n, where n> N, and the nNth input data Xn-N to the n-1th input data, which have been sampled and input until the previous time, x. A moving average value obtained by performing noise correction on the input data x n sampled at the nth time using N input data of n-1 In the data processor that obtains the moving average value for the previous n-1th input data x n-1 Then, Using, the moving average value for the nth input data x n I asked for this time The value of will be calculated next time By substituting into the above equation as A data processing device comprising a calculation means for sequentially calculating and outputting.
【請求項2】請求項1に記載のデータ処理装置におい
て、前記演算手段は、n≦Nのときは前記移動平均値 として次式 を用いて演算し、n=Nのときに得られた の演算値を前記 の初期値としてxN+1の入力データを処理するときに代入
することを特徴とするデータ処理装置。
2. The data processing apparatus according to claim 1, wherein the arithmetic means is the moving average value when n ≦ N. As And obtained when n = N The calculated value of A data processing device characterized by substituting when x N + 1 input data is processed as an initial value of.
JP63087299A 1988-04-11 1988-04-11 Data processing device Expired - Lifetime JPH0654241B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63087299A JPH0654241B2 (en) 1988-04-11 1988-04-11 Data processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63087299A JPH0654241B2 (en) 1988-04-11 1988-04-11 Data processing device

Publications (2)

Publication Number Publication Date
JPH01260314A JPH01260314A (en) 1989-10-17
JPH0654241B2 true JPH0654241B2 (en) 1994-07-20

Family

ID=13910947

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63087299A Expired - Lifetime JPH0654241B2 (en) 1988-04-11 1988-04-11 Data processing device

Country Status (1)

Country Link
JP (1) JPH0654241B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009186341A (en) * 2008-02-07 2009-08-20 Nippon Seiki Co Ltd Driving device of instrument

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2637330B2 (en) * 1992-03-30 1997-08-06 株式会社島津製作所 Electromagnetic flow meter
JP2006065497A (en) * 2004-08-25 2006-03-09 Sanyo Electric Co Ltd Data processor, and method and program for processing data

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009186341A (en) * 2008-02-07 2009-08-20 Nippon Seiki Co Ltd Driving device of instrument

Also Published As

Publication number Publication date
JPH01260314A (en) 1989-10-17

Similar Documents

Publication Publication Date Title
US6956505B2 (en) Signal processing apparatus for encoder
US5537855A (en) Knock detection method and apparatus with dual integration windows
JPH0611477A (en) Carbon dioxide gas concentration sensing device
JPH0364216A (en) Method and apparatus for accurately digitalizing analog signal
JPH0654241B2 (en) Data processing device
JPS634199B2 (en)
JP3610707B2 (en) Magnetic measuring instrument
US5431056A (en) Method for depth compensation of amplitudes of echo-signals in an ultrasonic measuring device which uses the pulse-echo-technique
CN111510142A (en) AD code word calibration method, device, equipment and storage medium
JP3210942B2 (en) Gas concentration detection method
CN114329345A (en) Inclination angle calculation method and device of handheld device, electronic device and storage medium
JPH09196846A (en) Gas concentration detecting method
KR20020023328A (en) Apparatus and method to measure high frequency power
JPS61138133A (en) Load cell unit
JP2558894Y2 (en) Electronic switch
JPH07254858A (en) Code converter
JPS55121108A (en) Dynamic error correcting method for analog signal
JPS58186841A (en) Logarithmic converter
JP2880351B2 (en) Analog signal input / output device
JP2002267507A (en) Automatic adjustment method of internal calibration signal and device using the same
JPH0661749A (en) Correction coefficient determination method
JPH06317603A (en) Frequency converter
JPH09159518A (en) Acquisition method of data for non-linearity correction of balance
JPH0795965A (en) Hemomanometer
JPS6240754B2 (en)