JP4196434B2 - Data rounding method and data rounding device - Google Patents

Data rounding method and data rounding device Download PDF

Info

Publication number
JP4196434B2
JP4196434B2 JP19843398A JP19843398A JP4196434B2 JP 4196434 B2 JP4196434 B2 JP 4196434B2 JP 19843398 A JP19843398 A JP 19843398A JP 19843398 A JP19843398 A JP 19843398A JP 4196434 B2 JP4196434 B2 JP 4196434B2
Authority
JP
Japan
Prior art keywords
data
bits
rounding
bit
impulse response
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
JP19843398A
Other languages
Japanese (ja)
Other versions
JP2000029668A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP19843398A priority Critical patent/JP4196434B2/en
Publication of JP2000029668A publication Critical patent/JP2000029668A/en
Application granted granted Critical
Publication of JP4196434B2 publication Critical patent/JP4196434B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、ディジタル化された数値を丸めるためのデータ丸め方法およびデータ丸め装置に関するものである。
【0002】
【従来の技術】
ディジタル計算機などにおいて、2つの2進数値データの乗算を行う場合、その乗算結果として得られる2進数値データを表現するために必要なビット数は、元のデータのビット数よりも大きくなる。例えば、nビット計算機において乗算を行う場合、通常、乗算前の2つの2進数値データはnビットであるが、その乗算結果は、2nビットのデータとなる。
【0003】
しかしながら、その乗算結果を記憶する場合、ビット数をnビットに丸める必要が生じることが多い。このようなとき、最も簡単な丸め方式は、下位nビットを切り捨てる方法である。しかし、この方法では、正および負の数値に対して対称な丸め結果が得られない。
【0004】
図9は、単純な切り捨てによる丸めを行った場合の丸め結果を示す例である。具体的には、図9は、8ビットの2進数値を丸めて、4ビットの2進数値を得る場合の様子を図式的に示したものである。なお、同図において、丸め前の8ビットデータの小数点位置が、下位4ビット目と5ビット目の間にあるものとし、データは、2の補数形式で表現されているものとする。
【0005】
図9の(a)から分かるように、丸め前のデータが正の数値3.75である場合、丸め後のデータは3.0となり、また、同図の(b)からは、丸め前のデータが負の数値−3.75である場合、丸め後のデータは−4.0となることが分かる。つまり、正および負の数値に対して対称な丸め結果が得られない。そして、このような丸め方式を、信号処理などでよく見られる、一連の積和演算に用いると、丸め誤差が負の方向に蓄積されて、著しい演算精度の劣化が生じる、という不都合がある。
【0006】
この不具合を避けるため、従来より使用されている方法として、図10に示すようなデータ丸め方式がある。図10は、特開昭64−58020号公報に開示された「数値丸め処理方式」の流れを示すフローチャートであり、あるデータAの下位kビットの丸め結果Bを得る場合の丸め方式を説明するものである。
【0007】
図10のステップS1において、丸め前のデータAに2k-1を加算し(加算結果をA´とする)、ステップS2では、この加算後のデータA´の下位kビットを切り捨てている。これは、四捨五入である。四捨五入は、切り捨てを実施する前に、切り捨てられるビット中の最上位ビットのみが1で、他のビットが全て0であるデータを加算した後、切り捨てを実施するもので、図11の(a),(b)は、この四捨五入による丸めを行った場合の丸め結果を示す例である。
【0008】
図11の(a)に示すように、丸め前のデータが正の数値3.75のとき、丸め後は4.0、また、(b)に示すように、丸め前のデータが負の数値−3.75のとき、丸め後は−4.0となっている。つまり、図11に示す方法では、正および負の数値に対して対称な丸め結果が得られる。
【0009】
しかしながら、図12に示すように、丸め前のデータにおいて、切り捨てられるビット中の最上位ビットのみが1で、その他が0である場合、上記の方法には問題がある。図11を参照すると、丸め前のデータが正の数値3.5のとき、丸め後は4.0、また、丸め前のデータが負の数値−3.5のとき、丸め後は−3.0となっており、正および負の数値に対して、対称な丸め結果が得られていない。
【0010】
一方、正および負の2進数値に対して、常に対称な丸め結果を与える方式として、例えば、特開昭48−27648号公報に示す「丸め装置」がある。この公報に示された丸め処理は、丸め前のデータが正の場合、切り捨てを実施する前に、切り捨てられるビット中の最上位ビットのみが1で、その他のビットが0であるデータを加算した後に、切り捨てを実施する。また、この処理では、丸め前のデータが負の場合、切り捨てを実施する前に、切り捨てられるビット中の最上位ビットと、それ以上のビットが0で、その他のビットが1であるデータを加算した後に、切り捨てを実施している。このような丸め処理によれば、あらゆる場合において、正および負の2進数値に対して、対称な丸め結果を与えることが可能となる。
【0011】
【発明が解決しようとする課題】
しかしながら、上記従来の丸め方式では、正および負の数値に対して対称な丸め結果が得られないか、あるいは、丸め前のデータが正の場合と負の場合とで処理が異なるため、その正負の判断が必要となる。そして、この判断を行って、対称な丸め結果を得ようとすると、その処理が非常に複雑となる、という問題がある。
【0012】
また、従来の丸め方式を、例えば、適応フィルタに用いた場合にも、正および負の2進数値に対して、対称な丸め結果が得られないため、インパルス応答の推定精度が良くならない、という問題がある。
【0013】
本発明は、上述の課題に鑑みてなされたもので、その目的とするところは、正および負の2進数値に対して、対称な丸め結果を与えるとともに、丸め前のデータの正負を判断する必要のないデータ丸め方法およびデータ丸め装置を提供することである。
【0014】
【課題を解決するための手段】
上記目的を達成するために、第1の発明は、データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め方法において、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持するステップと、n−mビットの0のデータを保持するステップと、上記丸め前データの上位mビットの上位ビット側に、上記n−mビットの0のデータを合成するステップと、上記丸め前データと、上記丸め前の上位mビットの上位ビット側にn−mビットの0のデータを合成したデータとを加算するステップと、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得るステップとを備えるコンピュータシステムにより実行されるデータ丸め方法を提供する。
第2の発明は、データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め装置において、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、n−mビットのデータを保持する手段と、上記丸め前データの上位mビットの上位ビット側に、上記n−mビットのデータを合成する手段と、上記丸め前データと、上記丸め前の上位mビットの上位ビット側にn−mビットのデータを合成したデータとを加算する手段とを備え、上記n−mビットのデータを保持する手段に全て0のデータを保持して、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得るデータ丸め装置を提供する。
【0015】
第3の発明は、データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め方法において、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持するステップと、上記丸め前データに対してn−mビットの右シフトを行うステップと、上記丸め前データと、上記丸め前のデータに対してn−mビット右シフトしたデータとを加算するステップと、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得るステップとを備えるコンピュータシステムにより実行されるデータ丸め方法を提供する。
第4の発明は、データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め装置において、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、上記丸め前データに対してn−mビットの右シフトを行う手段と、上記丸め前データと、上記丸め前のデータに対してn−mビット右シフトしたデータとを加算する手段とを備え、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得るデータ丸め装置を提供する。
【0016】
第5の発明は、未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、上記擬似応答信号と上記未知のシステムからの応答信号との差分をもとに、上記インパルス応答推定データの修正量を算出する手段と、上記修正量と上記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで使用するデータ丸め装置において、上記適用フィルタは、上記算出されたインパルス応答推定データの修正量と前回までの上記インパルス応答推定データとの加算値を丸めて新たなインパルス応答推定データとする構成とされており、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、n−mビットのデータを保持する手段と、上記丸め前データの上位mビットの上位ビット側に、上記n−mビットのデータを合成する手段と、上記丸め前データと、上記丸め前の上位mビットの上位ビット側にn−mビットのデータを合成したデータとを加算する手段とを備え、上記n−mビットのデータを保持する手段に全て0のデータを保持して、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得るデータ丸め装置を提供する。
第6の発明は、未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、上記擬似応答信号と上記未知のシステムからの応答信号との差分をもとに、上記インパルス応答推定データの修正量を算出する手段と、上記修正量と上記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで用いるデータ丸め装置において、上記適用フィルタは、上記算出されたインパルス応答推定データの修正量を丸める構成とされており、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、n−mビットのデータを保持する手段と、上記丸め前データの上位mビットの上位ビット側に、上記n−mビットのデータを合成する手段と、上記丸め前データと、上記丸め前の上位mビットの上位ビット側にn−mビットのデータを合成したデータとを加算する手段とを備え、上記n−mビットのデータを保持する手段に全て0のデータを保持して、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得るデータ丸め装置を提供する。
【0017】
第7の発明は、未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、上記擬似応答信号と上記未知のシステムからの応答信号との差分をもとに、上記インパルス応答推定データの修正量を算出する手段と、上記修正量と上記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで使用するデータ丸め装置において、上記適用フィルタは、上記算出されたインパルス応答推定データの修正量と前回までの上記インパルス応答推定データとの加算値を丸めて新たなインパルス応答推定データとする構成とされており、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、上記丸め前データに対してn−mビットの右シフトを行う手段と、上記丸め前データと、上記丸め前のデータに対してn−mビット右シフトしたデータとを加算する手段とを備え、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得るデータ丸め装置を提供する。
第8の発明は、未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、上記擬似応答信号と上記未知のシステムからの応答信号との差分をもとに、上記インパルス応答推定データの修正量を算出する手段と、上記修正量と上記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで用いるデータ丸め装置において、上記適用フィルタは、上記算出されたインパルス応答推定データの修正量を丸める構成とされており、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、上記丸め前データに対してn−mビットの右シフトを行う手段と、上記丸め前データと、上記丸め前データに対してn−mビット右シフトしたデータとを加算する手段とを備え、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得るデータ丸め装置を提供する。
【0018】
【発明の実施の形態】
以下、添付図面を参照して、本発明に係る実施の形態を説明する。
実施の形態1.
図1は、本発明の実施の形態1に係る、データ丸め方式を実現する丸め処理回路の構成を示すブロック図である。なお、本実施の形態に係る丸め処理回路は、nビットのデータをn−mビットに丸める処理を行う。
【0019】
図1に示す丸め処理回路は、丸め前のデータを保持するレジスタ101、「0」が格納されたレジスタ102、nビット加算器103、そして、丸め結果を保持するレジスタ104より構成される。
【0020】
以下、本実施の形態に係る丸め処理回路の動作について説明する。
レジスタ101は、丸め前のnビットデータを保持する。レジスタ102は、n−mビットのレジスタであり、ここでは、全てのビットに「0」が格納されている。また、nビット加算器103は、2つのnビットデータを加算する。その1つは、レジスタ101に保持された、丸め前のデータである。もう1つのnビットデータは、レジスタ102の出力を、その上位n−mビットとし、レジスタ101の上位mビットを、その下位mビットとする、これらn−mビットとmビットを合成したデータである。そして、このnビット加算器103が出力する加算結果は、レジスタ104内に保持され、その上位n−mビットが、丸め結果となる。
【0021】
図2は、本実施の形態における丸め処理を説明するための図である。同図は、図1の丸め処理回路のnビット加算器103の入力データと出力を示している。また、図2では、図1のnビット加算器103の1つ目の入力データをA、もう1つの入力データをB、加算後の出力データをCとしている。
【0022】
すなわち、図2の(a)に示すように、Aは、丸め前のnビットデータ、同図の(b)に示すように、加算するデータBは、その上位n−mビットが全て「0」であり、下位mビットが、Aの上位mビットと同じ構成をとるデータである。また、AとBとの加算結果がC(同図の(c))であり、Cの上位n−mビットが、丸め結果となっている。
【0023】
そこで、以下、上記のようなデータ丸め方式が、正および負のデータに対して、対称な丸め結果を与えることを説明する。
【0024】
ある正のnビットのデータXを考えてみる。また、簡単のためn,mは、n=2mの関係があるとする。そして、このデータXの下位mビットをXL、上位mビットをXHで表すと、
X=2m・XH+XL …(1)
となる。そして、このXに対する、図1のnビット加算器103の出力をYとすると、
Y=2m・XH+XL+XH …(2)
となる。
【0025】
従って、この丸め出力をYrとすると、Yrは、XL+XH≧2mのとき、繰り上がりが発生して、
Yr=2m・XH+2m=2m・(XH+1) …(3)
となり、XL+XH<2mのときは、繰り上がりが発生せず、
Yr=2m・XH …(4)
となる。
【0026】
一方、Xの符号を反転したデータ「−X」を、上記と同様、XH,XLを用いて表すと、
−X=−2m・XH−XL …(5)
となる。そして、−Xに対する、図1のnビット加算器103の出力Zは、XL≠0のとき、
Z=−2m・XH−XL+(2m−1−XH)
=−2m・XH+(2m−XL−XH−1) …(6)
となる。
【0027】
従って、この丸め出力をZrとすると、Zrは、XL+XH≧2mのとき、2m−XL−XH−1<0であるから、繰り下がりが発生して、
Zr=−2m・XH−2m=−2m・(XH+1) …(7)
となる。また、XL+XH<2mのときは、2m−XL−XH−1≧0であるから、繰り下がりは発生せず、
Zr=−2m・XH …(8)
となる。
【0028】
このように、上記の丸め方式によれば、XL≠0の場合、正および負のデータに対して、対称な丸め結果が与えられることが分かる。また、XL=0の場合は、Xに対するnビット加算器103の出力Yが、Y=2m・XH+XHとなり、0<XH<2m-1であるから、繰り上がりは発生せず、丸め出力Yrは、常に、Yr=2m・XHとなる。
【0029】
一方、データ−Xに対するnビット加算器103の出力Zは、Z=−2m・XH+(2m−XH)となる。0<XH<2m-1であるから、2m-1<2m−XH<2mとなり、これも繰り上がり、および繰り下がりは発生せず、丸め出力Zrは、常に、Zr=−2m・XHとなる。
【0030】
以上説明したように、本実施の形態によれば、0が格納されたn−mビットのレジスタと、2つのnビットデータを加算する加算器とを備え、丸め前のデータの上位mビットを下位mビットとするnビットデータと、丸め前のnビットデータとを加算し、その加算後のデータの下位mビットを切り捨てたデータを丸め結果とすることで、正および負の2進数値に対して、対称な丸め結果が与えられるとともに、データの正負の判定をすることのないデータ丸め方式を得ることができる。
【0031】
実施の形態2.
以下、本発明に係る実施の形態2について説明する。なお、上記実施の形態1に係る処理回路は、0が格納されたn−mビットのレジスタを用いて、加算データを生成するよう構成されているが、ここでは、シフト演算器を用いて加算データを生成する。
【0032】
図3は、本発明の実施の形態2に係る、データ丸め方式を実現する丸め処理回路の構成を示すブロック図である。なお、図3に示す、本実施の形態に係る丸め処理回路において、図1に示す、上記実施の形態1に係る丸め処理回路と同一構成要素には同一符号を付し、ここでは、それらの説明を省略する。
【0033】
すなわち、図3のレジスタ101、nビット加算器103、レジスタ104は、それらに対応する、図1に示す丸め処理回路の構成要素と同様の動作をする。また、図3のn−mビットシフト演算器105は、レジスタ101に保持されている丸め前のnビットデータを入力して、n−mビットの右論理シフト演算を行い、その演算結果をnビット加算器103に出力する。
【0034】
このシフト演算器105によって行うシフト演算は、論理シフトであるから、右シフトによって空きとなった上位n−mビットは、“0詰め”される。従って、このシフト演算によって得られるnビットデータは、上記実施の形態1に係る、図2の(b)に示したデータBと同一のデータとなる。
【0035】
よって、図3のnビット加算器103は、レジスタ101に保持された、丸め前のnビットデータと、上記シフト演算によって得られたnビットデータという、2つのnビットデータを加算する。そして、上記実施の形態1と同様、このnビット加算器103が出力する加算結果は、レジスタ104内に保持され、その上位n−mビットが、丸め結果となる。
【0036】
以上説明したように、本実施の形態によれば、n−mビットのシフト演算器と、2つのnビットデータを加算する加算器とを備え、丸め前のデータをシフトして得られたnビットのデータと、丸め前のnビットデータとを加算した後、その加算後のデータの下位mビットを切り捨てたデータを丸め結果とすることで、正および負の2進数値に対して、対称な丸め結果が与えられ、データの正負の判定が不要なデータ丸め方式を得ることができる。
【0037】
実施の形態3.
以下、本発明に係る実施の形態3について説明する。上記の各実施の形態では、加算器やレジスタという具体的なハードウエアを用いてデータ丸めを実現しているが、ここでは、ソフトウェアによって実行されるデータの丸め方式を説明する。
【0038】
図4は、本実施の形態に係るソフトウェアを実行する、例えば、ディジタル信号処理プロセッサの概略構成を示すブロック図である。同図に示すディジタル信号処理プロセッサ(DSP)400において、メモリ403には、本処理の対象となるデータや演算結果が一時的に格納され、ROM402には、本実施の形態に係る処理の実行手順がプログラムとして格納されている。また、CPU401は、上記のプログラムに従って、以下に説明するデータ丸め処理を実行するとともに、本プロセッサ全体の制御を司る中央制御部である。なお、ここでの演算結果は、出力部404より、不図示の外部装置へ出力される。
【0039】
図5は、本実施の形態に係るデータ丸め方式の実行手順を示すフローチャートである。同図に示す処理では、まず、丸め前のnビットデータAを、n−mビット、右論理シフトしたデータBを算出する(ステップST1)。次に、丸め前のデータAと、この右論理シフトによって得られたデータBとを加算する(ステップST2)。そして、最後のステップST3で、この加算結果の下位mビットを切り捨てる処理を行う。
【0040】
このような手順によって実現される丸め処理は、ディジタル信号処理プロセッサなどにおいて丸め処理を実行する場合、データの正負の判断が不要になるため、少ないステップ数で、正および負のデータに対して、対称な結果を与える丸め処理を実現できる。
【0041】
また、ディジタル信号処理プロセッサは、16ビット固定小数点方式のものが大半を占めているので、その最上位ビットを符号ビット、下位15ビットを振幅ビットとして扱う場合が多い。この場合、2つの16ビットデータの乗算結果は、その最上位ビットが符号ビットで、下位31ビットが振幅ビットとなり、合計32ビットデータの下位16ビットを丸めることになる。これは、丸め後のデータのビット長が、丸め前のデータのビット長の1/2となることを意味している。このようにすることで、上述した各ステップは、全て16ビット単位での処理となり、一般に各ステップがより簡略に実現できる。
【0042】
以上説明したように、本実施の形態によれば、丸め前のデータの右シフト、この右シフトによって得られたデータと丸め前のデータとの加算、そして、加算後のデータの下位mビットの切り捨てを、純粋にソフトウエアによって実行することで、データの正負の判断が不要になるため、少ないステップ数で、正および負の2進データに対して、対称な丸め結果が得られる。特に、本プログラムをディジタル信号処理プロセッサ上で実行した場合、各処理ステップを、より簡略に実現できる。
【0043】
実施の形態4.
以下、本発明に係る実施の形態4について説明する。なお、本実施の形態に係るデータ丸め方式は、未知のシステムを推定する適応フィルタにおいて用いられる。
【0044】
図6は、本実施の形態に係るデータ丸め方式を用いる適応フィルタの構成を示すブロック図である。同図に示す適応フィルタは、参照信号の過去のサンプル値を格納するXレジスタ201、インパルス応答推定値を格納するHレジスタ202、Xレジスタ201の格納値と、Hレジスタ202の格納値との畳み込み演算を行う畳み込み積分器203、未知のシステム250の応答信号より畳み込み積分器203の出力を減算する減算器204、未知のシステム250のインパルス応答を推定して、Hレジスタ202に格納されたインパルス応答推定値の修正量を算出するΔH生成回路205、この修正量とHレジスタ202に格納されたインパルス応答推定値とを加算するH+ΔH加算器206、H+ΔH加算器206の加算結果の丸めを行う丸め処理部207によって構成される。
【0045】
次に、本実施の形態に係る適応フィルタの動作について説明する。
本適応フィルタは、ディジタル信号処理によって実現されるものであり、全ての信号が、一定のサンプリング時間によってサンプリングされたディジタルデータである。そこで、現在のサンプリング時刻をiとすると、まず、Xレジスタ201は、未知のシステム250に対して出力される参照信号の、過去Nサンプル分のデータX(i),X(i−1),・・・,X(i−N+1)を保持する。そして、Hレジスタ202には、未知のシステム250のインパルス応答推定値h0(i),h1(i),・・・,hN−1(i)が保持される。
【0046】
畳み込み積分器203は、上記の参照信号X(i),X(i−1),・・・,X(i−N+1)と、インパルス応答推定値h0(i),h1(i),・・・,hN−1(i)との畳み込み演算によって、擬似応答信号r(i)を算出する。従って、この擬似応答信号は、r(i)=x(i)×h0(i)+x(i−1)×h1(i)+・・・+x(i−N+1)×hN−1(i)となる。
【0047】
減算器204は、上記の擬似応答信号r(i)を、未知のシステム250から入力される応答信号s(i)より減算して、残差信号e(i)を求める。すなわち、e(i)=s(i)−r(i)となる。また、ΔH生成回路205は、未知のシステム250を推定して、上記の残差信号e(i)が小さくなるように、Hレジスタ202に格納されるインパルス応答推定値の修正量Δh0(i),Δh1(i),・・・,ΔhN−1(i)を算出する。
【0048】
ここで、一般的な修正アルゴリズムとしては、最小平均二乗(LMS(Least Mean Square))法と呼ばれるものがある。この方法によれば、上記の修正量Δhk(i)(k=0,1,・・・,N−1)は、Δhk(i)=α×e(i)×X(i−k)となる。
【0049】
上記のデータの内、Δhk(i)を除く各データが、nビットデータであったとすると、上記の修正量Δhk(i)は、nビットデータとはならず、nビット以上のビット数を持つデータとなる。演算の簡単化のため、αには、2のべき乗値が用いられることが多いが、仮に、これが1であるとすれば、Δhk(i)は、2nビットデータとなる。
【0050】
また、H+ΔH加算器206は、2nビットのデータを加算する加算器であり、上記のインパルス応答推定値h0(i),h1(i),・・・,hN−1(i)と、その修正量Δh0(i),Δh1(i),・・・,ΔhN−1(i)とを加算して、次のサンプル時刻i+1で使用される新たなインパルス応答推定値h0(i+1),h1(i+1),・・・,hN−1(i+1)を算出する。すなわち、hk(i+1)=hk(i)+Δhk(i)(k=0,1,・・・,N−1)である。
【0051】
以上のデータの内、Δhk(i)を除く各データが、nビットデータであったとすると、上記の修正量Δhk(i)は、nビットデータとはならず、nビット以上のビット数を持つデータとなる。上記と同様、演算の簡単化のため、αには、2のべき乗値が用いられることが多いが、仮に、これが1であれば、Δhk(i)は、2nビットデータとなる。
【0052】
従って、H+ΔH加算器206は、2つの2nビットのデータを加算し、その加算の際、nビットのデータであるインパルス応答推定値hk(i)に対しては、適当なシフトが施される。そして、その小数点の位置が、2nビットのデータであるΔhk(i)の小数点の位置と同じになるよう調整される。
【0053】
このようにして算出された、新たなインパルス応答推定値h0(i+1),h1(i+1),・・・,hN−1(i+1)は、2nビットのデータとなるため、丸め処理部207によって、nビットのデータに丸められた後、Hレジスタ202に格納される。なお、この丸め処理部207の動作は、例えば、図1に示す、上記実施の形態1に係る丸め処理回路の動作と同様である。
【0054】
図7は、上述した丸め処理方式を備える、本実施の形態に係る適応フィルタの特性を示す。すなわち、同図は、上記のような適応フィルタが、未知のシステムのインパルス応答を推定する過程をグラフ化したものである。
【0055】
図7のグラフにおいて、その縦軸は、未知のシステムのインパルス応答と適応フィルタのインパルス応答推定値の2乗誤差(未知のシステムのインパルス応答の2乗和で規格化してある)、横軸はサンプル数(適応フィルタの動作時間に相当する)である。また、曲線Aは、本実施の形態に係るデータ丸め方式を適用した場合のフィルタ特性であり、曲線Bは、切り捨てによるデータ丸めを適用した場合の特性、そして、曲線Cは、四捨五入によるデータ丸めを適用した場合の特性である。
【0056】
図7より明らかなように、曲線Bで示される特性は、サンプル数3000あたりから誤差が蓄積され始め、2乗誤差が増大している。また、曲線Cは、サンプル数30000あたりから誤差が蓄積され始め、徐々に2乗誤差が増大している。一方、曲線Aは、サンプル数5000から45000あたりまでは、曲線Bよりも2乗誤差がやや大きいものの、最後まで、2乗誤差の増大は見られず、最終的には、曲線Bよりも2乗誤差が小さくなっていることが分かる。よって、明らかに、この丸め方式によって、正および負の2進数値に対して、対称な丸め結果が与えられ、インパルス応答推定精度が良くなることが分かる。
【0057】
以上説明したように、本実施の形態によれば、適応フィルタにおいて、参照信号とインパルス応答推定値に畳み込み演算を施して得た擬似応答信号に基づいて、このインパルス応答推定値の修正量を算出し、上記インパルス応答推定値に、その修正量を加算して得た新たなインパルス応答推定値に対して、下位ビットを切り捨てるデータ丸め方法を適用することで、正および負の2進数値に対して対称な丸め結果が得られるとともに、当該適応フィルタの特性として、優れたインパルス応答推定特性を得ることができる。
【0058】
実施の形態5.
以下、本発明に係る実施の形態5について説明する。なお、上記の実施の形態4は、H+ΔH加算器の出力に対して丸めを行う適応フィルタの構成を示したが、ここでは、インパルス応答推定値の修正量に対して丸めを行う形態を示す。
【0059】
図8は、本実施の形態に係るデータ丸め方式を用いる適応フィルタの構成を示すブロック図である。なお、同図において、図6に示す、上記実施の形態4に係る適応フィルタと同一構成要素には、同一符号を付す。すなわち、図8のXレジスタ201には、参照信号の過去のサンプル値を格納し、Hレジスタ202には、インパルス応答推定値を格納する。畳み込み積分器203は、Xレジスタ201の格納値と、Hレジスタの格納値との畳み込み演算を行う。また、減算器204は、この畳み込み積分器203の出力を、未知のシステム250の応答信号より減算する。
【0060】
ΔH生成回路205は、未知のシステム250のインパルス応答を推定して、Hレジスタ202に格納されたインパルス応答推定値の修正量を算出する。丸め処理部207は、この修正量の丸めを行い、H+ΔH加算器206は、丸め後の修正量とHレジスタ202に格納されたインパルス応答推定値とを加算する。
【0061】
以下、本実施の形態に係る適応フィルタの動作を説明する。なお、図8のXレジスタ201、Hレジスタ202、畳み込み積分器203、減算器204、ΔH生成回路205は、図6に示す、実施の形態4に係る適応フィルタと同様の動作を行う。
【0062】
丸め処理部207は、ΔH生成回路205が出力する推定インパルス応答の修正量Δh0(i),Δh1(i),・・・,ΔhN−1(i)に対して、丸め処理を行う。この丸め処理部207の動作は、例えば、図1に示す、実施の形態1に係る丸め処理回路の動作と同じである。そこで、この丸め後のデータを、Δh0(i)’,Δh1(i)’,・・・,ΔhN−1(i)’とすると、これらは、Hレジスタ202に格納されるインパルス応答推定値h0(i),h1(i),・・・,hN−1(i)のビット数と同じビット数に丸められたデータである。
【0063】
上記のビット数をnとすると、H+ΔH加算器206は、nビットのデータを加算する加算器であり、上記のインパルス応答推定値h0(i),h1(i),・・・,hN−1(i)と、丸め後の修正量Δh0(i)’,Δh1(i)’,・・・,ΔhN−1(i)’とを加算して、次のサンプル時刻i+1で使用される新たなインパルス応答推定値h0(i+1),h1(i+1),・・・,hN−1(i+1)を算出する。すなわち、hk(i+1)=hk(i)+Δhk(i)’(k=0,1,・・・,N−1)であり、これが、新たにHレジスタ202に格納される。
【0064】
以上説明したように、本実施の形態によれば、適応フィルタにおいて、参照信号とインパルス応答推定値に畳み込み演算を施して得た擬似応答信号に基づいて、このインパルス応答推定値の修正量を算出し、この修正量に対して、下位ビットを切り捨てるデータ丸め方法を適用した後、上記インパルス応答推定値に、その丸め後の修正量を加算して新たなインパルス応答推定値を算出することで、正および負の2進数値に対して対称な丸め結果が得られるとともに、当該適応フィルタの特性として、優れたインパルス応答推定特性を得ることができる。
【0065】
【発明の効果】
以上説明したように、第1の発明によれば、データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め方法において、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持するステップと、n−mビットの0のデータを保持するステップと、上記丸め前データの上位mビットの上位ビット側に、上記n−mビットの0のデータを合成するステップと、上記丸め前データと、上記丸め前の上位mビットの上位ビット側にn−mビットの0のデータを合成したデータとを加算するステップと、上記加算後のデータの下位mビットを切り捨てて丸め結果を得るステップとを備えることで、正及び負の2進数値に対して対称な丸め結果が得られるとともに、丸め前のデータの正負を判断する必要がない、という効果がある。
第2の発明によれば、データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め装置において、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、n−mビットのデータを保持する手段と、上記丸め前データの上位mビットの上位ビット側に、上記n−mビットのデータを合成する手段と、上記丸め前データと、上記丸め前の上位mビットの上位ビット側にn−mビットのデータを合成したデータとを加算する手段とを備え、上記n−mビットのデータを保持する手段に全て0のデータを保持して、上記加算後のデータの下位mビットを切り捨てて丸め結果を得ることで、正及び負の2進数値に対して対称な丸め結果が得られるとともに、丸め前のデータの正負を判断する必要がない、という効果がある。
【0066】
第3の発明によれば、データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め装置において、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、上記丸め前データに対してn−mビットの右シフトを行う手段と、上記丸め前データと、上記丸め前のデータに対してn−mビット右シフトしたデータとを加算する手段とを備え、上記加算後のデータの下位mビットを切り捨てて丸め結果を得ることで、正及び負の2進数値に対して対称な丸め結果が得られるとともに、丸め前のデータの正負を判断する必要がない、という効果がある。
第4の発明によれば、データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め装置において、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、上記丸め前データに対してn−mビットの右シフトを行う手段と、上記丸め前データと、上記丸め前データに対してn−mビット右シフトしたデータとを加算する手段と、上記加算後のデータの下位mビットを切り捨てて丸め結果を得る手段とを備えたことで、正および負の2進数値に対して対称な丸め結果が得られ、同時に、適応フィルタの特性として、優れたインパルス応答推定特性を得ることができる。
【0067】
第5の発明によれば、未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、上記擬似応答信号と上記未知のシステムからの応答信号との差分をもとに、上記インパルス応答推定データの修正量を算出する手段と、上記修正量と上記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで使用するデータ丸め装置において、上記適用フィルタは、上記算出されたインパルス応答推定データの修正量と前回までの上記インパルス応答推定データとの加算値を丸めて新たなインパルス応答推定データとする構成とされており、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、n−mビットのデータを保持する手段と、上記丸め前データの上位mビットの上位ビット側に、上記n−mビットのデータを合成する手段と、上記丸め前データと、上記丸め前の上位mビットの上位ビット側にn−mビットのデータを合成したデータとを加算する手段とを備え、上記n−mビットのデータを保持する手段に全て0のデータを保持して、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得ることで、正および負の2進数値に対して対称な丸め結果が得られるとともに、当該適応フィルタの特性として、優れたインパルス応答推定特性を得ることができる。
第6の発明によれば、未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、上記擬似応答信号と上記未知のシステムからの応答信号との差分をもとに、上記インパルス応答推定データの修正量を算出する手段と、上記修正量と上記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで用いるデータ丸め装置において、上記適用フィルタは、上記算出されたインパルス応答推定データの修正量を丸める構成とされており、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、n−mビットのデータを保持する手段と、上記丸め前データの上位mビットの上位ビット側に、上記n−mビットのデータを合成する手段と、上記丸め前データと、上記丸め前の上位mビットの上位ビット側にn−mビットのデータを合成したデータとを加算する手段とを備え、上記n−mビットのデータを保持する手段に全て0のデータを保持して、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得ることで、正および負の2進数値に対して対称な丸め結果が得られるとともに、当該適応フィルタの特性として、優れたインパルス応答推定特性を得ることができる。
【0068】
の発明によれば、未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、上記擬似応答信号と上記未知のシステムからの応答信号との差分をもとに、上記インパルス応答推定データの修正量を算出する手段と、上記修正量と上記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで使用するデータ丸め装置において、上記適用フィルタは、上記算出されたインパルス応答推定データの修正量と前回までの上記インパルス応答推定データとの加算値を丸めて新たなインパルス応答推定データとする構成とされており、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、上記丸め前データに対してn−mビットの右シフトを行う手段と、上記丸め前データと、上記丸め前のデータに対してn−mビット右シフトしたデータとを加算する手段とを備え、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得ることで、正および負の2進数値に対して対称な丸め結果が得られるとともに、当該適応フィルタの特性として、優れたインパルス応答推定特性を得ることができる。
第8の発明によれば、未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、上記擬似応答信号と上記未知のシステムからの応答信号との差分をもとに、上記インパルス応答推定データの修正量を算出する手段と、上記修正量と上記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで用いるデータ丸め装置において、上記適用フィルタは、上記算出されたインパルス応答推定データの修正量を丸める構成とされており、n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、上記丸め前データに対してn−mビットの右シフトを行う手段と、上記丸め前データと、上記丸め前データに対してn−mビット右シフトしたデータとをnビットに揃えて加算する手段とを備え、上記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得ることで、正および負の2進数値に対して対称な丸め結果が得られるとともに、当該適応フィルタの特性として、優れたインパルス応答推定特性を得ることができる。
【図面の簡単な説明】
【図1】 本発明の実施の形態1に係る丸め処理回路の構成を示すブロック図である。
【図2】 実施の形態1に係る丸め処理を説明するための図である。
【図3】 本発明の実施の形態2に係る丸め処理回路の構成を示すブロック図である。
【図4】 本発明の実施の形態3に係るソフトウェアを実行するディジタル信号処理プロセッサの概略構成を示すブロック図である。
【図5】 実施の形態3に係るデータ丸め方式の実行手順を示すフローチャートである。
【図6】 本発明の実施の形態4に係るデータ丸め方式を用いる適応フィルタの構成を示すブロック図である。
【図7】 実施の形態4に係る適応フィルタの特性を示す図である。
【図8】 本発明の実施の形態5に係るデータ丸め方式を用いる適応フィルタの構成を示すブロック図である。
【図9】 単純な切り捨てによる丸めを行った場合の丸め結果を示す図である。
【図10】 従来の丸め方式のの流れを示すフローチャートである。
【図11】 四捨五入による丸めを行った場合の丸め結果を示す図である。
【図12】 四捨五入による丸めを行った場合の、他の丸め結果を示す図である。
【符号の説明】
101,102,104…レジスタ、103…nビット加算器、105…n−mビットシフト演算器、201…Xレジスタ、202…Hレジスタ、203…畳み込み積分器、204…減算器、205…ΔH生成回路、206…H+ΔH加算器、207…丸め処理部、250…未知のシステム、400…ディジタル信号処理プロセッサ(DSP)、401…CPU、402…ROM、403…メモリ、404…出力部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a data rounding method and a data rounding device for rounding digitized numerical values.
[0002]
[Prior art]
When a digital computer or the like performs multiplication of two binary value data, the number of bits necessary to express the binary value data obtained as a result of the multiplication is larger than the number of bits of the original data. For example, when multiplication is performed in an n-bit computer, normally, two binary numerical data before multiplication are n bits, but the multiplication result is 2n-bit data.
[0003]
However, when storing the multiplication result, it is often necessary to round the number of bits to n bits. In such a case, the simplest rounding method is a method of truncating the lower n bits. However, this method does not provide a rounding result that is symmetric with respect to positive and negative numbers.
[0004]
FIG. 9 is an example showing a rounding result when rounding is performed by simple truncation. Specifically, FIG. 9 schematically shows a case where an 8-bit binary value is rounded to obtain a 4-bit binary value. In the figure, it is assumed that the decimal point position of 8-bit data before rounding is between the lower 4th bit and the 5th bit, and the data is expressed in 2's complement format.
[0005]
As can be seen from (a) of FIG. 9, when the data before rounding is a positive numerical value 3.75, the data after rounding is 3.0, and from (b) of FIG. When the data is a negative numerical value −3.75, it can be seen that the rounded data is −4.0. In other words, a rounding result that is symmetric with respect to positive and negative numbers cannot be obtained. When such a rounding method is used for a series of product-sum operations often seen in signal processing or the like, there is an inconvenience that rounding errors are accumulated in a negative direction, resulting in a significant deterioration in calculation accuracy.
[0006]
In order to avoid this problem, there is a data rounding method as shown in FIG. FIG. 10 is a flowchart showing the flow of the “numerical value rounding method” disclosed in Japanese Patent Application Laid-Open No. 64-58020, and describes the rounding method when obtaining the rounding result B of the lower k bits of certain data A. Is.
[0007]
In step S1 of FIG. 10, 2 is added to the data A before rounding.k-1(The addition result is A ′), and in step S2, the lower-order k bits of the data A ′ after the addition are rounded down. This is a rounding off. Rounding is performed by adding data in which only the most significant bit in the bits to be rounded down is 1 and all other bits are 0 before rounding down, and then rounding down. (A) in FIG. , (B) is an example showing a rounding result when rounding by this rounding is performed.
[0008]
As shown in (a) of FIG. 11, when the data before rounding is a positive numerical value 3.75, after rounding is 4.0, and as shown in (b), the data before rounding is a negative numerical value. When it is −3.75, it is −4.0 after rounding. In other words, the method shown in FIG. 11 provides a rounding result that is symmetric with respect to positive and negative numerical values.
[0009]
However, as shown in FIG. 12, in the data before rounding, when only the most significant bit in the bits to be discarded is 1 and the others are 0, the above method has a problem. Referring to FIG. 11, when the data before rounding is a positive numerical value 3.5, it is 4.0 after rounding, and when the data before rounding is a negative numerical value −3.5, it is −3. 0, and no symmetric rounding result is obtained for positive and negative numerical values.
[0010]
On the other hand, as a method of always giving symmetrical rounding results to positive and negative binary values, for example, there is a “rounding device” shown in Japanese Patent Laid-Open No. 48-27648. In the rounding process shown in this publication, when the data before rounding is positive, the data with only the most significant bit being 1 and the other bits being 0 is added before the truncation is performed. Later, truncation is performed. Also, in this process, if the data before rounding is negative, the most significant bit in the bits to be rounded off and the data with more bits being 0 and the other bits being 1 are added before truncation. After that, truncation is carried out. According to such rounding processing, in any case, it is possible to give a symmetric rounding result to positive and negative binary values.
[0011]
[Problems to be solved by the invention]
However, in the above conventional rounding method, a symmetric rounding result cannot be obtained for positive and negative numerical values, or the processing differs depending on whether the data before rounding is positive or negative. Judgment is necessary. If this determination is made to obtain a symmetric rounding result, there is a problem that the processing becomes very complicated.
[0012]
In addition, even when the conventional rounding method is used for an adaptive filter, for example, a symmetrical rounding result cannot be obtained with respect to positive and negative binary values, so that the estimation accuracy of the impulse response is not improved. There's a problem.
[0013]
The present invention has been made in view of the above-described problems. The object of the present invention is to provide a symmetric rounding result for positive and negative binary values and to determine whether the data before rounding is positive or negative. It is to provide a data rounding method and a data rounding device which are not necessary.
[0014]
[Means for Solving the Problems]
  In order to achieve the above object, according to a first aspect of the present invention, there is provided a data rounding method for obtaining a rounding result having a predetermined number of bits by rounding a lower bit of data, wherein nm bits of upper bit data, m bits A step of holding n-bit unrounded data consisting of (n, m are integers, n> m), a step of holding n-m bits of 0 data, and the above-mentioned before rounding Upper m bits of dataUpper bit side ofSynthesize the n−m bits of 0 data, the data before rounding, and the upper m bits before roundingUpper bit side ofData rounding performed by a computer system comprising: adding a sum of n−m bits of 0 data to data; and truncating the lower m bits of the n-bit data after the addition to obtain a rounding result. Provide a method.
  According to a second aspect of the present invention, there is provided a data rounding device for obtaining a rounding result of a predetermined number of bits by rounding the lower bits of data, wherein nm bits of upper bit data, m bits of lower bit data, (n, m is an integer, and n> m), means for holding n-bit unrounded data, means for holding nm bits of data, and the upper m bits of the data before roundingUpper bit side ofMeans for synthesizing the nm bits of data, the data before rounding, and the upper m bits before roundingUpper bit side ofAnd means for adding data obtained by synthesizing nm-bit data, the means for holding nm-bit data holds all 0 data, and the lower order of the n-bit data after the addition. A data rounding device for rounding off m bits to obtain a rounding result is provided.
