JP2005012284A - Bit length extending apparatus, data processing apparatus, bit length extending method, control program and readable recording medium - Google Patents

Bit length extending apparatus, data processing apparatus, bit length extending method, control program and readable recording medium Download PDF

Info

Publication number
JP2005012284A
JP2005012284A JP2003171370A JP2003171370A JP2005012284A JP 2005012284 A JP2005012284 A JP 2005012284A JP 2003171370 A JP2003171370 A JP 2003171370A JP 2003171370 A JP2003171370 A JP 2003171370A JP 2005012284 A JP2005012284 A JP 2005012284A
Authority
JP
Japan
Prior art keywords
bit
data
bits
bit length
variable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2003171370A
Other languages
Japanese (ja)
Other versions
JP4063723B2 (en
Inventor
Hiroki Sato
浩樹 佐藤
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP2003171370A priority Critical patent/JP4063723B2/en
Publication of JP2005012284A publication Critical patent/JP2005012284A/en
Application granted granted Critical
Publication of JP4063723B2 publication Critical patent/JP4063723B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To supplement data of low order (m-n) bit length with a less conversion error by an easy processing in extending digital data of n-bit length to data of m-bit length (m>n). <P>SOLUTION: In performing bit extension for input data Dn of a bit length n into output data Dm of a bit length larger than n, a bit length extending apparatus 10 assigns high order (m-n) bit of the input data Dn to low order (m-n) bits of the output data requiring supplement, thereby generating the of m-bit output data Dm without performing complicated processing. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、デジタルデータをその使用環境に応じてビット長変換する際に用いられるビット長拡張装置、これを用いたデータ処理装置、ビット長拡張方法、これをコンピュータに実行させるための制御プログラムおよび、これを記録したコンピュータ読み取り可能な可読記録媒体に関する。
【0002】
【従来の技術】
近年、様々な情報・データがデジタル信号化されて処理されている。しかしながら、同じ種類の情報・データであっても、そのデータを処理するデータ処理装置の性能や処理能力、必要とされる処理精度、データの運用に関わる仕様や規定事項などの条件のような所謂使用環境に応じて、それぞれに適したビット長のデジタル信号によって処理を行う必要がある。このため、同じ情報・データであっても、一つの使用環境から異なる使用環境に情報・データを移動させる場合には、それぞれの使用環境に適したビット長でデータ処理を行うことができるように、ビット長を変換する必要がある。
【0003】
例えば、使用環境Nに適したビット長がn(nは正の整数)ビットであり、使用環境Mに適したビット長がm(mは正の整数)ビットである場合に、同じ情報・データであっても、使用環境Nから使用環境Mにデータを移動させる際には、そのビット長をnからmに変換する必要がある。
【0004】
ここで、図6(a)に示すように、n>mである場合には、nビットのデータの下位(n−m)ビットを切り捨てて、上位mビットを使用することによって、mビットのデータを生成することができる。
【0005】
しかしながら、図6(b)に示すように、n<mである場合には、mビットのデータにおいて不足する下位(m−n)ビットを何らかの方法で補う必要がある。
【0006】
このように、nビットのデータをmビットのデータに拡張する際に、mビットのデータの下位(m−n)を補うための最も容易な方法としては、例えば(m−n)ビットの不足分を全て「0」または「1」によって補填する方法が挙げられる。
【0007】
また、オーディオ関連分野などでは、例えば特許文献1〜3などのように、下位ビットを発生させるための方法が多く提案されている。
【0008】
例えば、許文献1には、Nビットのオーディオデータから下位Mビットと符号ビットSとを抽出して(S+M)ビットのデータを生成し、これに{N−(S+M)}ビットの擬似データLを付加して(S+L+M)ビットのデータを生成し、これに残響ビットXを付加して(S+L+M+X)ビットのデータを生成し、(S+L+M)ビットのデータとNビットのデータを置換して(N+X)ビットのデータを生成することによって、フェードアウト部で違和感無くビット長を拡張することができるビット長拡張方法が開示されている。
【0009】
また、特許文献2には、サンプリングデータ間の差分を抽出して、数サンプルにわたって変化がなく、1LSBのみが変化するような微小レベル部を検出し、1LSB変化の前後数サンプルにわたって緩やかなレベル変化出力となるようにLSB以下のデータを生成して加算させることによって、全体的になめらかなデータ変化を得ることができるビット拡張装置が開示されている。
【0010】
さらに、特許文献3には、入力オーディオデータのサンプル間の差分データ列を算出して、差分データが0である無変化点連続区間と差分データが1LB以上である変化点とを算出し、無変化連続区間に隣接する変化点の差分データを用いて二つの変化率を算出して、無変化連続区間と二つの変化率に基づいて無変化連続区間のデータの下位ビットをビット長拡張させることによって、デジタルオーディオデータから入力アナログオーディオ信号の振幅に近いオーディオ信号を再生することができるデジタルオーディオ再生装置が開示されている。
【0011】
【特許文献1】
特開平9−46179号公報
【特許文献2】
特開平4−354208号公報
【特許文献3】
特開平10−242859号公報
【0012】
【発明が解決しようとする課題】
しかしながら、nビットのデータをmビット(m>n)のデータに拡張する際に、mビットのデータのうち、下位(m−n)ビットを全て「0」または「1」によって補填する方法では、「0」の場合には最大値に近づくほど誤差が大きくなり、「1」の場合には最小値に近づくほど誤差が大きくなるという問題が生じる。
【0013】
例えば、使用環境Nで扱われるビット長nのデータDnを、使用環境Mで使用するためにビット長mのデータDmに変換しようとした場合に、図7の矢印A1に示すように、下位(m−n)ビットの不足分を全て「0」で補填すると、Dnが最大値になってもDmは最大値にならない。また、図7の矢印A2に示すように、下位(m−n)ビットの不足分を全て「1」で補填すると、Dnが最小値(0)になってもDmは0にならない。
【0014】
また、上記特許文献1〜3に開示されているビット長拡張方法では、いずれも複雑な処理が必要となるため、オーディオ関連分野以外の技術分野に応用することは容易ではない。
【0015】
本発明は、上記従来の問題を解決するもので、nビット長のデジタルデータをmビット長(m>n)のデータにビット長を拡張する際に、複雑な処理とならず、下位(m−n)ビット長のデータを、より少ない誤差で補填することができて、幅広い技術分野で応用できるビット長拡張装置、これを用いたデータ処理装置、ビット長拡張方法、これをコンピュータに実行させるための制御プログラムおよび、これを記録したコンピュータ読み取り可能な可読記録媒体を提供することを目的とする。
【0016】
【課題を解決するための手段】
本発明のビット長拡張装置は、n(nは正の整数)ビット長のデジタルデータを、mビット(mは、m>nの整数)長のデジタルデータに拡張するビット長拡張装置において、該mビットのデータのうち、上位nビットには元のデータの全nビットデータを割り当て、下位(m−n)ビットには元のデータの上位(m−n)ビットデータを再度割り当てることによりmビットの出力データを生成する第1のビット長拡張手段を有しており、そのことにより上記目的が達成される。
【0017】
本発明のビット長拡張装置は、最上位ビットに符号情報が含まれるn(nは正の整数)ビット長のデジタルデータを、mビット(mは、m>nの整数)長のデジタルデータに拡張するビット長拡張装置において、該mビットのデータのうち、上位nビットには元のデータの全nビットデータを割り当て、下位(m−n)ビットには元のデータの最上位ビットの次の第2位のビットから上位(m−n)ビットまでのデータを割り当てることによりmビットの出力データを生成する第2のビット長拡張手段を有しており、そのことにより上記目的が達成される。
【0018】
また、好ましくは、本発明のビット長拡張装置における第1のビット長拡張手段は、前記nビットの入力データを、ビット長(m−n)ビットの上位入力データおよびビット長(n−(m−n))の下位入力データに分離する第1のデータ分離手段と、該mビットのデータのうち、上位(m−n)ビットには該上位入力データを割り当て、その次の(n−(m−n))ビットには該下位入力データを割り当て、更にその次の下位(m−n)ビットには該上位入力データを再度割り当てることによりmビットの出力データを生成する第1のデータ合成手段とを有する。
【0019】
さらに、好ましくは、本発明のビット長拡張装置における第2のビット長拡張手段は、前記nビットの入力データを、最上位ビットの最上位入力データ、該最上位ビットの次の第2位のビットからビット長(m−n)ビットまでの上位入力データ、およびビット長(n−(m−n)−1)の下位入力データに分離する第2のデータ分離手段と、前記mビットのデータのうち、該最上位ビットには該最上位入力データを割り当て、該最上位ビットの次の第2位のビットから上位(m−n)ビットには該上位入力データを割り当て、その次の(n−(m−n)−1)ビットには該下位入力データを割り当て、更にその次の下位(m−n)ビットには該上位入力データを再度割り当てることによりmビットの出力データを生成する第2のデータ合成手段とを有する。
【0020】
さらに、好ましくは、本発明のビット長拡張装置における第1のビット長拡張手段または第2のビット長拡張手段は、前記nビットの入力データを一方向に(m−n)回ビットシフトさせた第1変数を生成する第1変数生成手段と、該nビットの入力データを他方向に(n−(m−n))回ビットシフトさせた第2変数を生成する第2変数生成手段と、該第1変数と第2変数の論理和からmビットの出力データを生成する第1論理合成手段とを有する。
【0021】
さらに、好ましくは、本発明のビット長拡張装置における第2のビット長拡張手段は、前記nビットの入力データの最上位ビットの次の第2位のビットから(n−1)ビットのデータを一方向に(m−n)回ビットシフトさせた第3変数を生成する第3変数生成手段と、該(n−1)ビットのデータを他方向に(n−(m−n)−1)回ビットシフトさせた第4変数を生成する第4変数生成手段と、該第3変数と第4変数との論理和からm−1ビットのデータを生成し、該m−1ビットの最上位に最上位ビットデータとして、該最上位ビットの入力データを付加してmビットの出力データを生成する第2論理合成手段とを有する。
【0022】
本発明のデータ処理装置は、請求項1〜6の何れかに記載のビット長拡張装置の入力データおよび出力データのうち少なくともいずれかにデータ処理を施し、そのことにより上記目的が達成される。
【0023】
本発明のビット長拡張方法は、n(nは正の整数)ビット長のデジタルデータを、mビット(mは、m>nの整数)長のデジタルデータに拡張するビット長拡張方法において、該mビットのデータのうち、上位nビットには元のデータの全nビットデータを割り当て、下位(m−n)ビットには元のデータの上位(m−n)ビットデータを再度割り当てることによりmビットのデータを生成する第1のビット長拡張ステップを有しており、そのことにより上記目的が達成される。
【0024】
本発明のビット長拡張方法は、最上位ビットに符号情報が含まれるn(nは正の整数)ビット長のデジタルデータを、mビット(mは、m>nの整数)長のデジタルデータに拡張するビット長拡張方法において、該mビットのデータのうち、上位nビットには元のデータの全nビットデータを割り当て、下位(m−n)ビットには元のデータの最上位ビットの次の第2位のビットから上位(m−n)ビットまでのデータを割り当てることによりmビットのデータを生成する第2のビット長拡張ステップを有しており、そのことにより上記目的が達成される。
【0025】
また、好ましくは、本発明のビット長拡張方法における第1のビット長拡張ステップまたは第1のビット長拡張ステップは、前記nビットの入力データを一方向に(m−n)回ビットシフトさせた第1変数を生成する第1変数生成ステップと、該nビットの入力データを他方向に(n−(m−n))回ビットシフトさせた第2変数を生成する第2変数生成ステップと、該第1変数と第2変数の論理和からmビットのデータを生成する第1論理合成ステップとを有する。
【0026】
さらに、好ましくは、本発明のビット長拡張方法における第2のビット長拡張ステップは、前記nビットの入力データの最上位ビットの次の第2位のビットから(n−1)ビットまでのデータを一方向に(m−n)回ビットシフトさせた第3変数を生成する第3変数生成ステップと、該(n−1)ビットのデータを他方向に(n−(m−n)−1)回ビットシフトさせた第4変数を生成する第4変数生成ステップと、該第3変数と第4変数との論理和からm−1ビットのデータを生成し、該m−1ビットの最上位に最上位ビットデータとして、該最上位ビットの入力データを付加してmビットのデータを生成する第2論理合成ステップとを有する。
【0027】
本発明の制御プログラムは、請求項8〜11の何れかに記載のビット長拡張方法のステップをコンピュータに実行させるためのものであり、そのことにより上記目的が達成される。
【0028】
本発明の可読記録媒体は、請求項12に記載の制御プログラムが記録されたコンピュータ読み取り可能であり、そのことにより上記目的が達成される。
【0029】
上記構成により、以下に、本発明の作用について説明する。
【0030】
本発明にあっては、図2に示すように、ビット長nのデータDnを、nよりも大きいビット長mのデータDmにビット長を拡張する際に、補填が必要となる(m−n)ビットの下位ビットに対してそれぞれ、Dnの上位(m−n)ビットをそれぞれ割り当てることによって、従来のように複雑な処理を行うことなく、mビットのデータDmを生成することが可能となる。
【0031】
また、Dnが最大値のときにはDmも最大値となり、Dnが最小値のときにはDmも最小値となるため、(m−n)ビットの不足分を全て「1」または「0」で補填する従来技術に比べて誤差を大幅に削減することが可能となる。
【0032】
nビットのデータの最上位ビットに符号情報が含まれている場合には、補填が必要な下位(m−n)ビットに、元のデータの最上位ビットを除く第二位のビットから上位(m−n)ビットを割り当てることができる。
【0033】
【発明の実施の形態】
以下に、本発明のビット長拡張装置を実施形態1〜3としてデータ処理装置に適用した場合について、図面を参照しながら説明する。
【0034】
(実施形態1)
本実施形態1では、本発明をビット長拡張装置としてハードウェア(ビット長拡張回路)によって実現する例について説明する。
【0035】
図1は、本発明のデータ処理装置の実施形態1における要部構成を示すブロック図である。
【0036】
図1において、このデータ処理装置100は、n(nは正の整数)ビット長のデジタルデータを、mビット(mは、m>nの整数)長のデジタルデータに拡張する第1のビット長拡張手段としてのビット長拡張回路10と、ビット長拡張回路10からのビット長拡張した出力データに各種データ処理を施すデータ処理部5とを備えている。本発明のデータ処理装置100としては、例えばオーディオ機器で、旧式の機器から出力される10ビット階調(本発明ではn=10)のデジタルデータを、最新式の16ビット階調(同m=16)に対応した装置に入力するためのデータ変換器などが挙げられる。
【0037】
ビット長拡張回路10は、入力回路1と、第1のデータ分離手段としての分離回路2と、第1のデータ合成手段としての合成回路3と、ビット長拡張した出力データを出力する出力回路4とを有しており、mビットのデータのうち、上位nビットには元のデータの全nビットデータを割り当て、下位(m−n)ビットには元のデータの上位(m−n)ビットデータを再度割り当てることによりmビットの出力データを生成する。
【0038】
入力回路1は、外部からビット長n(nは正の整数)の入力データDnが入力されてそれが出力される。
【0039】
分離回路2は、入力データDnを、ビット長(m−n)の上位入力データDn1と、ビット長(n−(m−n))の下位入力データDn2とに分離する。ここで、mは、m>nの正数である。
【0040】
合成回路3は、上位入力データDn1が上位(m−n)ビットに割り当てられ、下位入力データDn2がその次の(n−(m−n))ビットに割り当てられ、さらに、図2に示すように、上位入力データDn1が下位(m−n)ビットに再度割り当てられて、ビット長mの出力データDmを生成する。
【0041】
出力部4は、合成回路3からのビット長m(mはm>nの整数)に拡張されたデータDmを外部に出力する。
【0042】
上記構成により、図3(a)を用いて、符号情報が含まれない入力データDnのビット長を8、出力データのビット長Dmを15とした場合のビット長拡張装置10の動作について説明する。
【0043】
図3(a)に示すように、まず、ビット長n=8の入力データDnが(m−n)=15−8=7ビット長の上位入力データおよびビット長(n−(m−n))=8−7=1ビット長の下位入力データDn2に分離される。
【0044】
次に、上位入力データDn1が上位(m−n)=7ビットに割り当てられ、下位入力データDn2がその次の(n−(m−n))=1ビットに割り当てられ、さらに、上位入力データDn1が下位(m−n)=7ビットに再度割り当てられて、ビット長m=15の出力データDmが生成されている。
【0045】
以上により、本実施形態1によれば、ビット長nのデータDnを、nよりも大きいビット長mのデータDmにビット長を拡張する際に、補填が必要となる(m−n)ビットの下位ビットに対してそれぞれ、データDnの上位(m−n)ビットをそれぞれ割り当てることによって、従来のように複雑な処理を行うことなく、mビットのデータDmを容易に生成することができる。この場合に、入力データDnが最大値のときにはDmも最大値となり、入力データDnが最小値のときにはDmも最小値となるため、(m−n)ビットの不足分を全て「1」または「0」で補填する従来技術に比べて誤差を大幅に削減することができる。
【0046】
また、本実施形態1のビット長拡張回路10をデータ処理装置100に実装する場合に、符号情報(正または負を示す情報など)がいずれかに固定されていれば、分離回路2および合成回路3の動作を単純な配線のみで実現することが可能となる。
【0047】
(実施形態2)
上記実施形態1では、入力データの最上位ビットに符号情報が含まれていない場合について説明したが、本実施形態2では、入力データの最上位ビットに符号情報(正または負を示す情報など)が含まれている場合について説明する。図1を共用して説明する。
【0048】
図1において、このデータ処理装置100Aは、n(nは正の整数)ビット長のデジタルデータを、mビット(mは、m>nの整数)長のデジタルデータに拡張する第2のビット長拡張手段としてのビット長拡張回路10Aと、データ処理部5とを備えている。
【0049】
ビット長拡張回路10Aは、入力回路1と、第2のデータ分離手段としての分離回路2Aと、第2のデータ合成手段としての合成回路3Aと、ビット長拡張した出力データを出力する出力回路4とを有しており、mビットのデータのうち、上位nビットには元のデータの全nビットデータを割り当て、下位(m−n)ビットには元のデータの最上位ビットの次の第2位のビットから上位(m−n)ビットまでのデータを割り当てることによりmビットの出力データを生成する。
【0050】
分離回路2Aは、入力されたビット長nのデータDnが、符号情報を示す最上位ビットからなる最上位入力データDn0、最上位ビットを除く第2位のビットからビット長(m−n)ビットの上位入力データDn1、およびビット長(n−(m−n)−1)の下位入力データDn2にデータ分離する。
【0051】
合成回路3Aは、最上位入力データ(符号情報)が最上位ビットに割り当てられ、上位入力データDn1が最上位ビットの次の第2位のビットから上位(m−n)ビットに割り当てられ、下位入力データDn2がその次の(n−(m−n)−1)ビットに割り当てられ、さらに、上位入力データDn1が下位(m−n)ビットに再度割り当てられて、最上位ビットに符号情報を含むビット長mの出力データを生成する。
【0052】
上記構成により、図3(b)を用いて、符号情報が含まれた入力データのビット長を8、出力データのビット長を15とした場合のビット長拡張回路の動作例を説明する。
【0053】
図3(b)に示すように、最上位ビットに符号情報が含まれているビット長n=8の入力データDnが、符号情報sを示す最上位ビットからなる最上位入力データDn0、最上位ビットを除く第2位のビットからビット長(m−n)=15−8=7ビットの上位入力データDn1、およびビット長(n−(m−n)−1)=8−8=0の下位入力データDn2に分離される。この例では、下位入力データDn2は0ビットであるために、図3(b)では示されていない。
【0054】
最上位入力データ(符号情報)が最上位ビットに割り当てられ、上位入力データDn1が最上位ビットを除く第2位のビットから上位(m−n)=7ビットに割り当てられ、下位入力データDn2がその次の(n−(m−n)−1)=0ビットに割り当てられ、さらに、上位入力データDn1が、更にその次の下位(m−n)=7ビットに再度割り当てられて、最上位に符号情報sを含むビット長mの出力データDmを生成する。
【0055】
以上により、本実施形態2のビット長拡張装置10Aによれば、nビットのデータの最上位ビットに符号情報sが含まれている場合に、補填が必要な下位(m−n)ビットに、元のデータの最上位ビットを除く第2位のビットから上位(m−n)ビットを割り当てることができる。この場合にも、入力データDnが最大値の場合には上位入力データが全て「1」になるため、出力データDmも最大値となる。また、入力データDnが最小値の場合には上位入力データが全て「0」になるため、出力データDmも最小値となる。したがって、従来技術のように、複雑な処理を行うことなく、変換誤差を少なくすることができる。
【0056】
なお、上記実施形態1,2では、本発明のビット長拡張装置10,10Aをハードウウェア(ビット長拡張回路)によって実現する場合について説明してきたが、これに限らず、ソフトウェア(制御プログラム)によっても上記実施形態1,2の機能を実現することができる。
【0057】
次に、ソフトウェアによる本発明のビット長拡張装置の実施形態3について説明する。
【0058】
(実施形態3)
図4は、本発明のデータ処理装置の実施形態3における要部構成を示すブロック図である。
【0059】
図4において、このデータ処理装置20は、コンピュータにより構成されており、本発明のビット長拡張処理を行うビット長拡張装置と、ビット長拡張装置の入力データおよび出力データの少なくとも何れかにデータ処理を施すデータ処理部との機能を有している。
【0060】
ビット長拡張装置は、各種データなどを記憶する記憶部としてのROM21およびRAM22と、ユーザが各種操作指令やデータ(操作入力データの他に受信データを含む)などを入力可能とする入力部23と、各種画像を表示したり、データをプリントアウトしたりさらにはデータ送信したりする出力部24と、各部を制御して本発明のビット長拡張処理を行う制御部25とを有する。
【0061】
ROM21は、ビット長拡張制御処理用の制御プログラムおよびそのデータが記憶されている。この制御プログラムおよびそのデータは、CD(光ディスク)やDVDなどの可読記録媒体からインターフェイス(図示せず)を介してダウンロードされ得る。
【0062】
RAM22は、制御部25が動作するに際してワークメモリとして機能する。
【0063】
制御部25はコンピュータのCPU(中央演算処理装置)で構成されており、ビット長拡張制御処理用の制御プログラムに基づいて、ビット長nの入力データDnを、nよりも大きなビット長mのデータDmにビット拡張する際に、補填が必要となる(m−n)ビットの下位ビットに対して、入力データDnの上位(m−n)ビットを割り当てることによってmビットの出力データDmを生成する制御が為される。なお、上記データ処理部の機能も制御部25により実行される。
【0064】
具体的には、制御部25は、nビットの入力データを一方向に(m−n)回ビットシフトさせた第1変数を生成する第1変数生成手段と、nビットの入力データを他方向に(n−(m−n))回ビットシフトさせた第2変数を生成する第2変数生成手段と、これらの第1変数と第2変数の論理和からmビットの出力データを生成する第1論理合成手段とを有する。
【0065】
この制御部25が実行する制御プログラムは、nビットの入力データを一方向に(m−n)回ビットシフトさせた第1変数を生成する第1変数生成ステップと、nビットの入力データを他方向に(n−(m−n))回ビットシフトさせた第2変数を生成する第2変数生成ステップと、これらの第1変数と第2変数の論理和からmビットのデータを生成する第1論理合成ステップとを有している。
【0066】
上記構成により、以下、その動作を図5を用いて説明する。
【0067】
図5(a)は、図4の制御部25で用いるデータとしての数値と変数を示す図、図5(b)は、図4の制御部25が実行するビット長拡張処理手順を示すフローチャートである。
【0068】
予め有効ビット長n(nは正の整数)が明らかになっている符号情報sを含まない入力値Dnに対して、ビット操作・演算処理を施して、上位nビットには元のデータの全nビットを割り当て、下位(m−n)ビットには元のデータの上位(m−n)ビットを再度割り当てることによって、有効ビット数m(mは、m>nの正の整数)が明らかになっている符号情報sを含まない出力値(戻り値)Dmを生成する場合について説明する。予め、戻り値Dmよりも十分大きなビット長を有する変数AおよびBを用意する。図5(a)では、n=15およびm=24に対して、ビット長32の変数AおよびBが用意されているものとする。
【0069】
図5(b)に示すように、まず、ステップS1において、変数AおよびBにそれぞれ15ビットの入力値Dnを代入する。
【0070】
次に、ステップS2において、変数Aに対して左シフト(一方向にシフト)のビット操作を(m−n)回行う。図5(a)の例では、変数Aが(m−n)=24−15=9ビットだけ左シフトされる。
【0071】
これと同様に、ステップS3において、変数Bに対して右シフト(他方向シフト)のビット操作を(n−(m−n))回行う。このとき、LSBから押し出されたビットは切り捨てるものとする。この例では、変数Bが(n−(m−n))=15−(24−15)=6ビットだけ右シフトされ、LSBから押し出された6ビットを切り捨てる。
【0072】
最後に、ステップS4において、変数Aと変数Bとの論理和を算出する。即ち、変数Bを変数Aに代入することによって、所望の出力データとしての戻り値Dmを生成する。この例では、24ビットの戻り値Dmが生成される。
【0073】
なお、入力値Dnおよび戻り値Dmに符号情報sが含まれている場合にも、最上位ビットが符合情報sであればその位置に変化がないので、上記の場合と同様に行うことができるが、次のように行ってもよい。
【0074】
即ち、ここでは詳細な説明は省略するが、ステップS1において、入力値Dnを変数AおよびBに代入する前に、符号情報を示す最上位ビットを待避させて、入力値Dnの最上位ビットを除く第2位のビットから(n−1)ビットまでのデータを変数AおよびBに代入する。
【0075】
次に、ステップS2において変数Aに対して左シフトのビット操作を(m−n)回行い(第3変数生成ステップ;第3変数生成手段)、ステップS3において変数Bに対して右シフトのビット操作を(n−(m−n)−1)回行う(第4変数生成ステップ;第4変数生成手段)。
【0076】
最後に、ステップS4において、変数Aと変数Bとの論理和を算出する(第2論理合成ステップ;第2論理合成手段)。この場合にも、変数Bを変数Aに代入すると共に、待避させていた最上位ビットを最上位に付加することによって、最上位に符号情報sを含む戻り値Dmを生成することができる。
【0077】
なお、上記実施形態3では、本発明のビット長拡張装置をソフトウェア(制御プログラム)によって実現する場合について説明してきたが、これに限らず、ハードウウェア(ビット長拡張回路)によっても上記実施形態3の機能を実現することができる。
【0078】
以上により、上記実施形態1〜3によれば、ビット長nの入力データDnを、nよりも大きなビット長mの出力データDmにビット拡張する際に、補填が必要となる出力データDmの下位の(m−n)ビットに対して、入力データDnの上位(m−n)ビットを割り当てることによって、複雑な処理を行うことなく、mビットの出力データDmを生成することができる。また、入力データDnの最上位ビットに符号情報sが含まれている場合には、補填が必要となる入力データDnの下位の(m−n)ビットに対して、最上位ビットを除く第2位のデータから上位(m−n)ビットを割り当てることができる。このようにして、nビット長のデジタルデータをmビット長(m>n)のデータに拡張する際に、下位(m−n)ビット長のデータを、容易なビット長拡張処理によって少ないビット長変換誤差で補填することができる。
【0079】
【発明の効果】
以上により、本発明によれば、簡単な処理により、最小限の変換誤差にてデジタル信号のビット長拡張処理を行って、それぞれの使用環境に適したビット長でのデータを生成することができる。
【図面の簡単な説明】
【図1】本発明のデータ処理装置の実施形態1、2における要部構成を示すブロック図である。
【図2】本発明の基本原理について説明するための図である。
【図3】(a)は符号情報が含まれていない場合のデータ処理例を示す図、(b)は符号情報が含まれている場合のデータの処理例を示す図である。
【図4】本発明のデータ処理装置の実施形態3における要部構成を示すブロック図である。
【図5】(a)は、図4の制御部で用いる数値と変数を示す図、(b)は、図4の制御部によるビット長拡張処理手順を示すフローチャートである。
【図6】(a)はビット長を減少させる場合の従来の処理例について説明するための図、(b)はビット長を拡張させる場合の従来の処理例について説明するための図である。
【図7】従来のビット長拡張方法の問題点を説明するための図である。
【符号の説明】
1 入力回路
2、2A 分離回路
3、3A 合成回路
4 出力回路
10、10A ビット長拡張装置
100、100A、200 データ処理装置
21 ROM
22 RAM
23 入力部
24 出力部
25 制御部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a bit length extension device used when digital data is converted to a bit length according to the use environment, a data processing device using the same, a bit length extension method, a control program for causing a computer to execute the method, and The present invention also relates to a computer-readable readable recording medium on which this is recorded.
[0002]
[Prior art]
In recent years, various information and data have been converted into digital signals and processed. However, even for the same type of information / data, the so-called conditions such as the performance and processing capability of the data processing apparatus that processes the data, the required processing accuracy, specifications and provisions related to the operation of the data, etc. It is necessary to perform processing with a digital signal having a bit length suitable for each use environment. For this reason, even if the same information / data is transferred from one usage environment to a different usage environment, data processing can be performed with a bit length suitable for each usage environment. Need to convert the bit length.
[0003]
For example, when the bit length suitable for the usage environment N is n (n is a positive integer) bits and the bit length suitable for the usage environment M is m (m is a positive integer) bits, the same information and data Even so, when moving data from the usage environment N to the usage environment M, it is necessary to convert the bit length from n to m.
[0004]
Here, as shown in FIG. 6A, when n> m, the lower (n−m) bits of the n-bit data are discarded and the upper m bits are used, so that m bits Data can be generated.
[0005]
However, as shown in FIG. 6B, when n <m, it is necessary to compensate for the lower (mn) bits that are insufficient in the m-bit data by some method.
[0006]
As described above, when the n-bit data is expanded to the m-bit data, the easiest method for supplementing the lower order (mn) of the m-bit data is, for example, lack of (mn) bits. There is a method in which all the minutes are filled with “0” or “1”.
[0007]
Also, in the audio-related field and the like, many methods for generating lower bits have been proposed, as in Patent Documents 1 to 3, for example.
[0008]
For example, according to Permissible Document 1, lower M bits and sign bit S are extracted from N-bit audio data to generate (S + M) -bit data, and {N− (S + M)}-bit pseudo data L To generate (S + L + M) -bit data, add reverberation bit X to this to generate (S + L + M + X) -bit data, and replace (S + L + M) -bit data with N-bit data (N + X A bit length extending method is disclosed in which the bit length can be extended without generating a sense of incongruity by generating bit data.
[0009]
Further, Patent Document 2 extracts a difference between sampling data, detects a minute level portion where there is no change over several samples and changes only 1 LSB, and a gradual level change over several samples before and after 1 LSB change. There has been disclosed a bit extension apparatus that can obtain a smooth data change as a whole by generating and adding data below the LSB so as to be output.
[0010]
Further, Patent Document 3 calculates a difference data string between samples of input audio data, calculates a continuous point of no change point where the difference data is 0, and a change point where the difference data is 1 LB or more. Two difference rates are calculated using the difference data of the change points adjacent to the change continuous interval, and the lower bits of the data of the non-change continuous interval and the bit length are extended based on the two change rates. Discloses a digital audio reproduction apparatus capable of reproducing an audio signal close to the amplitude of an input analog audio signal from digital audio data.
[0011]
[Patent Document 1]
Japanese Patent Laid-Open No. 9-46179
[Patent Document 2]
JP-A-4-354208
[Patent Document 3]
Japanese Patent Laid-Open No. 10-242859
[0012]
[Problems to be solved by the invention]
However, when n-bit data is expanded to m-bit (m> n) data, the lower (mn) bits of m-bit data are all compensated by “0” or “1”. In the case of “0”, the error increases as it approaches the maximum value, and in the case of “1”, the error increases as it approaches the minimum value.
[0013]
For example, when data Dn having a bit length n handled in the usage environment N is converted to data Dm having a bit length m for use in the usage environment M, as shown by an arrow A1 in FIG. m−n) When all the shortage of bits is filled with “0”, Dm does not reach the maximum value even if Dn reaches the maximum value. Also, as shown by the arrow A2 in FIG. 7, when all the deficiencies of the lower (mn) bits are compensated with “1”, Dm does not become 0 even if Dn becomes the minimum value (0).
[0014]
In addition, the bit length extension methods disclosed in Patent Documents 1 to 3 require complicated processing, so that it is not easy to apply them to technical fields other than audio related fields.
[0015]
The present invention solves the above-described conventional problems. When the bit length is extended from n-bit digital data to m-bit length (m> n) data, complicated processing is not performed and the lower order (m -N) Bit length extension device that can compensate for bit length data with less error and can be applied in a wide range of technical fields, data processing device using the same, bit length extension method, and cause computer to execute this An object of the present invention is to provide a control program and a computer-readable readable recording medium on which the control program is recorded.
[0016]
[Means for Solving the Problems]
The bit length extension device of the present invention is a bit length extension device that extends digital data of n (n is a positive integer) bit length to digital data of m bits (m is an integer of m> n). Of the m-bit data, all n-bit data of the original data is assigned to the upper n bits, and the upper (mn) bit data of the original data is reassigned to the lower (mn) bits. A first bit length extending means for generating bit output data is provided, whereby the above object is achieved.
[0017]
The bit length extension device of the present invention converts digital data of n (n is a positive integer) bit length including sign information in the most significant bit into digital data of m bits (m is an integer of m> n) length. In the bit length extension device to be extended, among the m-bit data, all n-bit data of the original data is assigned to the upper n bits and the next most significant bit of the original data is assigned to the lower (mn) bits. The second bit length extension means for generating m-bit output data by allocating data from the second most significant bit to the upper (mn) bits, thereby achieving the above object. The
[0018]
Preferably, the first bit length extension means in the bit length extension device of the present invention uses the n-bit input data as the upper input data of bit length (mn) bits and the bit length (n− (m -N)) first data separation means for separating the lower-order input data, and among the m-bit data, the higher-order (mn) bits are assigned the higher-order input data, and the next (n- ( mn)) a first data composition for generating m-bit output data by allocating the lower input data to the bits and reassigning the upper input data to the next lower (mn) bits. Means.
[0019]
Further preferably, the second bit length extending means in the bit length extending apparatus of the present invention is configured to convert the n-bit input data into the most significant input data of the most significant bit, the second most significant bit next to the most significant bit. Second data separating means for separating the upper input data from bit to bit length (mn) bits and the lower input data of bit length (n- (mn) -1), and the m-bit data The most significant bit is assigned the most significant input data, the second most significant bit next to the most significant bit is assigned the upper (mn) bits, and the next ( m-bit output data is generated by allocating the lower input data to n- (mn) -1) bits and reassigning the upper input data to the next lower (mn) bits. Second data composition And a stage.
[0020]
Further preferably, the first bit length extension means or the second bit length extension means in the bit length extension device of the present invention bit-shifts the n-bit input data in one direction (mn) times. First variable generating means for generating a first variable; second variable generating means for generating a second variable obtained by bit-shifting the n-bit input data in the other direction (n- (mn)) times; First logic synthesizing means for generating m-bit output data from the logical sum of the first variable and the second variable;
[0021]
Further preferably, the second bit length extension means in the bit length extension device of the present invention obtains (n−1) -bit data from the second most significant bit next to the most significant bit of the n-bit input data. Third variable generation means for generating a third variable bit-shifted (mn) times in one direction, and the (n-1) -bit data in the other direction (n- (mn) -1) A fourth variable generating means for generating a fourth variable that has been bit-shifted times, and m-1 bit data is generated from the logical sum of the third variable and the fourth variable, And second logic synthesis means for generating m-bit output data by adding the most significant bit input data as the most significant bit data.
[0022]
The data processing apparatus according to the present invention performs data processing on at least one of the input data and the output data of the bit length extension apparatus according to any one of claims 1 to 6, thereby achieving the above object.
[0023]
The bit length extension method of the present invention is a bit length extension method for extending digital data of n (n is a positive integer) bit length to digital data of m bits (m is an integer of m> n). Of the m-bit data, all n-bit data of the original data is assigned to the upper n bits, and the upper (mn) bit data of the original data is reassigned to the lower (mn) bits. There is a first bit length extension step for generating bit data, whereby the above object is achieved.
[0024]
According to the bit length extension method of the present invention, digital data of n (n is a positive integer) bit length in which sign information is included in the most significant bit is converted to digital data of m bits (m is an integer of m> n) length. In the extended bit length method, all n bits of the original data are assigned to the upper n bits of the m bits of data, and the next most significant bit of the original data is assigned to the lower (mn) bits. A second bit length extension step for generating m-bit data by allocating data from the second most significant bit to the upper (mn) bits, thereby achieving the above object. .
[0025]
Preferably, in the bit length extension method of the present invention, in the first bit length extension step or the first bit length extension step, the n-bit input data is bit-shifted in one direction (mn) times. A first variable generating step for generating a first variable; a second variable generating step for generating a second variable obtained by bit-shifting the n-bit input data in the other direction (n- (mn)) times; A first logic synthesis step of generating m-bit data from the logical sum of the first variable and the second variable.
[0026]
Furthermore, it is preferable that the second bit length extension step in the bit length extension method of the present invention includes data from the second most significant bit to the (n−1) bits after the most significant bit of the n-bit input data. A third variable generating step for generating a third variable obtained by bit-shifting (mn) times in one direction, and (n- (mn) -1 in the other direction. ) A fourth variable generating step for generating a fourth variable bit-shifted times, and m-1 bit data is generated from the logical sum of the third variable and the fourth variable, and the most significant of the m-1 bit And a second logic synthesis step for generating m-bit data by adding the input data of the most significant bit as the most significant bit data.
[0027]
The control program of the present invention is for causing a computer to execute the steps of the bit length extension method according to any one of claims 8 to 11, thereby achieving the above object.
[0028]
The readable recording medium of the present invention is readable by a computer in which the control program according to claim 12 is recorded, whereby the above object is achieved.
[0029]
The operation of the present invention will be described below with the above configuration.
[0030]
In the present invention, as shown in FIG. 2, when data Dn having a bit length n is extended to data Dm having a bit length m larger than n, compensation is required (mn). ) By assigning the upper (mn) bits of Dn to the lower bits of the bits, it is possible to generate m-bit data Dm without performing complicated processing as in the prior art. .
[0031]
Further, when Dn is the maximum value, Dm is also the maximum value, and when Dn is the minimum value, Dm is also the minimum value. Therefore, all of the shortage of (mn) bits is compensated with “1” or “0”. The error can be greatly reduced compared to the technology.
[0032]
When sign information is included in the most significant bit of the n-bit data, the lower (mn) bits that need to be compensated are changed from the second most significant bits except the most significant bit of the original data ( mn) bits can be allocated.
[0033]
DETAILED DESCRIPTION OF THE INVENTION
The case where the bit length extension device of the present invention is applied to a data processing device as Embodiments 1 to 3 will be described below with reference to the drawings.
[0034]
(Embodiment 1)
In the first embodiment, an example in which the present invention is realized by hardware (bit length extension circuit) as a bit length extension device will be described.
[0035]
FIG. 1 is a block diagram showing the main configuration of the data processing apparatus according to the first embodiment of the present invention.
[0036]
In FIG. 1, the data processing apparatus 100 has a first bit length that extends digital data of n (n is a positive integer) bit length to digital data of m bits (m is an integer of m> n) length. A bit length extension circuit 10 as extension means, and a data processing unit 5 that performs various data processing on the output data with the bit length extended from the bit length extension circuit 10 are provided. As the data processing apparatus 100 of the present invention, for example, in audio equipment, digital data of 10-bit gradation (in the present invention, n = 10) output from an old-style device is converted to the latest 16-bit gradation (m = And a data converter for inputting to a device corresponding to 16).
[0037]
The bit length extension circuit 10 includes an input circuit 1, a separation circuit 2 as first data separation means, a synthesis circuit 3 as first data synthesis means, and an output circuit 4 that outputs output data with bit length extended. Among the m-bit data, all n-bit data of the original data is assigned to the upper n bits, and the upper (mn) bits of the original data are assigned to the lower (mn) bits. The m-bit output data is generated by reassigning the data.
[0038]
The input circuit 1 receives input data Dn having a bit length n (n is a positive integer) from the outside and outputs it.
[0039]
The separation circuit 2 separates the input data Dn into upper input data Dn1 having a bit length (mn) and lower input data Dn2 having a bit length (n- (mn)). Here, m is a positive number with m> n.
[0040]
In the synthesis circuit 3, the upper input data Dn1 is assigned to the upper (mn) bits, the lower input data Dn2 is assigned to the next (n- (mn)) bits, and further as shown in FIG. The upper input data Dn1 is reassigned to the lower (mn) bits to generate output data Dm having a bit length m.
[0041]
The output unit 4 outputs data Dm extended from the synthesis circuit 3 to the bit length m (m is an integer of m> n).
[0042]
With the above configuration, the operation of the bit length extending apparatus 10 when the bit length of the input data Dn not including the code information is 8 and the bit length Dm of the output data is 15 will be described with reference to FIG. .
[0043]
As shown in FIG. 3A, first, the input data Dn having a bit length n = 8 is (mn) = 15−8 = higher input data having a bit length of 7 and a bit length (n− (mn)). ) = 8−7 = 1 is divided into low-order input data Dn2 of 1 bit length.
[0044]
Next, the upper input data Dn1 is assigned to the upper (mn) = 7 bits, the lower input data Dn2 is assigned to the next (n- (mn)) = 1 bit, and the upper input data Dn1 is reassigned to the lower order (mn) = 7 bits, and output data Dm having a bit length m = 15 is generated.
[0045]
As described above, according to the first embodiment, when the bit length n is extended to the data Dm having a bit length m larger than n, the (m−n) bits that need to be compensated are used. By assigning the upper (mn) bits of the data Dn to the lower bits, respectively, the m-bit data Dm can be easily generated without performing complicated processing as in the prior art. In this case, when the input data Dn is the maximum value, Dm is also the maximum value, and when the input data Dn is the minimum value, the Dm is also the minimum value. Therefore, all of the shortage of (mn) bits is “1” or “ The error can be greatly reduced as compared with the conventional technique which compensates for “0”.
[0046]
Further, when the bit length extension circuit 10 of the first embodiment is mounted on the data processing apparatus 100, if the sign information (information indicating positive or negative) is fixed to any one, the separation circuit 2 and the synthesis circuit It is possible to realize the operation 3 with only simple wiring.
[0047]
(Embodiment 2)
In the first embodiment, the case has been described where the sign information is not included in the most significant bit of the input data. However, in the present embodiment 2, the sign information (information indicating positive or negative) is included in the most significant bit of the input data. The case where is included will be described. 1 will be described in common.
[0048]
In FIG. 1, the data processing apparatus 100A has a second bit length that extends n (n is a positive integer) bit length digital data to m bit (m is an integer of m> n) length. A bit length extension circuit 10A as an extension means and a data processing unit 5 are provided.
[0049]
The bit length extension circuit 10A includes an input circuit 1, a separation circuit 2A as second data separation means, a synthesis circuit 3A as second data synthesis means, and an output circuit 4 that outputs output data with the bit length extended. Of the m-bit data, all n-bit data of the original data is assigned to the upper n bits, and the next (mn) bits are the next bits after the most significant bit of the original data. By assigning data from the 2nd bit to the upper (mn) bits, m-bit output data is generated.
[0050]
In the separation circuit 2A, the input data Dn having the bit length n is the most significant input data Dn0 composed of the most significant bits indicating the code information, and the bit length (mn) bits from the second most significant bits excluding the most significant bits. Are separated into the higher-order input data Dn1 and the lower-order input data Dn2 having a bit length (n− (mn) −1).
[0051]
In the combining circuit 3A, the most significant input data (code information) is assigned to the most significant bit, and the upper input data Dn1 is assigned from the second most significant bit to the most significant (mn) bits. The input data Dn2 is assigned to the next (n- (mn) -1) bits, and the upper input data Dn1 is reassigned to the lower (mn) bits, and the sign information is assigned to the most significant bits. Output data having a bit length m is generated.
[0052]
With reference to FIG. 3B, an example of the operation of the bit length extension circuit when the bit length of input data including code information is 8 and the bit length of output data is 15 will be described with reference to FIG.
[0053]
As shown in FIG. 3B, the input data Dn having the bit length n = 8 in which the sign information is included in the most significant bit is the most significant input data Dn0 composed of the most significant bit indicating the sign information s, the most significant bit. From the second bit excluding the bits, the bit length (mn) = 15-8 = 7 bits of high-order input data Dn1, and the bit length (n- (mn) -1) = 8-8 = 0 Separated into lower input data Dn2. In this example, the lower-order input data Dn2 is 0 bit and is not shown in FIG.
[0054]
The most significant input data (code information) is assigned to the most significant bit, the upper input data Dn1 is assigned from the second most significant bit excluding the most significant bit to the upper (mn) = 7 bits, and the lower input data Dn2 is The next (n− (mn) −1) = 0 bit is assigned, and the higher order input data Dn1 is further assigned to the next lower order (mn) = 7 bits. Output data Dm having a bit length m including code information s.
[0055]
As described above, according to the bit length extension device 10A of the second embodiment, when the most significant bit of n-bit data includes the sign information s, the lower (mn) bits that need to be compensated are Higher order (mn) bits can be assigned from the second most significant bits excluding the most significant bit of the original data. Also in this case, when the input data Dn is the maximum value, all the higher-order input data is “1”, so the output data Dm is also the maximum value. Further, when the input data Dn is the minimum value, all the higher-order input data is “0”, so the output data Dm is also the minimum value. Therefore, the conversion error can be reduced without performing complicated processing as in the prior art.
[0056]
In the first and second embodiments, the case where the bit length extension devices 10 and 10A of the present invention are realized by hardware (bit length extension circuit) has been described. However, the present invention is not limited to this, and software (control program) is used. Also, the functions of the first and second embodiments can be realized.
[0057]
Next, a third embodiment of the bit length extension device of the present invention by software will be described.
[0058]
(Embodiment 3)
FIG. 4 is a block diagram showing the main configuration of the data processing apparatus according to the third embodiment of the present invention.
[0059]
In FIG. 4, the data processing device 20 is constituted by a computer, and performs data processing on at least one of the bit length extending device for performing the bit length extending processing of the present invention and the input data and output data of the bit length extending device. It has a function with a data processing unit that applies
[0060]
The bit length extension device includes a ROM 21 and a RAM 22 as storage units for storing various data, and an input unit 23 that allows a user to input various operation commands and data (including received data in addition to operation input data). And an output unit 24 that displays various images, prints out data, and transmits data, and a control unit 25 that controls each unit and performs the bit length extension processing of the present invention.
[0061]
The ROM 21 stores a control program for bit length extension control processing and its data. The control program and its data can be downloaded from a readable recording medium such as a CD (optical disc) or DVD via an interface (not shown).
[0062]
The RAM 22 functions as a work memory when the control unit 25 operates.
[0063]
The control unit 25 is composed of a CPU (central processing unit) of a computer, and based on a control program for bit length extension control processing, input data Dn having a bit length n is converted to data having a bit length m larger than n. When the bit is extended to Dm, m bits of output data Dm are generated by assigning the upper (mn) bits of the input data Dn to the lower bits of the (mn) bits that need to be compensated. Control is made. The function of the data processing unit is also executed by the control unit 25.
[0064]
Specifically, the control unit 25 includes first variable generation means for generating a first variable obtained by bit-shifting n-bit input data in one direction (m−n) times, and n-bit input data in the other direction. Second variable generating means for generating a second variable bit-shifted (n− (m−n)) times and a first variable for generating m-bit output data from the logical sum of the first variable and the second variable. 1 logic synthesis means.
[0065]
The control program executed by the control unit 25 includes a first variable generation step for generating a first variable obtained by bit-shifting n-bit input data in one direction (m−n) times, and n-bit input data. A second variable generating step for generating a second variable bit-shifted (n− (m−n)) times in the direction, and a first variable for generating m-bit data from the logical sum of the first variable and the second variable. 1 logic synthesis step.
[0066]
Hereinafter, the operation of the above configuration will be described with reference to FIG.
[0067]
FIG. 5A is a diagram showing numerical values and variables as data used in the control unit 25 in FIG. 4, and FIG. 5B is a flowchart showing a bit length extension processing procedure executed by the control unit 25 in FIG. is there.
[0068]
A bit operation / arithmetic processing is performed on an input value Dn that does not include sign information s whose effective bit length n (n is a positive integer) is known in advance. By assigning n bits and reassigning the upper (mn) bits of the original data to the lower (mn) bits, the number of effective bits m (m is a positive integer with m> n) is revealed. A case where an output value (return value) Dm that does not include the encoded code information s is generated will be described. Variables A and B having a bit length sufficiently larger than the return value Dm are prepared in advance. In FIG. 5A, it is assumed that variables A and B having a bit length of 32 are prepared for n = 15 and m = 24.
[0069]
As shown in FIG. 5B, first, in step S1, a 15-bit input value Dn is assigned to variables A and B, respectively.
[0070]
Next, in step S2, a bit operation of left shift (shift in one direction) is performed (m−n) times for the variable A. In the example of FIG. 5A, the variable A is shifted left by (mn) = 24-15 = 9 bits.
[0071]
Similarly, in step S3, the bit operation of the right shift (shift in the other direction) is performed (n− (mn)) times for the variable B. At this time, the bits pushed out from the LSB are discarded. In this example, the variable B is right shifted by (n− (mn)) = 15− (24−15) = 6 bits, and the 6 bits pushed out from the LSB are discarded.
[0072]
Finally, in step S4, a logical sum of the variable A and the variable B is calculated. That is, by assigning the variable B to the variable A, a return value Dm as desired output data is generated. In this example, a 24-bit return value Dm is generated.
[0073]
Even if the input value Dn and the return value Dm include the sign information s, if the most significant bit is the sign information s, there is no change in the position. However, it may be performed as follows.
[0074]
That is, although detailed explanation is omitted here, before the input value Dn is substituted into the variables A and B in step S1, the most significant bit indicating the sign information is saved, and the most significant bit of the input value Dn is changed. The data from the second most significant bit to (n−1) bits is substituted into variables A and B.
[0075]
Next, in step S2, the left shift bit operation is performed (m−n) times for the variable A (third variable generation step; third variable generation means), and in step S3, the right shift bit is set for the variable B. The operation is performed (n- (mn) -1) times (fourth variable generation step; fourth variable generation means).
[0076]
Finally, in step S4, a logical sum of the variable A and the variable B is calculated (second logic synthesis step; second logic synthesis means). Also in this case, the return value Dm including the code information s at the highest order can be generated by assigning the variable B to the variable A and adding the saved most significant bit to the highest order.
[0077]
In the third embodiment, the case where the bit length extending apparatus of the present invention is realized by software (control program) has been described. However, the present invention is not limited to this, and the third embodiment is also implemented by hardware (bit length extending circuit). The function can be realized.
[0078]
As described above, according to the first to third embodiments, when the input data Dn having the bit length n is bit-extended to the output data Dm having the bit length m larger than n, the lower order of the output data Dm that needs to be compensated By assigning the upper (mn) bits of the input data Dn to the (mn) bits, m-bit output data Dm can be generated without performing complicated processing. If the most significant bit of the input data Dn includes the sign information s, the second (excluding the most significant bit) is excluded from the lower (mn) bits of the input data Dn that need to be compensated. Higher order (mn) bits can be assigned from the higher order data. In this way, when digital data with an n-bit length is expanded to data with an m-bit length (m> n), the lower (mn) bit-length data is reduced by an easy bit-length extension process. Can be compensated by conversion error.
[0079]
【The invention's effect】
As described above, according to the present invention, it is possible to generate data with a bit length suitable for each use environment by performing a bit length extension process of a digital signal with a minimum conversion error by a simple process. .
[Brief description of the drawings]
FIG. 1 is a block diagram showing a main configuration of Embodiments 1 and 2 of a data processing apparatus according to the present invention.
FIG. 2 is a diagram for explaining a basic principle of the present invention.
FIG. 3A is a diagram illustrating an example of data processing when code information is not included, and FIG. 3B is a diagram illustrating an example of data processing when code information is included.
FIG. 4 is a block diagram showing the main configuration of a data processing apparatus according to a third embodiment of the present invention.
5A is a diagram showing numerical values and variables used in the control unit of FIG. 4, and FIG. 5B is a flowchart showing a bit length extension processing procedure by the control unit of FIG. 4;
6A is a diagram for explaining a conventional processing example when the bit length is reduced, and FIG. 6B is a diagram for explaining a conventional processing example when the bit length is extended.
FIG. 7 is a diagram for explaining a problem of a conventional bit length extension method.
[Explanation of symbols]
1 Input circuit
2, 2A separation circuit
3, 3A synthesis circuit
4 Output circuit
10, 10A bit length expansion device
100, 100A, 200 Data processing device
21 ROM
22 RAM
23 Input section
24 Output unit
25 Control unit

