JP2003204248A - Moving average circuit - Google Patents
Moving average circuitInfo
- Publication number
- JP2003204248A JP2003204248A JP2002000610A JP2002000610A JP2003204248A JP 2003204248 A JP2003204248 A JP 2003204248A JP 2002000610 A JP2002000610 A JP 2002000610A JP 2002000610 A JP2002000610 A JP 2002000610A JP 2003204248 A JP2003204248 A JP 2003204248A
- Authority
- JP
- Japan
- Prior art keywords
- moving average
- data
- delay
- average circuit
- unit
- 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
Links
Landscapes
- Complex Calculations (AREA)
Abstract
(57)【要約】
【課題】 本発明はデジタル信号処理においてデータの
移動平均を演算する移動平均回路に関し、回路規模を小
さくすることができる移動平均回路を提供することを目
的とする。
【解決手段】 入力データを累積加算する第1累積加算
部と、入力データを遅延させる遅延部と、遅延部で遅延
された出力データを累積加算する第2累積加算部と、第
1累積加算部の出力データから第2累積加算部の出力デ
ータを減算する減算器とを有することを特徴とする。
(57) Abstract: The present invention relates to a moving average circuit that calculates a moving average of data in digital signal processing, and an object of the present invention is to provide a moving average circuit that can reduce the circuit scale. A first accumulator for accumulating input data, a delay for delaying input data, a second accumulator for accumulating output data delayed by the delay, and a first accumulator And a subtractor for subtracting the output data of the second accumulator from the output data of the second accumulator.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、デジタル信号処理
においてデータの移動平均を演算する移動平均回路に関
する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a moving average circuit for calculating a moving average of data in digital signal processing.
【0002】[0002]
【従来の技術】従来、移動平均回路は、ノイズの高周波
成分を除去する目的で計測機器で多用されてきた。そし
て、この移動平均回路の構成としては、例えば図5に示
すようなものが知られている。この移動平均回路は、8
個のデータの移動平均を演算するもので、入力データを
8クロック分遅延させるために8個のレジスタ1を備え
たシフトレジスタ3を有している。また、この移動平均
回路は、シフトレジスタ3内の2個のレジスタ1の出力
データを加算する加算器5Aと、この加算結果を格納す
るレジスタ1Aとをそれぞれ4個ずつ備えた第1演算部
7を有している。さらに、この移動平均回路は、第1演
算部7内の2個のレジスタ1Aの出力データを加算する
加算器5Bと、この加算結果を格納するレジスタ1Bと
をそれぞれ2個ずつ備えた第2演算部9を有している。
そして、この移動平均回路は、第2演算部9内の2個の
レジスタ1Bの出力データを加算する加算器5Cと、こ
の加算結果を格納するレジスタ1Cとをそれぞれ1個ず
つ備えた第3演算部11を有している。また、この移動
平均回路は、第3演算部11からの出力データをシフト
レジスタ3内のレジスタ1の個数である8で除算する分
割器13を有している。2. Description of the Related Art Conventionally, a moving average circuit has been frequently used in measuring instruments for the purpose of removing high frequency components of noise. As a configuration of this moving average circuit, for example, one shown in FIG. 5 is known. This moving average circuit has 8
It calculates a moving average of the data, and has a shift register 3 including eight registers 1 for delaying the input data by eight clocks. The moving average circuit also includes a first arithmetic unit 7 including four adders 5A for adding the output data of the two registers 1 in the shift register 3 and four registers 1A for storing the addition results. have. Furthermore, this moving average circuit is provided with an adder 5B that adds the output data of the two registers 1A in the first operation unit 7 and two registers 1B that store the result of the addition. It has a part 9.
Then, the moving average circuit is provided with the adder 5C for adding the output data of the two registers 1B in the second operation unit 9 and the register 1C for storing the addition result, respectively. It has a section 11. Further, this moving average circuit has a divider 13 that divides the output data from the third arithmetic unit 11 by 8 which is the number of registers 1 in the shift register 3.
【0003】そして、この移動平均回路では、クロック
がシフトレジスタ3に入力される度にシフトレジスタ3
内のデータが更新され、第1〜第3演算部7,9,11
での演算結果も更新され、最後に分割器13で除算さ
れ、入力データの移動平均が算出される。In this moving average circuit, every time a clock is input to the shift register 3, the shift register 3
The data inside is updated, and the first to third arithmetic units 7, 9, 11 are updated.
The calculation result in (1) is also updated and finally divided by the divider 13 to calculate the moving average of the input data.
【0004】[0004]
【発明が解決しようとする課題】しかしながら、上述し
たような移動平均回路では、移動平均をとるデータの数
が増えると、シフトレジスタ3内のレジスタ1の個数が
増え、それに伴い加算器5A,5B,5Cの個数とこの
加算器5A,5B,5Cの加算結果を格納するレジスタ
1A,1B,1Cの個数とが増え、回路規模が大きくな
るという問題があった。However, in the moving average circuit as described above, when the number of data for moving average increases, the number of registers 1 in the shift register 3 increases, and accordingly, the adders 5A and 5B are added. , 5C and the number of registers 1A, 1B, 1C for storing the addition results of the adders 5A, 5B, 5C are increased, which causes a problem that the circuit scale is increased.
【0005】本発明は、かかる従来の問題を解決するた
めになされたもので、回路規模を小さくすることができ
る移動平均回路を提供することを目的とする。The present invention has been made in order to solve such a conventional problem, and an object thereof is to provide a moving average circuit capable of reducing the circuit scale.
【0006】[0006]
【課題を解決するための手段】請求項1の移動平均回路
は、入力データを累積加算する第1累積加算部と、前記
入力データを遅延させる遅延部と、前記遅延部で遅延さ
れた出力データを累積加算する第2累積加算部と、前記
第1累積加算部の出力データから前記第2累積加算部の
出力データを減算する減算器とを有することを特徴とす
る。According to another aspect of the present invention, a moving average circuit includes a first cumulative addition section for cumulatively adding input data, a delay section for delaying the input data, and output data delayed by the delay section. And a subtractor for subtracting the output data of the second cumulative addition unit from the output data of the first cumulative addition unit.
【0007】請求項2の移動平均回路は、請求項1記載
の移動平均回路において、前記遅延部で遅延させるクロ
ック数を選択するための遅延制御部を有することを特徴
とする。A moving average circuit according to a second aspect is the moving average circuit according to the first aspect, further comprising a delay control section for selecting a number of clocks to be delayed by the delay section.
【0008】[0008]
【発明の実施の形態】以下、本発明を図面を用いて詳細
に説明する。
(第1の実施形態)図1は、本発明の移動平均回路の第
1の実施形態(請求項1に対応する)を示すブロック図
である。DETAILED DESCRIPTION OF THE INVENTION The present invention will be described in detail below with reference to the drawings. (First Embodiment) FIG. 1 is a block diagram showing a first embodiment (corresponding to claim 1) of a moving average circuit of the present invention.
【0009】この第1の実施形態の移動平均回路14
は、クロック毎に入力される入力データ15Sを累積加
算する第1累積加算部である累積加算部17と、入力デ
ータ15Sをnクロック分遅延させる遅延部19とを有
している。また、移動平均回路14は、遅延部19で遅
延された出力データ21Sを累積加算する第2累積加算
部である遅延データ累積加算部23と、累積加算部17
の出力データ25Sから遅延データ累積加算部23の出
力データ27Sを減算する減算器29とを有している。
さらに、移動平均回路14は、減算器29の出力データ
31Sを遅延部19で遅延されたクロック数nで除算
し、移動平均データ33Sを出力する分割器35を有し
ている。The moving average circuit 14 of the first embodiment
Includes a cumulative addition unit 17 that is a first cumulative addition unit that cumulatively adds the input data 15S that is input for each clock, and a delay unit 19 that delays the input data 15S by n clocks. The moving average circuit 14 also includes a delay data cumulative addition unit 23, which is a second cumulative addition unit that cumulatively adds the output data 21S delayed by the delay unit 19, and a cumulative addition unit 17.
And the subtracter 29 for subtracting the output data 27S of the delay data cumulative addition unit 23 from the output data 25S of.
Furthermore, the moving average circuit 14 has a divider 35 that divides the output data 31S of the subtractor 29 by the number of clocks n delayed by the delay unit 19 and outputs moving average data 33S.
【0010】かかる構成により、入力データ15Sをす
べて累積加算した累積加算部17の出力データ25Sか
らnクロック分遅延されて累積加算した遅延データ累積
加算部23の出力データ27Sが減算され、最後に分割
器35において自然数nで除算され、入力データ15S
の移動平均が算出される。図2は、移動平均回路14の
詳細を示す説明図である。With this configuration, the output data 27S of the delayed data accumulative addition unit 23 delayed by n clocks and cumulatively added is subtracted from the output data 25S of the accumulative addition unit 17 to which all the input data 15S have been accumulatively added, and finally divided. Input data 15S divided by natural number n in the instrument 35
The moving average of is calculated. FIG. 2 is an explanatory diagram showing details of the moving average circuit 14.
【0011】図に示すように、累積加算部17は、加算
器39Aとこの加算器39Aの演算結果を格納するレジ
スタ41Aとを有している。遅延データ累積加算部23
は、累積加算部17と同様に加算器39Bとこの加算器
39Bの演算結果を格納するレジスタ41Bとを有して
いる。遅延部19は、直列に配置された8個のレジスタ
41C1〜41Cnを有している。As shown in the figure, the cumulative addition unit 17 has an adder 39A and a register 41A for storing the calculation result of this adder 39A. Delay data cumulative addition unit 23
Like the cumulative addition unit 17, has an adder 39B and a register 41B for storing the calculation result of this adder 39B. The delay unit 19 has eight registers 41C1 to 41Cn arranged in series.
【0012】つぎに、この移動平均回路14の動作につ
いて説明する。まず、入力データ15Sは、クロック毎
に累積加算部17と遅延部19とに入力される。累積加
算部17への入力データ15Sは、加算器39Aにおい
て、入力データ15Sの加算器39Aへの入力時にレジ
スタ41Aに格納されているデータと加算される。つい
で、この加算結果は、レジスタ41Aに入力され、それ
まで格納されていたデータと入れ替えられる。ついで、
このレジスタ41Aで格納されたデータは、つぎに加算
器39Aにクロックが入力されたときに出力データ25
Sとして減算器29に入力される。Next, the operation of the moving average circuit 14 will be described. First, the input data 15S is input to the cumulative addition unit 17 and the delay unit 19 for each clock. In the adder 39A, the input data 15S to the cumulative addition unit 17 is added to the data stored in the register 41A when the input data 15S is input to the adder 39A. Next, this addition result is input to the register 41A and is replaced with the data stored until then. Then,
The data stored in the register 41A is output data 25 when the clock is next input to the adder 39A.
It is input to the subtractor 29 as S.
【0013】一方、遅延部19への入力データ15S
は、レジスタ41C1に入力され、それまでレジスタ41
C1にあったデータは41C2に入力される。同様に、順
次、図中右隣のレジスタ41C3〜41Cnに入力され、4
1Cnにあったデータは出力データ21Sとして遅延デー
タ累積加算部23に入力される。ついで、遅延データ累
積加算部23において、累積加算部17と同様の処理が
行われ、出力データ27Sを減算器29に入力する。On the other hand, input data 15S to the delay unit 19
Is input to the register 41C1 and the register 41C1
The data that was in C1 is input to 41C2. Similarly, it is sequentially input to the registers 41C3 to 41Cn on the right side of the drawing,
The data in 1Cn is input to the delay data cumulative addition unit 23 as the output data 21S. Next, in the delay data cumulative addition unit 23, the same processing as the cumulative addition unit 17 is performed, and the output data 27S is input to the subtractor 29.
【0014】ついで、減算器29において、出力データ
25Sと出力データ27Sの差が求められる。最後に、
この減算器29の出力データ31Sが分割器35で自然
数nで除され、移動平均データ33Sが算出される。こ
の第1の実施形態の移動平均回路14では、シフトレジ
スタ41C1〜41Cnの個数を増減させると、その増減数
だけ移動平均数を増減するので、簡単な構成により移動
平均を算出することができる上、回路規模を小さくする
ことができる。Then, the subtracter 29 obtains the difference between the output data 25S and the output data 27S. Finally,
The output data 31S of the subtractor 29 is divided by the natural number n in the divider 35 to calculate moving average data 33S. In the moving average circuit 14 of the first embodiment, when the number of shift registers 41C1 to 41Cn is increased / decreased, the moving average number is increased / decreased, so that the moving average can be calculated with a simple configuration. The circuit scale can be reduced.
【0015】また、この第1の実施形態の移動平均回路
14では、移動平均数を増加させる場合には、遅延部1
9内の直列に配置されたシフトレジスタ41C1〜41Cn
の数を増加させれば良いため、シフトレジスタ41Ck〜
41Cn(2≦k≦n)を増設すれば、移動平均数の増加
に容易に対応することができる。一方、移動平均数を減
少させる場合には、遅延部19内の直列に配置されたシ
フトレジスタ41C1〜41Cnの数を減少させれば良いた
め、シフトレジスタ41C1〜41Cnの一部を着脱自在に
構成すれば、移動平均数の減少に容易に対応することが
できる。In addition, in the moving average circuit 14 of the first embodiment, when the moving average number is increased, the delay unit 1
9 serially arranged shift registers 41C1 to 41Cn
The number of shift registers 41Ck-
If 41 Cn (2 ≦ k ≦ n) is added, it is possible to easily cope with the increase in the number of moving averages. On the other hand, when the number of moving averages is reduced, the number of shift registers 41C1 to 41Cn arranged in series in the delay unit 19 may be reduced. Therefore, some of the shift registers 41C1 to 41Cn are detachably configured. By doing so, it is possible to easily cope with the decrease in the number of moving averages.
【0016】(第2の実施形態)図3は、本発明の移動
平均回路の第2の実施形態(請求項2に対応する)を示
すブロック図である。なお、この第2の実施形態におい
て、第1の実施形態と同一の部材には同一の符号を付
し、詳細な説明を省略する。(Second Embodiment) FIG. 3 is a block diagram showing a second embodiment (corresponding to claim 2) of the moving average circuit of the present invention. In addition, in this 2nd Embodiment, the same code | symbol is attached | subjected to the member same as 1st Embodiment, and detailed description is abbreviate | omitted.
【0017】この第2の実施形態の移動平均回路43で
は、遅延部19で遅延させるクロック数をn以下の自然
数の中から選択するための遅延制御部45が設けられて
いる。そして、遅延制御部45と分割器35とに移動平
均個数信号47Sが入力される。つぎに、図4を用いて
遅延制御部45の動作について説明する。この第2の実
施形態の移動平均回路43では、まず、何クロック分前
までの入力データ15Sの平均をとるかを指示するため
の移動平均個数信号47Sが、遅延制御部45と分割器
35とに入力される。The moving average circuit 43 of the second embodiment is provided with a delay control section 45 for selecting the number of clocks delayed by the delay section 19 from a natural number of n or less. Then, the moving average number signal 47S is input to the delay control unit 45 and the divider 35. Next, the operation of the delay control unit 45 will be described with reference to FIG. In the moving average circuit 43 of the second embodiment, first, the moving average number signal 47S for instructing how many clocks ago the input data 15S is averaged is transmitted to the delay controller 45 and the divider 35. Entered in.
【0018】ついで、分割器35は、この移動平均個数
信号47Sに基づいて、減算器29からの出力データ3
1Sを自然数m(m≦n)で除する。一方、遅延制御部
45は、移動平均個数信号47Sに基づいて、レジスタ
41C1〜41Cnの内からレジスタ41C1〜41Cmが起動
されるように、遅延部19との接続を行う。この第2の
実施形態の移動平均回路43においても、第1の実施形
態と同様の効果を得ることができる。Next, the divider 35 outputs the output data 3 from the subtractor 29 based on the moving average number signal 47S.
1S is divided by a natural number m (m ≦ n). On the other hand, the delay control unit 45 connects with the delay unit 19 so that the registers 41C1 to 41Cm are activated from the registers 41C1 to 41Cn based on the moving average number signal 47S. Also in the moving average circuit 43 of the second embodiment, the same effect as that of the first embodiment can be obtained.
【0019】そして、この第2の実施形態の移動平均回
路43では、遅延部19で遅延させるクロック数をn以
下の自然数の中から選択するための遅延制御部45を設
けたので、遅延制御部45と分割器35とに移動平均個
数信号47Sを入力するだけで、所定の数の移動平均を
算出することができるから、移動平均数の変更を容易に
行うことができる。Since the moving average circuit 43 of the second embodiment is provided with the delay control unit 45 for selecting the number of clocks to be delayed by the delay unit 19 from a natural number of n or less, the delay control unit is provided. Since a predetermined number of moving averages can be calculated only by inputting the moving average number signal 47S to 45 and the divider 35, the moving average number can be easily changed.
【0020】[0020]
【発明の効果】以上述べたように、本発明の移動平均回
路では、遅延部のシフトレジスタの個数のみを増減して
移動平均数を増減するようにしたので、簡単な構成によ
り移動平均を算出することができる上、回路規模を小さ
くすることができる。As described above, in the moving average circuit of the present invention, the moving average number is increased or decreased by increasing or decreasing only the number of shift registers in the delay section. Therefore, the moving average can be calculated with a simple configuration. In addition, the circuit scale can be reduced.
【図1】本発明の移動平均回路の第1の実施形態を示す
ブロック図である。FIG. 1 is a block diagram showing a first embodiment of a moving average circuit of the present invention.
【図2】本発明の移動平均回路の第1の実施形態の詳細
を示す説明図である。FIG. 2 is an explanatory diagram showing details of the first embodiment of the moving average circuit of the present invention.
【図3】本発明の移動平均回路の第2の実施形態を示す
ブロック図である。FIG. 3 is a block diagram showing a second embodiment of the moving average circuit of the present invention.
【図4】本発明の移動平均回路の第2の実施形態の詳細
を示す説明図である。FIG. 4 is an explanatory diagram showing details of a second embodiment of the moving average circuit of the present invention.
【図5】従来の移動平均回路の一実施形態を示すブロッ
ク図である。FIG. 5 is a block diagram showing an embodiment of a conventional moving average circuit.
15S 入力データ 17 累積加算部 19 遅延部 21S,25S,27S,31S 出力データ 23 遅延データ累積加算部 29 減算器 35 分割器 45 遅延制御部 15S input data 17 Cumulative adder 19 Delay section 21S, 25S, 27S, 31S output data 23 Delayed data cumulative adder 29 Subtractor 35 divider 45 Delay control unit
Claims (2)
部と、 前記入力データを遅延させる遅延部と、 前記遅延部で遅延された出力データを累積加算する第2
累積加算部と、 前記第1累積加算部の出力データから前記第2累積加算
部の出力データを減算する減算器と、 を有することを特徴とする移動平均回路。1. A first cumulative addition unit for cumulatively adding input data, a delay unit for delaying the input data, and a second cumulative addition for output data delayed by the delay unit.
A moving average circuit comprising: a cumulative addition unit; and a subtractor that subtracts the output data of the second cumulative addition unit from the output data of the first cumulative addition unit.
延制御部を有することを特徴とする移動平均回路。2. The moving average circuit according to claim 1, further comprising a delay control unit for selecting the number of clocks to be delayed by the delay unit.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002000610A JP2003204248A (en) | 2002-01-07 | 2002-01-07 | Moving average circuit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002000610A JP2003204248A (en) | 2002-01-07 | 2002-01-07 | Moving average circuit |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2003204248A true JP2003204248A (en) | 2003-07-18 |
Family
ID=27640946
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002000610A Pending JP2003204248A (en) | 2002-01-07 | 2002-01-07 | Moving average circuit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2003204248A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8553825B2 (en) | 2009-03-18 | 2013-10-08 | Fujitsu Limited | Phase synchronization apparatus and digital coherent light receiver |
-
2002
- 2002-01-07 JP JP2002000610A patent/JP2003204248A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8553825B2 (en) | 2009-03-18 | 2013-10-08 | Fujitsu Limited | Phase synchronization apparatus and digital coherent light receiver |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH11266140A (en) | Programmable circuit for providing digital filter | |
| US8977671B2 (en) | Divider circuit and division method | |
| JPH05204611A (en) | Method and device for executing pre-scale type division | |
| JP2003204248A (en) | Moving average circuit | |
| JP2006227939A (en) | Arithmetic unit | |
| JPH07234778A (en) | Arithmetic circuit | |
| JPH0744530A (en) | Arithmetic unit | |
| US6449629B1 (en) | Three input split-adder | |
| JP4042364B2 (en) | Address generation circuit, selection decision circuit | |
| JP2011147009A (en) | Digital filter and digital filtering method | |
| JP5120216B2 (en) | Distortion compensation circuit | |
| JP2007163318A (en) | Radar signal processing device and its method of detecting certain false alarm probability | |
| JP2006287634A (en) | Signal processing apparatus, signal processing method, and noise reduction apparatus | |
| JP2000172487A (en) | Multiplier circuit and method therefor | |
| JP4219926B2 (en) | Method and apparatus for performing multiplication or division in an electronic circuit | |
| JPH0828646B2 (en) | Digital filter | |
| JPH10133856A (en) | Multiplying method and multiplier with rounding function | |
| JP3264603B2 (en) | Digital signal processor | |
| US20020126858A1 (en) | Digital base booster using arithmetic processor | |
| JP2000165204A (en) | Iir type digital low pass filter | |
| JP4645337B2 (en) | Waveform data interpolation device | |
| JP2009065515A (en) | Digital filter | |
| JP3722821B2 (en) | Calculation method | |
| US20060047736A1 (en) | Arithmetic circuitry for averaging and methods thereof | |
| JP2004222040A (en) | Digital filter |