[0015]
  According to a third aspect of the present invention, there is provided a data rounding method for obtaining a rounding result of a predetermined number of bits by performing rounding processing on lower bits of data, wherein n−m bits of upper bit data, m bits of lower bit data, (n, m is an integer, and n> m), holding n-bit pre-round data, performing a right shift of nm bits on the pre-round data, the pre-round data, This is executed by a computer system comprising: adding data shifted right by nm bits to the unrounded data; and truncating lower m bits of the n-bit data after the addition to obtain a rounded result. Data rounding method.
  According to a fourth aspect of the present invention, there is provided a data rounding device for obtaining a rounding result of a predetermined number of bits by rounding the lower bits of data, wherein nm bits of upper bit data, m bits of lower bit data, (n, m is an integer, and n> m) means for holding n-bit unrounded data, means for performing a right shift of nm bits with respect to the unrounded data, the unrounded data, And a means for adding data shifted right by nm bits to the data before rounding, and a data rounding device for obtaining a rounding result by truncating the lower m bits of the n-bit data after the addition.
[0016]
  According to a fifth aspect of the present invention, there is provided means for performing a convolution operation on impulse response estimation data of an unknown system and a predetermined reference signal to generate a pseudo response signal, and the pseudo response signal and the response signal from the unknown system. An adaptation comprising: means for calculating a correction amount of the impulse response estimation data based on the difference; and means for calculating new n-bit impulse response estimation data by adding the correction amount and the impulse response estimation data In the data rounding device used in the filter, the application filter rounds the addition value of the calculated correction amount of the impulse response estimation data and the impulse response estimation data up to the previous time to obtain new impulse response estimation data N−m bits of upper bit data, m bits of lower bit data (n and m are integers, n Consists a m), and means for holding the previous data rounding n bits, means for holding the n-m bit data, the upper m bits of the rounding data beforeUpper bit side ofMeans for synthesizing the nm bits of data, the data before rounding, and the upper m bits before roundingUpper bit side ofAnd means for adding data obtained by synthesizing nm-bit data, the means for holding nm-bit data holds all 0 data, and the lower order of the n-bit data after the addition. A data rounding device for rounding off m bits to obtain a rounding result is provided.
  According to a sixth aspect of the present invention, there is provided: means for generating a pseudo response signal by performing a convolution operation on impulse response estimation data of an unknown system and a predetermined reference signal; and the pseudo response signal and the response signal from the unknown system. An adaptation comprising: means for calculating a correction amount of the impulse response estimation data based on the difference; and means for calculating new n-bit impulse response estimation data by adding the correction amount and the impulse response estimation data In the data rounding device used in the filter, the applied filter is configured to round the correction amount of the calculated impulse response estimation data, and includes n−m bits of upper bit data and m bits of lower bit data ( n and m are integers, and n> m) means for holding n-bit unrounded data, and holding nm bits of data And stage, upper m bits of the rounding data beforeUpper bit side ofMeans for synthesizing the nm bits of data, the data before rounding, and the upper m bits before roundingUpper bit side ofAnd means for adding data obtained by synthesizing nm-bit data, the means for holding nm-bit data holds all 0 data, and the lower order of the n-bit data after the addition. A data rounding device for rounding off m bits to obtain a rounding result is provided.