Claims (13)

n(nは正の整数)ビット長のデジタルデータを、mビット(mは、m>nの整数)長のデジタルデータに拡張するビット長拡張装置において、
該mビットのデータのうち、上位nビットには元のデータの全nビットデータを割り当て、下位(m−n)ビットには元のデータの上位(m−n)ビットデータを再度割り当てることによりmビットの出力データを生成する第1のビット長拡張手段を有するビット長拡張装置。
In a bit length extension device that extends digital data of n (n is a positive integer) bit length to digital data of m bits (m is an integer of m> n) length,
Of the m-bit data, all n-bit data of the original data is assigned to the upper n bits, and the upper (mn) bit data of the original data is reassigned to the lower (mn) bits. A bit length extension device comprising first bit length extension means for generating m-bit output data.
最上位ビットに符号情報が含まれるn(nは正の整数)ビット長のデジタルデータを、mビット(mは、m>nの整数)長のデジタルデータに拡張するビット長拡張装置において、
該mビットのデータのうち、上位nビットには元のデータの全nビットデータを割り当て、下位(m−n)ビットには元のデータの最上位ビットの次の第2位のビットから上位(m−n)ビットまでのデータを割り当てることによりmビットの出力データを生成する第2のビット長拡張手段を有するビット長拡張方法。
In a bit length extension device that extends digital data of n (n is a positive integer) bit length including sign information in the most significant bit to digital data of m bits (m is an integer of m> n),
Among the m-bit data, all n-bit data of the original data is assigned to the upper n bits, and the lower (mn) bits are higher than the second most significant bit of the original data. A bit length extension method comprising second bit length extension means for generating m-bit output data by allocating data up to (mn) bits.
前記第1のビット長拡張手段は、
前記nビットの入力データを、ビット長(m−n)ビットの上位入力データおよびビット長(n−(m−n))の下位入力データに分離する第1のデータ分離手段と、
該mビットのデータのうち、上位(m−n)ビットには該上位入力データを割り当て、その次の(n−(m−n))ビットには該下位入力データを割り当て、更にその次の下位(m−n)ビットには該上位入力データを再度割り当てることによりmビットの出力データを生成する第1のデータ合成手段とを有する請求項1に記載のビット長拡張装置。
The first bit length extension means includes
First data separation means for separating the n-bit input data into upper input data having a bit length (mn) bits and lower input data having a bit length (n- (mn));
Among the m-bit data, the upper input data is assigned to the upper (mn) bits, the lower input data is assigned to the next (n- (mn)) bits, and the next 2. The bit length extension device according to claim 1, further comprising: first data synthesis means for generating m-bit output data by reassigning the higher-order input data to the lower-order (mn) bits.
前記第2のビット長拡張手段は、
前記nビットの入力データを、最上位ビットの最上位入力データ、該最上位ビットの次の第2位のビットからビット長(m−n)ビットまでの上位入力データ、およびビット長(n−(m−n)−1)の下位入力データに分離する第2のデータ分離手段と、
前記mビットのデータのうち、該最上位ビットには該最上位入力データを割り当て、該最上位ビットの次の第2位のビットから上位(m−n)ビットには該上位入力データを割り当て、その次の(n−(m−n)−1)ビットには該下位入力データを割り当て、更にその次の下位(m−n)ビットには該上位入力データを再度割り当てることによりmビットの出力データを生成する第2のデータ合成手段とを有する請求項2に記載のビット長拡張装置。
The second bit length extension means includes
The n-bit input data includes the highest-order input data of the most significant bit, the higher-order input data from the second most significant bit to the bit length (mn) bits, and the bit length (n− (Mn) -1) second data separating means for separating the lower input data;
Of the m-bit data, the most significant input data is allocated to the most significant bit, and the most significant (mn) bits are allocated to the most significant (mn) bits after the second most significant bit. The lower input data is assigned to the next (n- (mn) -1) bits, and the upper input data is reassigned to the next lower (mn) bits. The bit length extension device according to claim 2, further comprising second data synthesis means for generating output data.
前記第1のビット長拡張手段または第2のビット長拡張手段は、
前記nビットの入力データを一方向に(m−n)回ビットシフトさせた第1変数を生成する第1変数生成手段と、
該nビットの入力データを他方向に(n−(m−n))回ビットシフトさせた第2変数を生成する第2変数生成手段と、
該第1変数と第2変数の論理和からmビットの出力データを生成する第1論理合成手段とを有する請求項1または2に記載のビット長拡張装置。
The first bit length extending means or the second bit length extending means is:
First variable generating means for generating a first variable obtained by bit-shifting the n-bit input data in one direction (m−n) times;
Second variable generation means for generating a second variable obtained by bit-shifting the n-bit input data (n- (mn)) times in the other direction;
3. The bit length extending apparatus according to claim 1, further comprising: a first logic synthesis unit that generates m-bit output data from a logical sum of the first variable and the second variable.
前記第2のビット長拡張手段は、
前記nビットの入力データの最上位ビットの次の第2位のビットから(n−1)ビットのデータを一方向に(m−n)回ビットシフトさせた第3変数を生成する第3変数生成手段と、
該(n−1)ビットのデータを他方向に(n−(m−n)−1)回ビットシフトさせた第4変数を生成する第4変数生成手段と、
該第3変数と第4変数との論理和からm−1ビットのデータを生成し、該m−1ビットの最上位に最上位ビットデータとして、該最上位ビットの入力データを付加してmビットの出力データを生成する第2論理合成手段とを有する請求項2に記載のビット長拡張装置。
The second bit length extension means includes
A third variable for generating a third variable obtained by bit-shifting (n−1) -bit data in one direction (mn) times from the second-most bit next to the most significant bit of the n-bit input data Generating means;
Fourth variable generating means for generating a fourth variable obtained by bit-shifting the (n-1) -bit data in the other direction (n- (mn) -1) times;
M-1 bit data is generated from the logical sum of the third variable and the fourth variable, and the most significant bit input data is added to the most significant bit of the m-1 bit as the most significant bit data. 3. The bit length extending device according to claim 2, further comprising second logic synthesis means for generating bit output data.
請求項1〜6の何れかに記載のビット長拡張装置の入力データおよび出力データのうち少なくともいずれかにデータ処理を施すデータ処理装置。A data processing device that performs data processing on at least one of input data and output data of the bit length extension device according to claim 1. n(nは正の整数)ビット長のデジタルデータを、mビット(mは、m>nの整数)長のデジタルデータに拡張するビット長拡張方法において、
該mビットのデータのうち、上位nビットには元のデータの全nビットデータを割り当て、下位(m−n)ビットには元のデータの上位(m−n)ビットデータを再度割り当てることによりmビットのデータを生成する第1のビット長拡張ステップを有するビット長拡張方法。
In a bit length extension method for extending n (n is a positive integer) bit length digital data to m bit (m is an integer of m> n) length,
Of the m-bit data, all n-bit data of the original data is assigned to the upper n bits, and the upper (mn) bit data of the original data is reassigned to the lower (mn) bits. A bit length extension method comprising a first bit length extension step for generating m-bit data.
最上位ビットに符号情報が含まれるn(nは正の整数)ビット長のデジタルデータを、mビット(mは、m>nの整数)長のデジタルデータに拡張するビット長拡張方法において、
該mビットのデータのうち、上位nビットには元のデータの全nビットデータを割り当て、下位(m−n)ビットには元のデータの最上位ビットの次の第2位のビットから上位(m−n)ビットまでのデータを割り当てることによりmビットのデータを生成する第2のビット長拡張ステップを有するビット長拡張方法。
In a bit length extension method of extending n (n is a positive integer) bit length digital data including sign information in the most significant bit to m bit (m is an integer of m> n) length,
Among the m-bit data, all n-bit data of the original data is assigned to the upper n bits, and the lower (mn) bits are higher than the second most significant bit of the original data. A bit length extension method including a second bit length extension step of generating m bits of data by allocating data up to (mn) bits.
前記第1のビット長拡張ステップまたは第1のビット長拡張ステップは、
前記nビットの入力データを一方向に(m−n)回ビットシフトさせた第1変数を生成する第1変数生成ステップと、
該nビットの入力データを他方向に(n−(m−n))回ビットシフトさせた第2変数を生成する第2変数生成ステップと、
該第1変数と第2変数の論理和からmビットのデータを生成する第1論理合成ステップとを有する請求項8または9に記載のビット長拡張方法。
The first bit length extension step or the first bit length extension step includes:
A first variable generating step for generating a first variable obtained by bit-shifting the n-bit input data in one direction (m−n) times;
A second variable generation step of generating a second variable obtained by bit-shifting the n-bit input data in the other direction (n- (mn)) times;
10. The bit length extension method according to claim 8, further comprising a first logic synthesis step of generating m-bit data from a logical sum of the first variable and the second variable.
前記第2のビット長拡張ステップは、
前記nビットの入力データの最上位ビットの次の第2位のビットから(n−1)ビットまでのデータを一方向に(m−n)回ビットシフトさせた第3変数を生成する第3変数生成ステップと、
該(n−1)ビットのデータを他方向に(n−(m−n)−1)回ビットシフトさせた第4変数を生成する第4変数生成ステップと、
該第3変数と第4変数との論理和からm−1ビットのデータを生成し、該m−1ビットの最上位に最上位ビットデータとして、該最上位ビットの入力データを付加してmビットのデータを生成する第2論理合成ステップとを有する請求項9に記載のビット長拡張方法。
The second bit length extension step includes:
A third variable is generated by shifting data from the second most significant bit next to the most significant bit of the n-bit input data to (n−1) bits in one direction (mn) times. Variable generation step;
A fourth variable generation step of generating a fourth variable obtained by bit-shifting the (n-1) -bit data in the other direction (n- (mn) -1) times;
M-1 bit data is generated from the logical sum of the third variable and the fourth variable, and the most significant bit input data is added to the most significant bit of the m-1 bit as the most significant bit data. The bit length extending method according to claim 9, further comprising a second logic synthesis step of generating bit data.
請求項8〜11の何れかに記載のビット長拡張方法のステップをコンピュータに実行させるための制御プログラム。The control program for making a computer perform the step of the bit length expansion method in any one of Claims 8-11. 請求項12に記載の制御プログラムが記録されたコンピュータ読み取り可能な可読記録媒体。A computer-readable readable recording medium on which the control program according to claim 12 is recorded.
JP2003171370A 2003-06-16 2003-06-16 Bit length extension device, data processing device, bit length extension method, control program, and readable recording medium Expired - Fee Related JP4063723B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003171370A JP4063723B2 (en) 2003-06-16 2003-06-16 Bit length extension device, data processing device, bit length extension method, control program, and readable recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003171370A JP4063723B2 (en) 2003-06-16 2003-06-16 Bit length extension device, data processing device, bit length extension method, control program, and readable recording medium