[0017]
  7thAccording to the present invention, means for generating a pseudo response signal by performing a convolution operation on the impulse response estimation data of an unknown system and a predetermined reference signal, and a difference between the pseudo response signal and the response signal from the unknown system are calculated. An adaptive filter comprising: means for calculating a correction amount of the impulse response estimation data; and means for calculating new n-bit impulse response estimation data by adding the correction amount and the impulse response estimation data. Data rounding to useapparatusInThe applied filter is configured to round the addition value of the calculated amount of correction of the impulse response estimation data and the impulse response estimation data up to the previous time to obtain new impulse response estimation data, and nm bits Means for holding n-bit unrounded data, and n−m with respect to the unrounded data, n−m is an integer and n> m. means for performing a right shift of m bits, and means for adding the data before rounding and the data shifted to the right by nm bits with respect to the data before rounding, the lower order of the n bit data after the addition A data rounding device for rounding off m bits to obtain a rounding result is provided.
  According to an eighth aspect of the invention, there is provided: means for generating a pseudo response signal by performing a convolution operation on impulse response estimation data of an unknown system and a predetermined reference signal; and the pseudo response signal and the response signal from the unknown system. An adaptation comprising: means for calculating a correction amount of the impulse response estimation data based on the difference; and means for calculating new n-bit impulse response estimation data by adding the correction amount and the impulse response estimation data In the data rounding device used in the filter, the applied filter is configured to round the correction amount of the calculated impulse response estimation data, and includes n−m bits of upper bit data and m bits of lower bit data ( n and m are integers, and n> m) means for holding n-bit unrounded data, and n−m for the unrounded data And a means for adding the data before the rounding and the data shifted to the right by nm bits with respect to the data before the rounding, and the lower m of the n-bit data after the addition A data rounding device for rounding bits to obtain a rounding result is provided.
[0018]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings.
Embodiment 1 FIG.
FIG. 1 is a block diagram showing a configuration of a rounding circuit for realizing a data rounding method according to Embodiment 1 of the present invention. Note that the rounding processing circuit according to the present embodiment performs processing for rounding n-bit data to nm bits.
[0019]
The rounding processing circuit shown in FIG. 1 includes a register 101 that holds data before rounding, a register 102 that stores “0”, an n-bit adder 103, and a register 104 that holds a rounding result.
[0020]
Hereinafter, the operation of the rounding processing circuit according to the present embodiment will be described.
The register 101 holds n-bit data before rounding. The register 102 is an nm bit register, and “0” is stored in all the bits here. The n-bit adder 103 adds two n-bit data. One of them is data before rounding held in the register 101. The other n-bit data is data obtained by synthesizing these n−m bits and m bits, with the output of the register 102 being its upper nm bits and the upper m bits of the register 101 being its lower m bits. is there. Then, the addition result output from the n-bit adder 103 is held in the register 104, and the higher-order nm bits become the rounding result.
[0021]
FIG. 2 is a diagram for explaining rounding processing in the present embodiment. This figure shows the input data and output of the n-bit adder 103 of the rounding circuit of FIG. In FIG. 2, the first input data of the n-bit adder 103 in FIG. 1 is A, the other input data is B, and the output data after addition is C.
[0022]
That is, as shown in (a) of FIG. 2, A is n-bit data before rounding, and as shown in (b) of FIG. The lower m bits are data having the same configuration as the upper m bits of A. The addition result of A and B is C ((c) in the figure), and the upper nm bits of C are the rounding result.
[0023]
Therefore, hereinafter, it will be described that the data rounding method as described above gives a symmetric rounding result to positive and negative data.
[0024]
Consider a certain positive n-bit data X. For simplicity, it is assumed that n and m have a relationship of n = 2m. When the lower m bits of the data X are represented by XL and the upper m bits are represented by XH,
X = 2m・ XH + XL (1)
It becomes. If the output of the n-bit adder 103 in FIG.
Y = 2m・ XH + XL + XH (2)
It becomes.
[0025]
Therefore, when this rounding output is Yr, Yr is XL + XH ≧ 2mWhen the
Yr = 2m・ XH + 2m= 2m・ (XH + 1) (3)
XL + XH <2mIn case of, no carryover occurs,
Yr = 2m・ XH (4)
It becomes.
[0026]
On the other hand, when the data “−X” in which the sign of X is inverted is represented using XH and XL as described above,
-X = -2m・ XH-XL (5)
It becomes. The output Z of the n-bit adder 103 in FIG. 1 with respect to −X is when XL ≠ 0.
Z = -2m・ XH-XL + (2m-1-XH)
= -2m・ XH + (2m-XL-XH-1) (6)
It becomes.
[0027]
Therefore, when this rounding output is Zr, Zr is expressed as XL + XH ≧ 2m2mSince -XL-XH-1 <0, a carry-down occurs,
Zr = -2m・ XH-2m= -2m・ (XH + 1) (7)
It becomes. Also, XL + XH <2m2mSince -XL-XH-1 ≧ 0, no carry-down occurs,
Zr = -2m・ XH (8)
It becomes.
[0028]
Thus, according to the above rounding method, it can be seen that a symmetrical rounding result is given to positive and negative data when XL ≠ 0. When XL = 0, the output Y of the n-bit adder 103 for X is Y = 2.m・ XH + XH, 0 <XH <2m-1Therefore, no carry occurs and the rounding output Yr is always Yr = 2.m・ It becomes XH.
[0029]
On the other hand, the output Z of the n-bit adder 103 for the data -X is Z = -2.m・ XH + (2m-XH). 0 <XH <2m-1So 2m-1<2m-XH <2mThis also causes no ups and downs, and the rounding output Zr is always Zr = −2.m・ It becomes XH.
[0030]
As described above, according to the present embodiment, an nm bit register storing 0 and an adder for adding two n bit data are provided, and the upper m bits of the data before rounding are obtained. By adding n-bit data, which is the lower m bits, and n-bit data before rounding, and by rounding down the lower m bits of the data after the addition, rounding results are obtained, and positive and negative binary values are obtained. On the other hand, a symmetric rounding result is given, and a data rounding method that does not determine whether data is positive or negative can be obtained.
[0031]
Embodiment 2. FIG.
Embodiment 2 according to the present invention will be described below. Note that the processing circuit according to the first embodiment is configured to generate addition data using an nm bit register in which 0 is stored. Here, the addition is performed using a shift arithmetic unit. Generate data.
[0032]
FIG. 3 is a block diagram showing a configuration of a rounding processing circuit for realizing the data rounding method according to the second embodiment of the present invention. In the rounding circuit according to the present embodiment shown in FIG. 3, the same components as those in the rounding circuit according to the first embodiment shown in FIG. Description is omitted.
[0033]
That is, the register 101, the n-bit adder 103, and the register 104 in FIG. 3 operate in the same manner as the corresponding components of the rounding processing circuit shown in FIG. 3 receives the n-bit data before rounding held in the register 101, performs an n-m bit right logical shift operation, and outputs the operation result as n Output to the bit adder 103.
[0034]
Since the shift operation performed by the shift calculator 105 is a logical shift, the upper nm bits that are vacated by the right shift are “padded with zeros”. Therefore, the n-bit data obtained by this shift operation is the same data as the data B shown in FIG. 2B according to the first embodiment.
[0035]
Therefore, the n-bit adder 103 in FIG. 3 adds two n-bit data, the n-bit data before rounding, held in the register 101, and the n-bit data obtained by the shift operation. As in the first embodiment, the addition result output from the n-bit adder 103 is held in the register 104, and the higher order nm bits are the rounding result.
[0036]
As described above, according to the present embodiment, an n−m-bit shift arithmetic unit and an adder that adds two n-bit data are provided, and n obtained by shifting the data before rounding. After adding bit data and n-bit data before rounding, rounding off the lower m bits of the data after the rounding results in a round result, which is symmetric with respect to positive and negative binary values. Thus, a rounding method can be obtained, which can provide a rounding result and does not need to determine whether the data is positive or negative.
[0037]
Embodiment 3 FIG.
Embodiment 3 according to the present invention will be described below. In each of the above embodiments, data rounding is realized using specific hardware such as an adder or a register. Here, a data rounding method executed by software will be described.
[0038]
FIG. 4 is a block diagram showing a schematic configuration of, for example, a digital signal processor that executes software according to the present embodiment. In the digital signal processor (DSP) 400 shown in the figure, the memory 403 temporarily stores data and calculation results to be processed, and the ROM 402 stores the processing procedure according to the present embodiment. Is stored as a program. The CPU 401 is a central control unit that performs data rounding processing described below according to the above-described program and controls the entire processor. Note that the calculation result here is output from the output unit 404 to an external device (not shown).
[0039]
FIG. 5 is a flowchart showing an execution procedure of the data rounding method according to the present embodiment. In the process shown in the figure, first, data B obtained by right-shifting n-bit data A before rounding by n−m bits is calculated (step ST1). Next, the data A before rounding and the data B obtained by this right logical shift are added (step ST2). Then, in the final step ST3, a process of truncating the lower m bits of the addition result is performed.
[0040]
The rounding process realized by such a procedure eliminates the need to judge whether the data is positive or negative when rounding is performed in a digital signal processor or the like. A rounding process that gives a symmetric result can be realized.
[0041]
Since most of digital signal processors are 16-bit fixed point systems, the most significant bit is often treated as a sign bit and the lower 15 bits as an amplitude bit in many cases. In this case, in the multiplication result of two 16-bit data, the most significant bit is a sign bit and the lower 31 bits are amplitude bits, and the lower 16 bits of the total 32-bit data are rounded. This means that the bit length of the data after rounding becomes ½ of the bit length of the data before rounding. By doing in this way, each step mentioned above becomes a process in a unit of 16 bits, and generally each step can be realized more simply.
[0042]
As described above, according to the present embodiment, the right shift of the data before rounding, the addition of the data obtained by this right shift and the data before rounding, and the lower m bits of the data after the addition Since the truncation is performed purely by software, it is not necessary to determine whether the data is positive or negative, so that a symmetric rounding result can be obtained for positive and negative binary data with a small number of steps. In particular, when this program is executed on a digital signal processor, each processing step can be realized more simply.
[0043]
Embodiment 4 FIG.
Embodiment 4 according to the present invention will be described below. The data rounding method according to the present embodiment is used in an adaptive filter that estimates an unknown system.
[0044]
FIG. 6 is a block diagram showing a configuration of an adaptive filter using the data rounding method according to the present embodiment. The adaptive filter shown in the figure includes an X register 201 that stores past sample values of a reference signal, an H register 202 that stores an impulse response estimated value, and a convolution of the stored value of the X register 201 and the stored value of the H register 202. The convolution integrator 203 that performs the operation, the subtractor 204 that subtracts the output of the convolution integrator 203 from the response signal of the unknown system 250, the impulse response of the unknown system 250 is estimated, and the impulse response stored in the H register 202 A ΔH generation circuit 205 that calculates a correction amount of the estimated value, a H + ΔH adder 206 that adds the correction amount and the impulse response estimated value stored in the H register 202, and a rounding process that rounds the addition result of the H + ΔH adder 206 The unit 207 is configured.
[0045]
Next, the operation of the adaptive filter according to this embodiment will be described.
The adaptive filter is realized by digital signal processing, and is digital data in which all signals are sampled at a constant sampling time. Therefore, assuming that the current sampling time is i, first, the X register 201 first stores data X (i), X (i−1), X (i) for the past N samples of the reference signal output to the unknown system 250. ..., X (i-N + 1) is held. The H register 202 holds the impulse response estimation values h0 (i), h1 (i),..., HN-1 (i) of the unknown system 250.
[0046]
The convolution integrator 203 includes the reference signals X (i), X (i−1),..., X (i−N + 1) and impulse response estimated values h0 (i), h1 (i),. The pseudo response signal r (i) is calculated by a convolution operation with hN-1 (i). Therefore, this pseudo response signal is expressed as r (i) = x (i) × h0 (i) + x (i−1) × h1 (i) +... + X (i−N + 1) × hN−1 (i) It becomes.
[0047]
The subtracter 204 subtracts the pseudo response signal r (i) from the response signal s (i) input from the unknown system 250 to obtain a residual signal e (i). That is, e (i) = s (i) −r (i). Further, the ΔH generation circuit 205 estimates the unknown system 250, and the correction amount Δh0 (i) of the impulse response estimated value stored in the H register 202 so that the residual signal e (i) becomes small. , Δh1 (i),..., ΔhN−1 (i) are calculated.
[0048]
Here, as a general correction algorithm, there is an algorithm called a least mean square (LMS) method. According to this method, the correction amount Δhk (i) (k = 0, 1,..., N−1) is expressed as Δhk (i) = α × e (i) × X (ik). Become.
[0049]
If each of the above data except for Δhk (i) is n-bit data, the correction amount Δhk (i) is not n-bit data and has a bit number of n bits or more. It becomes data. In order to simplify the calculation, a power value of 2 is often used for α. However, if it is 1, Δhk (i) is 2n-bit data.
[0050]
The H + ΔH adder 206 is an adder for adding 2n-bit data, and the impulse response estimated values h0 (i), h1 (i),..., HN−1 (i) and their corrections. The amounts Δh0 (i), Δh1 (i),..., ΔhN-1 (i) are added to obtain new impulse response estimated values h0 (i + 1), h1 (i + 1) used at the next sample time i + 1. ,..., HN-1 (i + 1) is calculated. That is, hk (i + 1) = hk (i) + Δhk (i) (k = 0, 1,..., N−1).
[0051]
Of the above data, if each data except Δhk (i) is n-bit data, the correction amount Δhk (i) is not n-bit data and has a bit number of n bits or more. It becomes data. Similarly to the above, for simplicity of calculation, a power of 2 is often used for α. However, if it is 1, Δhk (i) is 2n-bit data.
[0052]
Accordingly, the H + ΔH adder 206 adds two 2n-bit data, and an appropriate shift is applied to the impulse response estimated value hk (i), which is n-bit data, at the time of the addition. Then, the position of the decimal point is adjusted to be the same as the position of the decimal point of Δhk (i) which is 2n-bit data.
[0053]
Since the new impulse response estimated values h0 (i + 1), h1 (i + 1),..., HN−1 (i + 1) calculated in this way become 2n-bit data, the rounding processing unit 207 After being rounded to n-bit data, it is stored in the H register 202. The operation of the rounding processing unit 207 is the same as the operation of the rounding processing circuit according to the first embodiment shown in FIG.
[0054]
FIG. 7 shows the characteristics of the adaptive filter according to the present embodiment having the rounding processing method described above. That is, this figure is a graph showing the process in which the adaptive filter as described above estimates the impulse response of an unknown system.
[0055]
In the graph of FIG. 7, the vertical axis is the square error of the impulse response of the unknown system and the impulse response estimate of the adaptive filter (normalized by the sum of squares of the impulse response of the unknown system), and the horizontal axis is This is the number of samples (corresponding to the operating time of the adaptive filter). Curve A is a filter characteristic when the data rounding method according to the present embodiment is applied, curve B is a characteristic when data rounding by truncation is applied, and curve C is data rounding by rounding. It is a characteristic when applying.
[0056]
As is clear from FIG. 7, in the characteristic indicated by the curve B, errors start to accumulate from around 3000 samples, and the square error increases. In the curve C, errors start to accumulate from around 30000 samples, and the square error gradually increases. On the other hand, the curve A has a square error slightly larger than that of the curve B from around 5000 to 45000 samples, but does not increase the square error until the end. It can be seen that the multiplication error is reduced. Thus, it can be seen that this rounding scheme gives a symmetric rounding result for positive and negative binary values and improves the impulse response estimation accuracy.
[0057]
As described above, according to the present embodiment, in the adaptive filter, the correction amount of the impulse response estimated value is calculated based on the pseudo response signal obtained by performing the convolution operation on the reference signal and the impulse response estimated value. By applying a data rounding method that rounds down the lower bits to a new impulse response estimation value obtained by adding the correction amount to the above impulse response estimation value, positive and negative binary values are obtained. Symmetrical rounding results can be obtained, and excellent impulse response estimation characteristics can be obtained as characteristics of the adaptive filter.
[0058]
Embodiment 5 FIG.
Embodiment 5 according to the present invention will be described below. In the fourth embodiment, the configuration of the adaptive filter that performs rounding on the output of the H + ΔH adder has been described. Here, a mode in which rounding is performed on the correction amount of the impulse response estimated value is shown.
[0059]
FIG. 8 is a block diagram showing a configuration of an adaptive filter using the data rounding method according to the present embodiment. In the figure, the same components as those of the adaptive filter according to Embodiment 4 shown in FIG. That is, a past sample value of the reference signal is stored in the X register 201 of FIG. 8, and an impulse response estimated value is stored in the H register 202. The convolution integrator 203 performs a convolution operation between the stored value of the X register 201 and the stored value of the H register. The subtractor 204 subtracts the output of the convolution integrator 203 from the response signal of the unknown system 250.
[0060]
The ΔH generation circuit 205 estimates the impulse response of the unknown system 250 and calculates the correction amount of the impulse response estimation value stored in the H register 202. The rounding processing unit 207 rounds the correction amount, and the H + ΔH adder 206 adds the correction amount after rounding and the impulse response estimated value stored in the H register 202.
[0061]
Hereinafter, the operation of the adaptive filter according to the present embodiment will be described. Note that the X register 201, H register 202, convolution integrator 203, subtractor 204, and ΔH generation circuit 205 in FIG. 8 perform the same operation as the adaptive filter according to the fourth embodiment shown in FIG.
[0062]
The rounding processing unit 207 performs rounding on the estimated impulse response correction amounts Δh0 (i), Δh1 (i),..., ΔhN−1 (i) output from the ΔH generation circuit 205. The operation of the rounding processing unit 207 is the same as the operation of the rounding processing circuit according to the first embodiment shown in FIG. Therefore, if the rounded data are Δh0 (i) ′, Δh1 (i) ′,..., ΔhN−1 (i) ′, these are estimated impulse response values h0 stored in the H register 202. (I), h1 (i),..., HN-1 (i) are rounded to the same number of bits.
[0063]
When the number of bits is n, the H + ΔH adder 206 is an adder for adding n bits of data, and the impulse response estimated values h0 (i), h1 (i),..., HN−1. (I) and the corrected amounts Δh0 (i) ′, Δh1 (i) ′,..., ΔhN−1 (i) ′ after rounding are added to obtain a new value used at the next sample time i + 1. Impulse response estimated values h0 (i + 1), h1 (i + 1),..., HN−1 (i + 1) are calculated. That is, hk (i + 1) = hk (i) + Δhk (i) ′ (k = 0, 1,..., N−1), and this is newly stored in the H register 202.
[0064]
As described above, according to the present embodiment, in the adaptive filter, the correction amount of the impulse response estimated value is calculated based on the pseudo response signal obtained by performing the convolution operation on the reference signal and the impulse response estimated value. Then, after applying a data rounding method that rounds down the lower bits to this correction amount, by adding the rounded correction amount to the impulse response estimation value, a new impulse response estimation value is calculated, A rounding result symmetric with respect to positive and negative binary values can be obtained, and an excellent impulse response estimation characteristic can be obtained as the characteristic of the adaptive filter.
[0065]
【The invention's effect】
  As described above, according to the first invention, in a data rounding method for obtaining a rounding result having a predetermined number of bits by rounding the lower bits of data, the upper bit data of n−m bits and m bits A step of holding n-bit unrounded data consisting of (n, m are integers, n> m), a step of holding n-m bits of 0 data, and the above-mentioned before rounding Upper m bits of dataUpper bit side ofSynthesize the n−m bits of 0 data, the data before rounding, and the upper m bits before roundingUpper bit side ofAnd a step of adding data obtained by synthesizing n−m bits of 0 data and a step of rounding down the lower m bits of the data after addition to obtain a rounding result, thereby obtaining a positive and negative binary value. As a result, a symmetric rounding result is obtained, and it is not necessary to determine whether the data before rounding is positive or negative.
  According to the second aspect of the present invention, in a data rounding device that obtains a rounding result of a predetermined number of bits by rounding the lower bits of the data, the upper bit data of n−m bits, the lower bit data of m bits, n and m are integers, and n> m) means for holding n-bit unrounded data, means for holding nm bits of data, and the upper m bits of the unrounded dataUpper bit side ofMeans for synthesizing the nm bits of data, the data before rounding, and the upper m bits before roundingUpper bit side ofAnd a means for adding the data obtained by combining the mn bits of data, the means for holding the mn bits of data holds all 0 data, and the lower m bits of the data after the addition By rounding off and obtaining a rounding result, a rounding result that is symmetric with respect to positive and negative binary values can be obtained, and there is no need to determine whether the data before rounding is positive or negative.