Publications (2)

Publication Number Publication Date
JP2005012284A true JP2005012284A (en) 2005-01-13
JP4063723B2 JP4063723B2 (en) 2008-03-19

Family

ID=34095862

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003171370A Expired - Fee Related JP4063723B2 (en) 2003-06-16 2003-06-16 Bit length extension device, data processing device, bit length extension method, control program, and readable recording medium

Country Status (1)

Country Link
JP (1) JP4063723B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009276399A (en) * 2008-05-12 2009-11-26 Kenwood Corp Sound quality adjusting method and device
JP2010244594A (en) * 2009-04-02 2010-10-28 J&K Car Electronics Corp Bit extension device, method, and program
JP2010268446A (en) * 2009-04-13 2010-11-25 Panasonic Corp Digital data processor

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009276399A (en) * 2008-05-12 2009-11-26 Kenwood Corp Sound quality adjusting method and device
JP2010244594A (en) * 2009-04-02 2010-10-28 J&K Car Electronics Corp Bit extension device, method, and program
JP2010268446A (en) * 2009-04-13 2010-11-25 Panasonic Corp Digital data processor

Also Published As

Publication number Publication date
JP4063723B2 (en) 2008-03-19

Similar Documents

Publication Publication Date Title
JP2819006B2 (en) Thermometer binary encoding method
JP5366363B2 (en) Method and apparatus for transcoding N-bit words into M-bit words with M less than N
WO2006012493A1 (en) High-order delta-sigma noise shaping in direct digital frequency synthesis
JPH07105724B2 (en) Digital-analog conversion circuit
JP4063723B2 (en) Bit length extension device, data processing device, bit length extension method, control program, and readable recording medium
JP5935824B2 (en) D / A converter
JP3956582B2 (en) A / D conversion circuit
JPS61159827A (en) Digital-to-analog converter
JP4344948B2 (en) DDS circuit
JP5652873B2 (en) Digital-to-analog converter and control method thereof
US7003544B1 (en) Method and apparatus for generating a squared value for a signed binary number
JP2004056822A (en) Quantization error compensation device and method therefor
JP2001077692A (en) D/a converting circuit
JP3611359B2 (en) EFM modulator
JPH05308286A (en) D/a converter
JP2692289B2 (en) Arbitrary waveform generator
JPS62230120A (en) Digital-analog converting method
JP3427651B2 (en) Arithmetic coding apparatus and flash processing method thereof
KR20230057629A (en) A pre-emphasis circuit using signed bit subtractor and bit optimization
JP4505751B2 (en) Waveform data converter
JP2004180017A (en) Program for quantization bit extending
JPH07249990A (en) Digital/analog signal converter
JP2004247930A (en) Delta sigma type multi-bit a/d converter, optical disk recorder/reproducer using the same, and downsampling method
JPH08256061A (en) D/a converter
JPH06342367A (en) Multiplying circuit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050810

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070518

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070523

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070720

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070925

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071024

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20071204

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: 20071225

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071225

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110111

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120111

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130111

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130111

Year of fee payment: 5

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: R3D04

LAPS Cancellation because of no payment of annual fees