[0066]
  According to the third aspect of the present invention, in a data rounding device that obtains a rounding result of a predetermined number of bits by rounding the lower bits of the data, the upper bit data of n−m bits, the lower bit data of m bits, n and m are integers, and n> m) means for holding n-bit unrounded data, means for performing a right shift of nm bits on the unrounded data, and the unrounded data And means for adding data shifted right by nm bits with respect to the data before rounding, and by rounding down the lower m bits of the data after addition to obtain a rounding result, positive and negative A rounding result that is symmetric with respect to a binary value is obtained, and it is not necessary to determine whether the data before rounding is positive or negative.
  According to a fourth aspect of the present invention, in a data rounding device that obtains a rounding result of a predetermined number of bits by rounding the lower bits of the data, the n-m bit upper bit data, the m bit lower bit data ( n and m are integers, and n> m) means for holding n-bit unrounded data, means for performing a right shift of nm bits on the unrounded data, and the unrounded data And means for adding data shifted right by nm bits to the data before rounding, and means for rounding down the lower m bits of the data after addition to obtain a rounding result. A rounding result symmetric with respect to a negative binary value is obtained, and at the same time, an excellent impulse response estimation characteristic can be obtained as the characteristic of the adaptive filter.
[0067]
  According to the fifth invention, means for generating a pseudo response signal by performing a convolution operation on the impulse response estimation data of the unknown system and the predetermined reference signal, the pseudo response signal and the response signal from the unknown system And means for calculating a correction amount of the impulse response estimation data, and means for calculating new n-bit impulse response estimation data by adding the correction amount and the impulse response estimation data. In the data rounding device used in the adaptive filter provided, the applied filter rounds the sum of the calculated correction amount of the impulse response estimation data and the impulse response estimation data up to the previous time, and obtains new impulse response estimation data. Mn bits of upper bit data, m bits of lower bit data (n and m are integers) , N> m) consisting a, means for holding the previous data rounding n bits, means for holding the n-m bit data, the upper m bits of the rounding data beforeUpper bit side ofMeans for synthesizing the nm bits of data, the data before rounding, and the upper m bits before roundingUpper bit side ofAnd means for adding data obtained by synthesizing mn bits of data, and the means for holding nm bits of data holds all 0 data, and the lower order of the n bits of data after the addition. By rounding off m bits to obtain a rounding result, a rounding result symmetric with respect to positive and negative binary values can be obtained, and an excellent impulse response estimation characteristic can be obtained as a characteristic of the adaptive filter.
  According to the sixth aspect of the invention, means for generating a pseudo response signal by performing a convolution operation on the impulse response estimation data of the unknown system and the predetermined reference signal, the pseudo response signal and the response signal from the unknown system And means for calculating a correction amount of the impulse response estimation data, and means for calculating new n-bit impulse response estimation data by adding the correction amount and the impulse response estimation data. In the data rounding device used in the adaptive filter provided, the applied filter is configured to round the correction amount of the calculated impulse response estimation data, and includes mn bits of upper bit data and m bits of lower bit data. And (n and m are integers, n> m), means for holding n-bit unrounded data, and holding nm bits of data. Means for, upper m bits of the rounding data beforeUpper bit side ofMeans for synthesizing the nm bits of data, the data before rounding, and the upper m bits before roundingUpper bit side ofAnd means for adding data obtained by synthesizing nm-bit data, the means for holding nm-bit data holds all 0 data, and the lower order of the n-bit data after the addition. By rounding off m bits to obtain a rounding result, a rounding result symmetric with respect to positive and negative binary values can be obtained, and an excellent impulse response estimation characteristic can be obtained as a characteristic of the adaptive filter.
[0068]
  First7According to the invention of unknown systemThe impulse response based on the difference between the pseudo response signal and the response signal from the unknown system, and means for generating a pseudo response signal by performing a convolution operation on the impulse response estimation data and the predetermined reference signal In a data rounding apparatus used in an adaptive filter, comprising: means for calculating a correction amount of estimated data; and means for calculating new n-bit impulse response estimation data by adding the correction amount and the impulse response estimation data. The applied filter is configured to round the addition value of the calculated amount of correction of the impulse response estimation data and the impulse response estimation data up to the previous time to obtain new impulse response estimation data, and nm bits Of n bits, n bits and m bits, and (n and m are integers, n> m). Means for holding the previous data, means for right shifting nm bits with respect to the data before rounding, data before rounding, and data shifted right with respect to the data before rounding by nm bits And by rounding down the lower m bits of the n-bit data after the addition to obtain a rounding result, a rounding result symmetric with respect to positive and negative binary values is obtained. An excellent impulse response estimation characteristic can be obtained as the characteristic of the adaptive filter.
According to the eighth invention, means for generating a pseudo response signal by performing a convolution operation on impulse response estimation data of an unknown system and a predetermined reference signal, the pseudo response signal, and a response signal from the unknown system And means for calculating a correction amount of the impulse response estimation data, and means for calculating new n-bit impulse response estimation data by adding the correction amount and the impulse response estimation data. In the data rounding device used in the adaptive filter provided, the applied filter is configured to round the correction amount of the calculated impulse response estimation data, and includes mn bits of upper bit data and m bits of lower bit data. And (n, m are integers, n> m), means for holding n-bit unrounded data, Means for performing a right shift of -m bits, and means for adding the data before rounding and the data shifted to the right by nm bits to the data before rounding in alignment with n bits. By rounding down the lower m bits of n-bit data to obtain a rounding result, a rounding result that is symmetric with respect to positive and negative binary values is obtained, and an excellent impulse response estimation characteristic is provided as a characteristic of the adaptive filter. Obtainable.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a rounding processing circuit according to a first embodiment of the present invention.
FIG. 2 is a diagram for explaining rounding processing according to the first embodiment;
FIG. 3 is a block diagram showing a configuration of a rounding processing circuit according to a second embodiment of the present invention.
FIG. 4 is a block diagram showing a schematic configuration of a digital signal processor that executes software according to Embodiment 3 of the present invention;
FIG. 5 is a flowchart showing an execution procedure of a data rounding method according to the third embodiment.
FIG. 6 is a block diagram showing a configuration of an adaptive filter using a data rounding method according to Embodiment 4 of the present invention.
7 is a diagram illustrating characteristics of an adaptive filter according to Embodiment 4. FIG.
FIG. 8 is a block diagram showing a configuration of an adaptive filter using a data rounding method according to a fifth embodiment of the present invention.
FIG. 9 is a diagram illustrating a rounding result when rounding is performed by simple truncation.
FIG. 10 is a flowchart showing a flow of a conventional rounding method.
FIG. 11 is a diagram showing a rounding result when rounding is performed by rounding off.
FIG. 12 is a diagram showing another rounding result when rounding is performed by rounding off.
[Explanation of symbols]
101, 102, 104 ... registers, 103 ... n-bit adder, 105 ... nm bit shift computing unit, 201 ... X register, 202 ... H register, 203 ... convolution integrator, 204 ... subtractor, 205 ... ΔH generation Circuit 206... H + ΔH adder 207 rounding processing unit 250 unknown system 400 digital signal processor (DSP) 401 CPU 402 ROM 403 memory 404 output unit

Claims (8)

データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め方法において、
n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持するステップと、
n−mビットの0のデータを保持するステップと、
前記丸め前データの上位mビットの上位ビット側に、前記n−mビットの0のデータを合成するステップと、
前記丸め前データと、前記丸め前の上位mビットの上位ビット側にn−mビットの0のデータを合成したデータとを加算するステップと、
前記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得るステップとを備えること特徴とするコンピュータシステムにより実行されるデータ丸め方法。
In a data rounding method for obtaining a rounding result of a predetermined number of bits by rounding the lower bits of data,
holding n-bit unrounded data consisting of n−m bits of upper bit data, m bits of lower bit data (n and m are integers, n> m),
holding n−m bits of 0 data;
Synthesizing the nm bits of 0 data on the upper m bits of the upper m bits of the pre-round data;
Adding the data before rounding and data obtained by combining 0-bit data of nm bits on the upper bit side of the upper m bits before rounding;
Truncating the lower m bits of the n-bit data after addition to obtain a rounding result, and a data rounding method executed by a computer system.
データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め装置において、
n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、
n−mビットのデータを保持する手段と、
前記丸め前データの上位mビットの上位ビット側に、前記n−mビットのデータを合成する手段と、
前記丸め前データと、前記丸め前の上位mビットの上位ビット側にn−mビットのデータを合成したデータとを加算する手段とを備え、
前記n−mビットのデータを保持する手段に全て0のデータを保持して、前記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得ることを特徴とするデータ丸め装置。
In a data rounding device that obtains a rounding result of a predetermined number of bits by rounding the lower bits of data,
means for holding n-bit unrounded data consisting of n−m bits of upper bit data, m bits of lower bit data, and (n and m are integers, n>m);
means for holding nm bits of data;
Means for synthesizing the nm bits of data on the upper m bits of the upper m bits of the pre-round data;
Means for adding the unrounded data and data obtained by combining nm bits of data to the upper bits of the upper m bits before rounding;
A data rounding apparatus characterized in that all 0 data is held in the means for holding nm bits of data, and the lower m bits of the added n bit data are discarded to obtain a rounding result.
データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め方法において、In a data rounding method for obtaining a rounding result of a predetermined number of bits by rounding the lower bits of data,
n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持するステップと、  holding n-bit unrounded data consisting of n−m bits of upper bit data, m bits of lower bit data, and (n and m are integers, n> m);
前記丸め前データに対してn−mビットの右シフトを行うステップと、Performing a right shift of nm bits on the unrounded data;
前記丸め前データと、前記丸め前データに対してn−mビット右シフトしたデータとを加算するステップと、Adding the data before rounding and data shifted to the right by nm bits with respect to the data before rounding;
前記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得るステップとをTruncating the lower m bits of the n-bit data after the addition to obtain a rounding result.
備えること特徴とするコンピュータシステムにより実行されるデータ丸め方法。A data rounding method executed by a computer system.
データの下位ビットに丸め処理を施すことによって所定ビット数の丸め結果を得るデータ丸め装置において、In a data rounding device that obtains a rounding result of a predetermined number of bits by rounding the lower bits of data,
n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、  means for holding n-bit unrounded data consisting of n−m bits of upper bit data, m bits of lower bit data, and (n and m are integers, n> m);
前記丸め前データに対してn−mビットの右シフトを行う手段と、Means for right shifting nm bits with respect to the unrounded data;
前記丸め前データと、前記丸め前データに対してn−mビット右シフトしたデータとを加算する手段とを備え、Means for adding the data before rounding and the data shifted to the right by nm bits with respect to the data before rounding;
前記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得ることを特徴とするデータ丸め装置。A data rounding device, wherein a rounding result is obtained by truncating the lower m bits of the n-bit data after the addition.
未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、
前記擬似応答信号と前記未知のシステムからの応答信号との差分をもとに、前記インパルス応答推定データの修正量を算出する手段と、
前記修正量と前記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで使用するデータ丸め装置において、
前記適用フィルタは、前記算出されたインパルス応答推定データの修正量と前回までの前記インパルス応答推定データとの加算値を丸めて新たなインパルス応答推定データとする構成とされており、
n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、
n−mビットのデータを保持する手段と、
前記丸め前データの上位mビットの上位ビット側に、前記n−mビットのデータを合成する手段と、
前記丸め前データと、前記丸め前の上位mビットの上位ビット側にn−mビットのデータを合成したデータとを加算する手段とを備え、
前記n−mビットのデータを保持する手段に全て0のデータを保持して、前記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得ることを特徴とするデータ丸め装置。
Means for performing a convolution operation on impulse response estimation data of an unknown system and a predetermined reference signal to generate a pseudo response signal;
Means for calculating a correction amount of the impulse response estimation data based on a difference between the pseudo response signal and a response signal from the unknown system;
In a data rounding device used in an adaptive filter comprising means for calculating the new n-bit impulse response estimation data by adding the correction amount and the impulse response estimation data,
The applied filter is configured to round the addition value of the calculated amount of correction of the impulse response estimation data and the impulse response estimation data up to the previous time to obtain new impulse response estimation data,
means for holding n-bit unrounded data consisting of n−m bits of upper bit data, m bits of lower bit data, and (n and m are integers, n>m);
means for holding nm bits of data;
Means for synthesizing the nm bits of data on the upper m bits of the upper m bits of the pre-round data;
Means for adding the unrounded data and data obtained by combining nm bits of data to the upper bits of the upper m bits before rounding;
A data rounding apparatus characterized in that all 0 data is held in the means for holding nm bits of data, and the lower m bits of the added n bit data are discarded to obtain a rounding result.
未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、
前記擬似応答信号と前記未知のシステムからの応答信号との差分をもとに、前記インパルス応答推定データの修正量を算出する手段と、
前記修正量と前記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで用いるデータ丸め装置において、
前記適用フィルタは、前記算出されたインパルス応答推定データの修正量を丸める構成とされており、
n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、
n−mビットのデータを保持する手段と、
前記丸め前データの上位mビットの上位ビット側に、前記n−mビットのデータを合成する手段と、
前記丸め前データと、前記丸め前の上位mビットの上位ビット側にn−mビットのデータを合成したデータとを加算する手段とを備え、
前記n−mビットのデータを保持する手段に全て0のデータを保持し、前記加算後のnビットデータの下位mビットを切り捨てて丸め結果を得ることを特徴とするデータ丸め装置。
Means for performing a convolution operation on impulse response estimation data of an unknown system and a predetermined reference signal to generate a pseudo response signal;
Means for calculating a correction amount of the impulse response estimation data based on a difference between the pseudo response signal and a response signal from the unknown system;
In a data rounding apparatus used in an adaptive filter comprising means for adding the correction amount and the impulse response estimation data to calculate new n-bit impulse response estimation data,
The applied filter is configured to round the correction amount of the calculated impulse response estimation data,
means for holding n-bit unrounded data consisting of n−m bits of upper bit data, m bits of lower bit data, and (n and m are integers, n>m);
means for holding nm bits of data;
Means for synthesizing the nm bits of data on the upper m bits of the upper m bits of the pre-round data;
Means for adding the unrounded data and data obtained by combining nm bits of data to the upper bits of the upper m bits before rounding;
A data rounding device characterized in that all 0 data is held in the means for holding nm bits of data, and the lower m bits of the added n bit data are rounded down to obtain a rounding result.
未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、Means for performing a convolution operation on impulse response estimation data of an unknown system and a predetermined reference signal to generate a pseudo response signal;
前記擬似応答信号と前記未知のシステムからの応答信号との差分をもとに、前記インパルス応答推定データの修正量を算出する手段と、  Means for calculating a correction amount of the impulse response estimation data based on a difference between the pseudo response signal and a response signal from the unknown system;
前記修正量と前記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで使用するデータ丸め装置において、In a data rounding device used in an adaptive filter comprising means for calculating the new n-bit impulse response estimation data by adding the correction amount and the impulse response estimation data,
前記適用フィルタは、前記算出されたインパルス応答推定データの修正量と前回までの前記インパルス応答推定データとの加算値を丸めて新たなインパルス応答推定データとする構成とされており、The applied filter is configured to round the addition value of the calculated amount of correction of the impulse response estimation data and the impulse response estimation data up to the previous time to obtain new impulse response estimation data,
n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、means for holding n-bit unrounded data consisting of n−m bits of upper bit data, m bits of lower bit data, and (n and m are integers, n> m);
前記丸め前データに対してn−mビットの右シフトを行う手段と、  Means for right shifting nm bits with respect to the unrounded data;
前記丸め前データと、前記丸め前のデータに対してn−mビット右シフトしたデータとを加算する手段とを備え、  Means for adding the data before rounding and the data shifted to the right by nm bits with respect to the data before rounding;
前記加算後のnビットのデータの下位mビットを切り捨てて丸め結果を得ることを特徴とするデータ丸め装置。  A data rounding device, wherein a rounding result is obtained by truncating lower m bits of n-bit data after the addition.
未知のシステムのインパルス応答推定データと所定の参照信号とに畳み込み演算を行って擬似応答信号を発生する手段と、Means for performing a convolution operation on impulse response estimation data of an unknown system and a predetermined reference signal to generate a pseudo response signal;
前記擬似応答信号と前記未知のシステムからの応答信号との差分をもとに、前記インパルス応答推定データの修正量を算出する手段と、  Means for calculating a correction amount of the impulse response estimation data based on a difference between the pseudo response signal and a response signal from the unknown system;
前記修正量と前記インパルス応答推定データを加算して新たなnビットのインパルス応答推定データを算出する手段とを備える適応フィルタで用いるデータ丸め装置において、  In a data rounding apparatus used in an adaptive filter comprising means for adding the correction amount and the impulse response estimation data to calculate new n-bit impulse response estimation data,
前記適用フィルタは、前記算出されたインパルス応答推定データの修正量を丸める構成とされており、  The applied filter is configured to round the correction amount of the calculated impulse response estimation data,
n−mビットの上位ビットデータと、mビットの下位ビットデータと(n,mは整数で、n>m)とからなる、nビットの丸め前データを保持する手段と、  means for holding n-bit unrounded data consisting of n−m bits of upper bit data, m bits of lower bit data, and (n and m are integers, n> m);
前記丸め前データに対してn−mビットの右シフトを行う手段と、  Means for right shifting nm bits with respect to the unrounded data;
前記丸め前データと、前記丸め前データに対してn−mビット右シフトしたデータとを加算する手段とを備え、  Means for adding the data before rounding and the data shifted to the right by nm bits with respect to the data before rounding;
前記加算後のnビットの下位mビットを切り捨てて丸め結果を得ることを特徴とするデータ丸め装置。  A data rounding device, wherein the rounded result is obtained by truncating the lower m bits of the n bits after the addition.
JP19843398A 1998-07-14 1998-07-14 Data rounding method and data rounding device Expired - Lifetime JP4196434B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19843398A JP4196434B2 (en) 1998-07-14 1998-07-14 Data rounding method and data rounding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19843398A JP4196434B2 (en) 1998-07-14 1998-07-14 Data rounding method and data rounding device

Publications (2)

Publication Number Publication Date
JP2000029668A JP2000029668A (en) 2000-01-28
JP4196434B2 true JP4196434B2 (en) 2008-12-17

Family

ID=16391014

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19843398A Expired - Lifetime JP4196434B2 (en) 1998-07-14 1998-07-14 Data rounding method and data rounding device

Country Status (1)

Country Link
JP (1) JP4196434B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022168604A1 (en) * 2021-02-05 2022-08-11 コニカミノルタ株式会社 Softmax function approximation calculation device, approximation calculation method, and approximation calculation program

Also Published As

Publication number Publication date
JP2000029668A (en) 2000-01-28

Similar Documents

Publication Publication Date Title
US7577699B2 (en) Apparatus and method for reducing precision of data
JP4460047B2 (en) Galois field multiplication system
JP2608165B2 (en) Method and apparatus for multiplying a real-time two&#39;s complement code in a digital signal processing system
JP4196434B2 (en) Data rounding method and data rounding device
JP5175983B2 (en) Arithmetic unit
JP3768613B2 (en) Log approximate value calculation circuit
JPH05158656A (en) Sum of product arithmetic unit and method therefor
KR100309520B1 (en) Multiplication methods and multiplication circuits with round-off capability
JPH09128213A (en) Block floating processing system/method
JPH06230991A (en) Method and apparatus for computation of inverse number of arbitrary element in finite field
JPH067375B2 (en) Arithmetic circuit
JP2008158855A (en) Correlation computing element and correlation computing method
JP2753922B2 (en) Fixed-point division method
JP3910707B2 (en) Digital signal processing circuit
JP2569976B2 (en) Digital filter
JPH0224410B2 (en)
JP2546014B2 (en) Digital signal processor
JP2914813B2 (en) Error correction decoding device
JPS6165362A (en) Digital signal processor
JP2000010763A (en) Division circuit
JP3659408B2 (en) Data arithmetic processing apparatus and data arithmetic processing program
JPH1040073A (en) Digital signal processor
JP2008097194A (en) Inverse calculation apparatus, inverse calculation method and inverse calculation program
JP3626611B2 (en) Data arithmetic unit
JP2000137701A (en) Product-sum operation error correcting method and product sum arithmetic unit

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20040708

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050617

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071102

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071113

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080111

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080603

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080730

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080909

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080922

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111010

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111010

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121010

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131010

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term