JP2004229184A - Method and device for encoding time-series signal - Google Patents

Method and device for encoding time-series signal Download PDF

Info

Publication number
JP2004229184A
JP2004229184A JP2003017224A JP2003017224A JP2004229184A JP 2004229184 A JP2004229184 A JP 2004229184A JP 2003017224 A JP2003017224 A JP 2003017224A JP 2003017224 A JP2003017224 A JP 2003017224A JP 2004229184 A JP2004229184 A JP 2004229184A
Authority
JP
Japan
Prior art keywords
error
encoding
sample
prediction error
time
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
JP2003017224A
Other languages
Japanese (ja)
Other versions
JP4139697B2 (en
Inventor
Toshio Motegi
敏雄 茂出木
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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2003017224A priority Critical patent/JP4139697B2/en
Publication of JP2004229184A publication Critical patent/JP2004229184A/en
Application granted granted Critical
Publication of JP4139697B2 publication Critical patent/JP4139697B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a method and a device for encoding a time-series signal in which more highly efficient compression can be executed by selecting the optimum method as needed in accordance with fluctuations of signal characteristics in the time-series signal. <P>SOLUTION: An estimated error is calculated by a plurality of estimating calculation formulas, which are prepared beforehand, for each sample of the time-series signal consisting of sample sequences in time-series (S1). The estimated error to become an object for encoding is selected by utilizing an accumulated error in each estimating calculation expression (S2). After updating the accumulated error (S3), the accumulated error is re-set whenever the number of the samples exceed a prescribed number (S4, S5). The estimated error, which is optimum for each sample, can be obtained by executing the processing repeatedly. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【産業上の利用分野】
本発明は、音楽制作、音響データの素材保管、ロケ素材の中継など音楽制作分野、特にCDよりも品質の高い高精細オーディオ制作を行う分野、CD、DVD等のデジタル記録媒体を用いたオーディオ記録再生分野、遠隔医療における生体信号の伝送等、データの改変が嫌われる分野等において好適なデータの可逆圧縮技術に関する。
【0002】
【従来の技術】
従来より、音響信号の圧縮には様々な手法が用いられている。音響信号を圧縮して符号化する手法として、MP3(MPEG−1/Layer3)、AAC(MPEG−2/Layer3)などが実用化されている。このような圧縮符号化方式により、音響信号を小さいデータとして扱うことが可能となり、データの記録・伝送の効率化に貢献している。
【0003】
上述のようなMP3、AAC等はいずれもロッシー符号化方式といわれるものであり、効率的な圧縮が可能であるが、復号化にあたって、少なからず品質の劣化を伴い、原信号を完全に再現することはできない。そのため、音楽制作、素材保管、ロケ素材の中継など音楽制作分野では、これらの符号化方式を適用できず、非効率ではあるが、非圧縮で保存・伝送する方式がとられている。特に最近は高精細オーディオを扱うプロダクションが増え、素材容量が膨大になり、ワークディスクを管理する上で問題になってきていた。
【0004】
最近では、上記問題を解決するため、音響信号を可逆圧縮符号化する方法として、予測符号化を利用し、予測誤差のデータを出現頻度に応じた符号化処理と組み合わせたものも提案されている(例えば、特許文献1参照)。
【0005】
また、本出願人も、音響信号のサンプル列に対してチャンネル間、フレーム間の差分演算を行って、各サンプルの値を小さくした後、予測符号化を利用してデータの圧縮を行う技術について提案している。(特許文献2参照)。
【0006】
【特許文献1】
特開2002−278600号公報
【特許文献2】
特願2002−231150号
【0007】
【発明が解決しようとする課題】
しかしながら、上記特許文献1、特許文献2で提案した技術では、予測の方式が1つに限定されている。例えば、特許文献2に記載の技術では、過去2サンプルに基づく予測符号化を提案している。過去2サンプルに基づく予測符号化が適用できるコンテンツのジャンルは最も広いが、変化が緩やかなコンテンツは過去1サンプル、変化が激しいコンテンツは過去3サンプル以上に基づいて予測符号化を行った方が予測誤差が小さくなることが確認されている。そこで、複数の計算式を準備しておき、コンテンツに合わせて適切なものを選択する方式もとれるが、コンテンツ全体が均一な性質をもっていないと圧縮効果が得られず、特にヴォーカルやミックスされた音楽では、圧縮効率が低下するという問題がある。
【0008】
また、特許文献2で提案した内容では、あらかじめ設定した圧縮困難な固定ビット長の量子化雑音成分を可変長符号化対象から分離する手法をとっていた。このときの固定ビット長は、A/D変換器のビット精度や、オーディオ収録時の条件などに依存してコンテンツごとに異なるため、随時最適な値を設定する必要がある。さらに、コンテンツ内においても信号振幅の変化により最適な固定ビット長が変化することが判明し、一律に処理すると圧縮効果が低下するという問題がある。
【0009】
上記のような点に鑑み、本発明は、時系列信号内の信号特性の変化に伴って、随時最適な方式を選択していくことにより、より効率の高い圧縮を行うことが可能であると共に、復号時には、元の時系列信号を完全に復号することが可能な時系列信号の符号化方法および装置を提供することを課題とする。
【0010】
【課題を解決するための手段】
上記課題を解決するため、本発明では、時系列のサンプル列で構成される時系列信号に対して、前記全てのサンプル列を再現できるように情報量を圧縮する符号化方法として、前記サンプル列の各サンプルに対して、時間的に過去のサンプル列から、複数の予測計算式に基づいて複数の予測誤差値を算出する予測誤差算出段階、過去のサンプル列の予測誤差値の各予測計算式別の累積値である累積誤差に基づいて、前記予測誤差算出段階で算出された複数の予測誤差値の中から、符号化対象の予測誤差値として1つを選択する符号化対象誤差選択段階、前記符号化対象として選択された予測誤差値を有する誤差サンプルに対して可変長符号で符号化を行う可変長符号化段階を有し、前記予測誤差算出段階、符号化対象誤差選別段階、可変長符号化段階を全サンプルについて実行するようにしたことを特徴とする。
【0011】
本発明によれば、各サンプルについて、複数の予測計算式に基づいて複数の予測誤差値を算出し、過去のサンプル列に対する各計算式別の累積予測誤差が最小となる計算式の予測誤差を、そのサンプルの予測誤差として選出するようにしたので、時間の変化に伴う信号波形の変化に応じて、最適な計算式に基づいて予測誤差を算出するようにしたので、より効率の高い圧縮を行うことが可能となる。
【0012】
【発明の実施の形態】
以下、本発明の実施形態について図面を参照して詳細に説明する。
(時系列信号の構成)
まず、本発明で符号化対象とする時系列信号について説明する。ここでは、時系列信号として複数のチャンネルを有する音響信号の場合を例にとって説明する。まず、時系列信号であるアナログの音響信号をデジタル化する。これは、従来の一般的なPCMの手法を用い、所定のサンプリング周波数でこのアナログ音響信号をサンプリングし、振幅を所定の量子化ビット数を用いてデジタルデータに変換する処理を行えば良い。本実施形態では、サンプリング周波数44.1KHz、量子化ビット数16ビットで正負の符号を記録した場合を想定して以降説明する。サンプリング周波数44.1KHzでサンプリングすると、1秒あたり44100個のサンプルにより構成されるサンプル列ができることになる。図1に、先頭からの所定数のサンプルを模式的に示す。図1において横軸は時刻t、縦軸は振幅x(t)を示す。図1において、t−4〜t+5の数字は各サンプルのサンプル番号を示しており、上述のように44.1KHzでサンプリングすると、この10サンプルは、1/4410秒に相当する。なお、ここでは、サンプル番号と時刻を同義で用いている。これは、サンプル番号が時刻の変化に伴って昇順に付与されており、時刻にサンプリング周波数を乗じた値がサンプル番号となるためである。また、図1において各サンプル番号から延びる線分は振幅値を示しているが、この振幅値は、上述のように量子化ビット数16ビットで正負の符号を記録した場合、−32768〜32767の値をとることになる。
【0013】
(処理概要)
続いて、上記のような時系列信号に対する符号化処理について説明していく。まず、最初に、適応型線形予測符号化を行う。適応型線形予測符号化の処理概要を図2のフローチャートに示す。図2において、まず、あらかじめ準備された複数の予測計算式を用いて、各予測計算式に対応した線形予測誤差を算出する(ステップS1)。具体的には、サンプル番号tの予測誤差を算出する予測計算式として、以下の〔数式1〕〜〔数式4〕を用意している。
【0014】
〔数式1〕
e1(t)=x(t)−x(t−1)−e1(t−1)/2
【0015】
〔数式2〕
e2(t)=x(t)−2×x(t−1)+x(t−2)−e2(t−1)/2
【0016】
〔数式3〕
e3(t)=x(t)−3×x(t−1)+3×x(t−2)−x(t−3)−e3(t−1)/2
【0017】
〔数式4〕
e4(t)=x(t)−4×x(t−1)+6×x(t−2)−4×x(t−3)+x(t−4)−e4(t−1)/2
【0018】
上記〔数式1〕〜〔数式4〕において、e1(t)〜e4(t)は各予測計算式による時刻tのサンプルにおける予測誤差であり、x(t)〜x(t−4)は時刻t〜t−4における振幅値である。
【0019】
上記〔数式2〕における「2×x(t−1)−x(t−2)」、上記〔数式3〕における「3×x(t−1)−3×x(t−2)+x(t−3)」、上記〔数式4〕における「4×x(t−1)−6×x(t−2)+4×x(t−3)−x(t−4)」は過去の2〜4個のサンプルに基づく線形予測成分である。この線形予測成分、および、直前のサンプルにおいて算出された予測誤差「e1(t−1)/2」〜「e4(t−1)/2」(誤差フィードバック成分)を用いて時刻tにおける予測誤差e1(t)〜e4(t)を算出する。
【0020】
続いて、上記各予測計算式別の予測誤差値の絶対値の累積である累積誤差が最小となる線形予測誤差をそのサンプルの予測誤差として選出する(ステップS2)。ここでは、累積誤差という考え方を用いている。具体的には、各予測計算式〔数式1〕〜〔数式4〕により算出された予測誤差の過去のサンプルについての累積値をR1〜R4として設定する。そして、この累積誤差R1〜R4のうち、最小となるものに対応する予測誤差を選出する。例えば、R1〜R4のうち、R2が最小であったとする。この場合、〔数式2〕で算出された予測誤差e2(t)を符号化対象とする予測誤差e(t)として選出することになる。選出された予測誤差e(t)はサンプルの元の値x(t)と置き換えられて以降処理が行われることになる。元のサンプルと区別するために予測誤差e(t)を記録したサンプルを誤差サンプルと呼ぶことにする。
【0021】
続いて、累積誤差R1〜R4に各予測誤差e1(t)〜e4(t)の絶対値を加算する(ステップS3)。具体的には、以下の〔数式5〕に示すように、累積誤差値となる変数R1〜R4を更新していく。同時に、各サンプルの処理を行う度に、カウンタを1つづつ加算していく処理を行う。
【0022】
〔数式5〕
R1←R1+|e1(t)|
R2←R2+|e2(t)|
R3←R3+|e3(t)|
R4←R4+|e4(t)|
【0023】
続いて、カウンタが所定回数を超えたかどうかの判定を行う(ステップS4)。本実施形態では、この所定回数を100回として設定している。すなわち、カウンタが100を超えたかどうかの判定を行う。
【0024】
この結果、カウンタが100を超えていたら、累積誤差を半分にする(ステップS5)。具体的には、以下の〔数式6〕に示すように、累積誤差となる変数R1〜R4を2で除算する。同時に、カウンタを0にリセットする。すなわち、ここでのR1〜R4は純粋な意味での累積誤差ではなく、累積誤差の移動平均となっている。本実施形態では、直前の最大100サンプルまでは累積されるが、それ以前のものは半分になるように処理する。これにより、時間的に離れたサンプルの影響が小さくなるようにしている。
【0025】
〔数式6〕
R1←(R1)/2
R2←(R2)/2
R3←(R3)/2
R4←(R4)/2
【0026】
上記ステップS1〜ステップS5の処理を時系列信号中の全時刻全サンプルに渡って実行することにより、全サンプルの値が元の振幅値x(t)から対象誤差e(t)に置き換えられることになる。
【0027】
続いて、各誤差サンプルの正負極性処理を行う(ステップS6)。上記ステップS1〜ステップS5の処理により各サンプルの値は、振幅値から予測誤差に置き換えられたが、各サンプルのビット形式は、当初のままである。通常、コンピュータ等の計算機で演算される場合は、各データは32ビット単位で処理され、2の補数表現を用いて表現されている。これを、正負の符号付き絶対値表現に変換し、なおかつ、その絶対値部分を上位に1ビット移動させ、正負の符号ビットをLSB(最下位ビット)に移動させる。ステップS6によるビット構成の変換の様子を模式的に示すと図3のようになる。図3(a)は処理前のビット構成であり、図3(b)は処理後のビット構成である。このように正負の符号ビットをLSBに移動させるのは、後述するステップS7以降(可変長符号化)の処理で、各誤差サンプルのビット長を検出し易くするためである。
【0028】
ここからは、各誤差サンプルを可変長に変換する処理を行っていく。本実施形態におけるビット長変換は、一般にゴロム符号化と呼ばれる方式を採用している。具体的には、1サンプルを構成するビット成分を上位ビット成分と下位ビット成分に分け、下位ビット成分は変更を加えずそのままとし、上位ビット成分は、上位ビットだけを十進数変換した数値分のビット「0」を並べ、最後にセパレータビット「1」を加えた配列とする。例えば、8ビットのビット成分「00101000」を考えてみる。このとき、下位ビット成分を4ビットとすると、下位ビット成分は「1000」となる。上位ビットは「0010」であるため、これを十進数変換した「2」個分の「0」を配列して最後に「1」を加えた「001」に変換される。この結果、8ビットのビット列「00101000」は、7ビットのビット列「0011000」に変換されることになる。本実施形態では、変換の前後でビット成分を不変とする下位ビット成分のビット長を各サンプルで可変とするようにしている。
【0029】
以下、具体的に説明していく。図4は可変長符号化の概要を示すフローチャートである。まず、過去のサンプルのビット長の移動平均である平均ビット長Bfを算出する(ステップS7)。平均ビット長Bfは、過去のビット長の累積値である累積ビット長RBを、過去のサンプル数を基にしたカウンタCで除算することにより求められる。すなわち、Bf=RB/Cで算出される。累積ビット長RBは、初期状態では0であるので、t=1のサンプルを処理する場合には、t=1のサンプルのビット長Bd(t)を初期値として設定しておく。また、初期のカウンタC=1と設定する。
【0030】
続いて、時刻tにおけるサンプルのビット長Bd(t)を算出する(ステップS8)。t=2以降のサンプルについては、平均ビット長Bfの算出後、サンプルのビット長Bd(t)を算出する。このビット長Bd(t)は、上記ステップS6のようにビット構成の変換を行ったことにより算出し易くなっている。図3(b)に示したようなビット構成に変換したことにより、各サンプルのビット構成において先頭にビット「1」が出現したところからがビット長となる。次に、変更部のビット長Bvを算出する(ステップS9)。これは、上記誤差サンプルのビット長Bd(t)から平均ビット長Bfを減じることにより算出される。続いて、データの符号出力を行う(ステップS10)。具体的には、上位Bvビットを十進数変換した数値分だけ「0」を出力した後、セパレータビット「1」を出力し、下位Bfビットを不変部として出力する。符号出力は、ハードディスク、CD−R等の外部記憶装置への記録として行われることになる。次に、累積ビット長RBにビット長Bd(t)を加算する(ステップS11)。同時に、各誤差サンプルの処理を行う度に、カウンタCを1つづつ加算していく処理を行う。続いて、カウンタCが所定の数を超えたかどうかを判定する(ステップS12)。所定の数としては、ここでも100程度を設定している。そのため、カウンタが100を超えたかどうかを判断することになる。この結果、カウンタが100を超えていたら、累積ビット長RBを半分にする(ステップS13)。具体的には、累積ビット長となる変数RBを2で除算する。同時に、カウンタCを半分に1/2にする。
【0031】
上記のようにして、各サンプルについて可変ビット長での符号化が行われて行く。符号化により得られた可変長誤差サンプルは、符号データとして目的とする記録媒体に記録されることになる。なお、ステップS1〜ステップS13の処理について、説明の便宜上、図2の適応型線形予測と図4の可変長符号化に分けて説明したが、実際は、各サンプルについてステップS1〜ステップS13までの処理を並行して行うようにしている。すなわち、図1に示したようにステップS4、ステップS5の処理後、ステップS1に戻るのではなく、ステップS6〜ステップS13の処理を行った後、ステップS1に戻るようにしている。
【0032】
(他の圧縮方式との組み合わせ)
本発明は、上記説明の内容のみであっても十分に圧縮効果をあげることが可能であるが、他の圧縮方式と組み合わせることで、より高い効果を得ることができる。以下に、好ましい組み合わせについて説明する。ここでは、図5に示すようなステレオ音響信号に対して処理を行う場合を想定して説明する。図5(a)は、2チャンネルのステレオ音響信号を示しており、Ch1にL(左)信号、Ch2にR(右)信号が記録されている。また、図5(a)から(d)においては、左端が開始時刻であり、右端が終端時刻である。図1と比較すると、横軸の時間間隔を凝縮した形式で示している。図6は、本発明に他の方式を組み合わせた場合の全体の処理概要を示すフローチャートである。ここからは、図6に従って説明していく。
【0033】
(信号平坦部処理方式)
まず、デジタル音響信号であるサンプル列に対して、信号平坦部の処理を行う(ステップS21)。信号平坦部とは、同一の信号レベルが連続する部分のことをいう。特に信号レベルが「0」の無音部、および信号レベルの絶対値が最大の飽和部に現れることが多い。無音部は実際に無音であるか、音が非常に小さく記録されなかった場合に生じるが、飽和部は、信号の録音およびA/D変換の過程において生じる。無音部、飽和部またはそれ以外の同一信号レベルが連続する場合のいずれであっても、信号平坦部は、同一の信号レベルが所定の時間(所定のサンプル数)連続して記録される。このため、この部分は圧縮し易いデータになっている。具体的には、信号平坦部の先頭時刻位置と、同一信号レベルが続くサンプルの個数と、信号レベル(サンプル値)の3つの値を信号平坦部データとして各チャンネルのサンプル列と分離して記録する。各チャンネルのサンプル列からは、信号平坦部が削除される。これを模式的に示すと図5(b)(c)に示すようになる。図5(b)は、信号平坦部処理前のサンプル列である。図5(b)において、網掛けで示した部分は信号平坦部を示す。ステップS21の処理により、信号平坦部は元のサンプル列からは削除され、図5(c)に示すようになる。ただし、復号時に元通りに復元するために、分離された信号平坦部は、図5(e)に示すような形式で記録しておく。
【0034】
信号平坦部データは、上述のように、信号平坦部ごとに、その先頭時刻(サンプル番号)、サンプル数、サンプル値の3属性で記録する。ここで、先頭時刻とは、信号の開始位置からの時刻であり、図5(e)の例では、先頭からのサンプル番号で記録している。上述のように、サンプル番号をサンプリング周波数で除算すれば、時刻に変換されることになる。サンプル数は、そのサンプル値がどの程度連続して続くかを示す情報である。なお、サンプル数の代わりに信号平坦部の終了時刻を記録するようにしても良い。サンプル値は、デジタル化された信号レベルを示している。ここでは、16ビットで量子化しているので、最大値は「32767」、最小値は「−32768」となる。すなわち、「0」は無音部、「32767」および「−32768」は飽和部を示している。ただし、信号平坦部を無条件には処理しない。ここでは、データの圧縮を目的としているため、サンプル列の削減分よりも信号平坦部データが大きくなると意味がないからである。したがって、信号平坦部となるサンプルが所定数以上連続する場合に限り信号平坦部データを作成して各チャンネルのサンプル列から分離するのである。
【0035】
続いて、各サンプルに対して、元のサンプル値から予測誤差への変換処理を行う(ステップS1〜ステップS5)。これは、図2のフローチャートに示した処理を実行することにより各サンプルの値を予測誤差に変換する。複数チャンネルある場合は、各チャンネルのサンプル列に対して処理を行う。
【0036】
(チャンネル間演算方式)
次に、予測誤差値が記録された各チャンネルの誤差サンプル列に対して、チャンネル間の差分演算を行う(ステップS22)。これは、同一時刻における誤差サンプル値の差分を単純にとることにより行われる。差分演算の結果は、一方のチャンネルの誤差サンプル列として与え、他方のチャンネルの誤差サンプル列の値は、元のままとしておく。具体的には、図5(c)に示すような2チャンネルのステレオ音響信号の場合Ch1にはL信号の値をそのまま記録しておき、Ch2にはR−Lの差分値を与える。一般に、ステレオ音響信号では、同一時刻におけるそれぞれのデータには相関があり、各時刻における両データの差分値は元の値に比べて小さな値となる。これは線形予測により予測符号化した場合も同じである。そのため、図5(d)の例では、Ch2における各誤差サンプルの値が小さくなり、後に圧縮できる余地が大きくなる。
【0037】
(フレーム間演算方式)
続いて、チャンネル間演算が行われた各チャンネルの誤差サンプル列に対して、所定の区間長をもつフレームを設定して、設定されたフレーム間の演算を行う(ステップS23)。各フレームを構成する誤差サンプル列の類似度を求め、類似しているフレームを選別する。ここでは、フレーム長を誤差サンプル列の開始時刻から終了時刻までの全区間に渡って固定長としている。具体的には、1フレームを256サンプルとしている。サンプル列の先頭から256サンプルずつを1フレームとして抽出し、各フレームの類似度を求めていくことになる。フレーム同士の類似度とは、両信号の相関を求めることになるので、相関計算を行うための種々の手法を用いることができるが、ここでは、各フレームにおいて対応する256サンプルに対して差分を計算し、各々の絶対値の最大値を算出する。ここでは、基本フレームに対して後続する100フレームについて各々最大になる差分絶対値を算出し、最大値が所定値以下となるフレームを相関フレームとして選別し、前記基本フレームと1つのグループを形成することになる。この処理は誤差サンプル列の全区間に渡って行われる。ここで、ステップS23の処理による誤差サンプル列の変化の様子を図7(a)〜(c)に示す。なお、図7においては、図5と異なり1チャンネルしか示していないが、他のチャンネルについても同様に処理される。まず、図7(a)に示したように、固定長にフレーム化された誤差サンプル列は、フレームF1、F2、F3、…Fm、…Fn、…に分割される。
【0038】
続いて、1つの基本フレームに対して後続する複数のフレームについて、差分を算出する。まず先頭のフレームF1と次のフレームF2内の各サンプルごとに差分を算出していく。この例では、256個の差分値が各サンプル時刻に対して得られることになる。得られた差分値の絶対値の最大値をF2フレームにおけるF1フレームとの相関を示す指標値として記録しておく。同様に、F3フレームに対してもF1フレームとの差分絶対値の最大値を求め、最大値が最も小さくなるフレームを相関フレーム候補として選別する。例えば、フレームF1を基本フレームとしたとき、フレームF3の差分絶対値の最大値が最も小さいため、フレームF3が相関フレーム候補となる。そして、差分をとる前のフレームF3の各サンプル値の絶対値の最大値に比べ、前記差分絶対値の最大値が、所定の割合以下に減少している場合、フレームF3を相関フレームに決定し、基本フレームであるフレームF1とグループAを形成する。この時、フレームF1はそのままであるが、フレームF3の各サンプルには、フレームF1との差分値に更新されることになる。差分値であることを示すために、処理後のフレームをフレーム「F3−F1」で表現することにする。さらに、後続するフレームに対しても同様の処理が行われる。例えば、基本フレームFmに対してフレームFnが相関フレームとして決定され、グループGが構成されるとともに、フレームFnについても差分処理を行い、フレーム「Fn−Fm」が得られる。結局、グループ内の基本フレームは、そのままとなり、グループ内の相関フレームには、基本フレームとの差分が記録されることになる。
【0039】
ステップS23においては、上記差分演算処理と並列してフレーム間の関係であるフレーム構造データを記録していく。具体的には、どのフレームがグループ化されたかの情報を記録していくことになる。フレームの記録は、各フレームのフレーム番号を記録することにより行う。ここで、フレーム構造データの一例を図7(d)に示す。図7(d)に示すようにフレーム構造データには、グループ番号とそのグループに属する基本フレームと相関フレームの各々のID番号により記録している。このフレーム構造データは、復号時に元の信号を忠実に復元するために必要となる。ステップS23では、類似しているフレームを選別して各グループの相関フレームは基本フレームとの差分で記録するようにした。類似しているフレームの差分値は、値が小さくなるので、後述する処理で記録するビット数を変化させたときに、少ないビット数で表現することが可能となる。
【0040】
この後、図3に示したような正負極性の処理を行う(ステップS6)。これは、図3に示したように、2の補数表現を符号付絶対値表現に変換し、正負の符号を最下位ビットに移動させるものである。さらにこの後、可変長符号化を行う(ステップS7〜ステップS13)。これは、図4のフローチャートに示した処理を実行することにより各サンプルのビット長を可変長で符号化していく。
【0041】
(予測誤差の一例)
次に、上記ステップS1で行われる予測誤差の算出について説明しておく。ここでは、代表して過去の2サンプルにより予測する〔数式2〕を用いた場合について説明する。例えば、サンプル値x(t)が図8(a)に示すような状態である場合を考えてみる。図8(a)において、横軸は時刻(サンプル番号)、縦軸はサンプル値x(t)である。また、各時刻における線分は、各時刻におけるサンプル値x(t)の大きさを示している。〔数式2〕による算出の手順を図8を用いて説明すると、まず、誤差フィードバック成分を加えない状態で各予測誤差eo(t)を算出する。図8(b)に示すように、時刻tの予測誤差eo(t)を算出する場合、直前の時刻t−1におけるサンプル値x(t−1)および2つ前の時刻t−2におけるサンプル値x(t−2)を結ぶ予測線が時刻tでとる値と、時刻tにおけるサンプル値x(t)の差分(図中太点線で示す)に基づいて予測誤差eo(t)が算出される。時刻t+1以降も同様に行って予測誤差eo(t+1)を算出する。算出された予測誤差eo(t)は、図8(c)に示すようになる。図8(a)と図8(c)を比較するとわかるように値が変動する範囲が大きく狭まり、データ圧縮に都合が良くなる。
【0042】
続いて、〔数式2〕に基づいて予測誤差eo(t)に対して直前の時刻t−1における補正が加わった予測誤差e2(t−1)の50%を減算させて、誤差フィードバック処理を加えた結果が図8(d)である。図8(c)と比べると、時刻t+1およびt+2における予測誤差の低減が顕著である。逆に時刻t+3およびt+4では予測誤差が増大しているが、平均的には予測誤差が低減し、図8(a)と比較すると値が変動する範囲が更に狭まり、データ圧縮効果が向上する。
【0043】
(実現のための装置構成)
上記符号化方法は、現実には専用のソフトウェアを搭載したコンピュータにより実現されることは当然である。コンピュータに上記処理を実行させるプログラムを搭載することにより、コンピュータがデジタル音響信号等の時系列信号を読んだ後、上記ステップS1〜ステップS13の処理を実行することにより圧縮された符号データが得られる。
【0044】
【発明の効果】
以上、説明したように本発明によれば、時系列のサンプル列で構成される時系列信号の可逆圧縮を行うにあたり、サンプル列の各サンプルに対して、時間的に過去のサンプル列から、複数の予測計算式に基づいて複数の予測誤差値を算出し、過去のサンプル列の予測誤差値の累積値である累積誤差に基づいて、算出された複数の予測誤差値の中から、符号化対象の予測誤差値として1つを選択し、符号化対象として選択された予測誤差値に対して可変長符号で符号化を行うことにより各サンプルを符号化し、予測誤差の算出、符号化対象誤差の選択、可変長符号化を全サンプルについて実行するようにしたので、より効率の高い圧縮を行うことが可能となるという効果を奏する。
【図面の簡単な説明】
【図1】本発明において処理対象とするデジタル時系列信号のサンプル列を模式的に示した図である。
【図2】本発明における適応型線形予測処理の概要を示すフローチャートである。
【図3】ステップS6の正負極性処理の様子を示す図である。
【図4】本発明における可変長符号化の概要を示すフローチャートである。
【図5】信号平坦部処理およびチャンネル間演算処理の様子を示す図である。
【図6】本発明に好適な他の圧縮処理を組み合わせた場合の処理概要を示すフローチャートである。
【図7】フレーム間演算処理の様子を示す図である。
【図8】〔数式2〕を用いた予測誤差算出処理の様子を示す図である。
【符号の説明】
R1〜R4・・・累積誤差
Bv・・・変更部ビット長
Bd(t)・・・誤差サンプルビット長
Bf・・・平均ビット長
RB・・・累積ビット長
[0001]
[Industrial applications]
The present invention relates to the field of music production, such as music production, storage of audio data materials, and relay of location materials, particularly to the field of producing high-definition audio with higher quality than CDs, and audio recording using digital recording media such as CDs and DVDs. The present invention relates to a reversible data compression technique suitable in a field where reproduction of data, a transmission of a biological signal in telemedicine, and the like where data modification is disliked, and the like are performed.
[0002]
[Prior art]
Conventionally, various methods have been used for compressing an acoustic signal. MP3 (MPEG-1 / Layer3), AAC (MPEG-2 / Layer3) and the like have been put to practical use as a technique for compressing and encoding an audio signal. With such a compression encoding method, it is possible to treat an audio signal as small data, which contributes to the efficiency of data recording and transmission.
[0003]
MP3, AAC, and the like as described above are all called lossy coding schemes, and can be efficiently compressed. However, decoding involves a considerable deterioration in quality and completely reproduces the original signal. It is not possible. For this reason, in the music production field such as music production, material storage, and location material relay, these encoding methods cannot be applied, and although inefficient, non-compressed storage / transmission methods are used. In particular, recently, the number of productions that handle high-definition audio has increased, the material capacity has become enormous, and this has become a problem in managing work disks.
[0004]
Recently, in order to solve the above problem, as a method of reversibly compressing and encoding an audio signal, a method using prediction encoding and combining prediction error data with encoding processing according to the frequency of appearance has been proposed. (For example, see Patent Document 1).
[0005]
In addition, the present applicant also performs a difference operation between channels and between frames on a sample sequence of an audio signal to reduce the value of each sample, and then compresses data using predictive coding. is suggesting. (See Patent Document 2).
[0006]
[Patent Document 1]
JP 2002-278600 A [Patent Document 2]
Japanese Patent Application No. 2002-231150 [0007]
[Problems to be solved by the invention]
However, in the technologies proposed in Patent Documents 1 and 2, the prediction method is limited to one. For example, the technique described in Patent Document 2 proposes predictive coding based on the past two samples. The genre of contents to which predictive coding based on the past two samples can be applied is the widest, but contents that change slowly are predicted based on the past one sample, and contents that change rapidly are predicted based on the past three or more samples. It has been confirmed that the error is reduced. Therefore, there is a method that prepares multiple formulas and selects an appropriate one according to the content, but if the entire content does not have uniform properties, the compression effect can not be obtained, especially vocal and mixed music Then, there is a problem that the compression efficiency is reduced.
[0008]
Further, in the content proposed in Patent Document 2, a method is employed in which a quantization noise component having a fixed bit length which is set in advance and is difficult to compress is separated from a variable length coding target. At this time, the fixed bit length differs for each content depending on the bit precision of the A / D converter, the conditions at the time of audio recording, and the like, and therefore, it is necessary to set an optimal value as needed. Further, it has been found that the optimum fixed bit length changes due to a change in the signal amplitude even in the content, and there is a problem that the compression effect is reduced if the processing is performed uniformly.
[0009]
In view of the above points, the present invention is capable of performing more efficient compression by selecting an optimal method at any time in accordance with a change in signal characteristics in a time-series signal. It is an object of the present invention to provide a time-series signal encoding method and apparatus capable of completely decoding an original time-series signal at the time of decoding.
[0010]
[Means for Solving the Problems]
In order to solve the above problem, the present invention provides a coding method for compressing the amount of information so that all the sample sequences can be reproduced with respect to a time-series signal composed of a time-series sample sequence. Prediction error calculating step of calculating a plurality of prediction error values based on a plurality of prediction calculation formulas from a temporally past sample sequence with respect to each sample, and a prediction calculation formula of a prediction error value of a past sample sequence An encoding target error selecting step of selecting one as the encoding target prediction error value from a plurality of prediction error values calculated in the prediction error calculating step based on the cumulative error that is another accumulated value; A variable length coding step of performing coding with a variable length code on an error sample having a prediction error value selected as the coding target, the prediction error calculation step, a coding target error selection step, a variable length coding step; Mark Characterized in that the reduction step to be executed for all samples.
[0011]
According to the present invention, for each sample, a plurality of prediction error values are calculated based on a plurality of prediction calculation formulas, and a prediction error of a calculation formula in which the cumulative prediction error for each calculation formula with respect to a past sample sequence is minimized is calculated. The prediction error is selected as the prediction error of the sample, so that the prediction error is calculated based on the optimal calculation formula according to the change of the signal waveform with the change of time. It is possible to do.
[0012]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
(Configuration of time series signal)
First, a time-series signal to be encoded in the present invention will be described. Here, a case of an audio signal having a plurality of channels as a time-series signal will be described as an example. First, an analog audio signal that is a time-series signal is digitized. This can be done by using a conventional general PCM technique, sampling this analog audio signal at a predetermined sampling frequency, and converting the amplitude into digital data using a predetermined number of quantization bits. In the present embodiment, a description will be given below on the assumption that positive and negative signs are recorded at a sampling frequency of 44.1 KHz and a quantization bit number of 16 bits. Sampling at a sampling frequency of 44.1 KHz results in a sample sequence composed of 44100 samples per second. FIG. 1 schematically shows a predetermined number of samples from the top. In FIG. 1, the horizontal axis represents time t, and the vertical axis represents amplitude x (t). In FIG. 1, the numbers t-4 to t + 5 indicate the sample numbers of the respective samples. When sampling at 44.1 KHz as described above, these 10 samples correspond to 1/4410 seconds. Here, the sample number and the time are used synonymously. This is because the sample numbers are assigned in ascending order as the time changes, and the value obtained by multiplying the sampling frequency by the time becomes the sample number. In FIG. 1, the line segment extending from each sample number indicates an amplitude value. When the amplitude value is 16 bits and a positive / negative sign is recorded as described above, the amplitude is −32768 to 32767. Value.
[0013]
(Outline of processing)
Next, the encoding process for the time-series signal as described above will be described. First, adaptive linear prediction coding is performed. The processing outline of the adaptive linear prediction coding is shown in the flowchart of FIG. In FIG. 2, first, a linear prediction error corresponding to each prediction formula is calculated using a plurality of prediction formulas prepared in advance (step S1). Specifically, the following [Equation 1] to [Equation 4] are prepared as prediction calculation equations for calculating the prediction error of the sample number t.
[0014]
[Formula 1]
e1 (t) = x (t) -x (t-1) -e1 (t-1) / 2
[0015]
[Formula 2]
e2 (t) = x (t) −2 × x (t−1) + x (t−2) −e2 (t−1) / 2
[0016]
[Equation 3]
e3 (t) = x (t) −3 × x (t−1) + 3 × x (t−2) −x (t−3) −e3 (t−1) / 2
[0017]
[Equation 4]
e4 (t) = x (t) −4 × x (t−1) + 6 × x (t−2) −4 × x (t−3) + x (t−4) −e4 (t−1) / 2
[0018]
In the above [Equation 1] to [Equation 4], e1 (t) to e4 (t) are prediction errors in the sample at time t by the respective prediction calculation expressions, and x (t) to x (t-4) are time It is an amplitude value from t to t-4.
[0019]
“2 × x (t−1) −x (t−2)” in the above “Formula 2” and “3xx (t−1) −3 × x (t−2) + x ( t−3) ”, and“ 4 × x (t−1) −6 × x (t−2) + 4 × x (t−3) −x (t−4) ”in the above [Equation 4] is the past 2 Linear prediction component based on ~ 4 samples. The prediction error at time t using this linear prediction component and the prediction errors “e1 (t−1) / 2” to “e4 (t−1) / 2” (error feedback components) calculated in the immediately preceding sample. e1 (t) to e4 (t) are calculated.
[0020]
Next, a linear prediction error that minimizes the cumulative error, which is the accumulation of the absolute values of the prediction error values for each of the above-described prediction formulas, is selected as the prediction error of the sample (step S2). Here, the concept of accumulated error is used. Specifically, the cumulative values of the prediction errors calculated by the prediction calculation formulas [Formula 1] to [Formula 4] for the past samples are set as R1 to R4. Then, a prediction error corresponding to the smallest one of the accumulated errors R1 to R4 is selected. For example, it is assumed that R2 is the minimum among R1 to R4. In this case, the prediction error e2 (t) calculated by [Equation 2] is selected as the prediction error e (t) to be encoded. The selected prediction error e (t) is replaced with the original value x (t) of the sample, and the subsequent processing is performed. A sample in which the prediction error e (t) is recorded to be distinguished from the original sample will be referred to as an error sample.
[0021]
Subsequently, the absolute values of the prediction errors e1 (t) to e4 (t) are added to the accumulated errors R1 to R4 (step S3). Specifically, as shown in the following [Equation 5], the variables R1 to R4 serving as the accumulated error values are updated. At the same time, every time the processing of each sample is performed, the processing of incrementing the counter by one is performed.
[0022]
[Equation 5]
R1 ← R1 + | e1 (t) |
R2 ← R2 + | e2 (t) |
R3 ← R3 + | e3 (t) |
R4 ← R4 + | e4 (t) |
[0023]
Subsequently, it is determined whether the counter has exceeded a predetermined number of times (step S4). In the present embodiment, the predetermined number is set to 100 times. That is, it is determined whether the counter has exceeded 100.
[0024]
As a result, if the counter exceeds 100, the accumulated error is halved (step S5). Specifically, as shown in the following [Equation 6], variables R1 to R4 that are cumulative errors are divided by two. At the same time, the counter is reset to zero. That is, R1 to R4 are not cumulative errors in a pure sense, but are moving averages of the cumulative errors. In the present embodiment, up to the immediately preceding maximum of 100 samples are accumulated, but the previous samples are processed so as to be halved. Thereby, the influence of the samples separated in time is reduced.
[0025]
[Equation 6]
R1 ← (R1) / 2
R2 ← (R2) / 2
R3 ← (R3) / 2
R4 ← (R4) / 2
[0026]
By executing the processing of steps S1 to S5 over all samples at all times in the time-series signal, the values of all samples are replaced from the original amplitude value x (t) with the target error e (t). become.
[0027]
Subsequently, positive / negative processing is performed on each error sample (step S6). The value of each sample is replaced from the amplitude value to the prediction error by the processing of the above steps S1 to S5, but the bit format of each sample remains unchanged. Normally, when operated by a computer such as a computer, each data is processed in units of 32 bits and is expressed using a two's complement representation. This is converted into a positive / negative signed absolute value expression, and the absolute value portion is shifted one bit higher, and the positive / negative sign bit is shifted to the LSB (least significant bit). FIG. 3 schematically shows how the bit configuration is converted in step S6. FIG. 3A shows a bit configuration before processing, and FIG. 3B shows a bit configuration after processing. The reason why the positive / negative sign bit is shifted to the LSB is to make it easier to detect the bit length of each error sample in the processing of step S7 and later (variable length coding) described later.
[0028]
From here on, the process of converting each error sample into a variable length is performed. The bit length conversion in the present embodiment employs a method generally called Golomb coding. More specifically, the bit components forming one sample are divided into upper bit components and lower bit components, the lower bit components are left unchanged, and the upper bit components are the numerical values obtained by converting only the upper bits into decimal numbers. Bits “0” are arranged, and a separator bit “1” is added at the end. For example, consider an 8-bit bit component "00101000". At this time, if the lower bit component is 4 bits, the lower bit component is “1000”. Since the upper bits are "0010", "2" pieces of "0" obtained by converting this number into decimal numbers are arranged, and are converted into "001" obtained by adding "1" at the end. As a result, the 8-bit bit string “00101000” is converted into a 7-bit bit string “00111000”. In the present embodiment, the bit length of the lower bit component that makes the bit component invariable before and after the conversion is made variable in each sample.
[0029]
Hereinafter, a specific description will be given. FIG. 4 is a flowchart showing an outline of the variable length coding. First, an average bit length Bf, which is a moving average of the bit lengths of past samples, is calculated (step S7). The average bit length Bf is obtained by dividing the accumulated bit length RB, which is the accumulated value of the past bit length, by a counter C based on the number of past samples. That is, it is calculated by Bf = RB / C. Since the accumulated bit length RB is 0 in the initial state, when processing a sample at t = 1, the bit length Bd (t) of the sample at t = 1 is set as an initial value. Also, the initial counter C is set to 1.
[0030]
Subsequently, the bit length Bd (t) of the sample at time t is calculated (step S8). For the samples after t = 2, after calculating the average bit length Bf, the bit length Bd (t) of the sample is calculated. The bit length Bd (t) is easily calculated by performing the conversion of the bit configuration as in step S6. As a result of the conversion into the bit configuration as shown in FIG. 3B, the bit length starts from the first bit "1" in the bit configuration of each sample. Next, the bit length Bv of the changing unit is calculated (Step S9). This is calculated by subtracting the average bit length Bf from the bit length Bd (t) of the error sample. Subsequently, the code output of the data is performed (step S10). Specifically, after outputting “0” by the numerical value obtained by converting the upper Bv bits into a decimal number, a separator bit “1” is output, and the lower Bf bits are output as an invariable part. The code output is performed as recording on an external storage device such as a hard disk or a CD-R. Next, the bit length Bd (t) is added to the accumulated bit length RB (step S11). At the same time, each time the processing of each error sample is performed, the processing of adding the counter C one by one is performed. Subsequently, it is determined whether the counter C has exceeded a predetermined number (step S12). As the predetermined number, about 100 is set here as well. Therefore, it is determined whether the counter has exceeded 100. As a result, if the counter exceeds 100, the cumulative bit length RB is halved (step S13). Specifically, the variable RB that is the accumulated bit length is divided by two. At the same time, the counter C is halved.
[0031]
As described above, encoding with a variable bit length is performed for each sample. The variable-length error samples obtained by the encoding are recorded on a target recording medium as code data. Note that the processing of steps S1 to S13 has been described separately for adaptive linear prediction of FIG. 2 and the variable length coding of FIG. 4 for convenience of description, but actually, the processing of steps S1 to S13 is performed for each sample. Are performed in parallel. That is, as shown in FIG. 1, instead of returning to step S1 after the processing of steps S4 and S5, the processing returns to step S1 after performing the processing of steps S6 to S13.
[0032]
(Combination with other compression methods)
The present invention can sufficiently enhance the compression effect even with only the above description, but a higher effect can be obtained by combining with another compression method. Hereinafter, preferred combinations will be described. Here, a description will be given assuming that processing is performed on a stereo sound signal as shown in FIG. FIG. 5A shows a two-channel stereo sound signal, in which an L (left) signal is recorded in Ch1 and an R (right) signal is recorded in Ch2. 5A to 5D, the left end is the start time and the right end is the end time. Compared to FIG. 1, the time intervals on the horizontal axis are shown in a condensed form. FIG. 6 is a flowchart showing an outline of the entire processing when another method is combined with the present invention. From now on, description will be made according to FIG.
[0033]
(Signal flat part processing method)
First, processing of a signal flat portion is performed on a sample sequence that is a digital acoustic signal (step S21). The signal flat portion refers to a portion where the same signal level is continuous. In particular, it often occurs in a silent part where the signal level is “0” and in a saturated part where the absolute value of the signal level is the maximum. Silence occurs when the sound is actually silent or when the sound is not recorded very small, while saturation occurs during the signal recording and A / D conversion. Regardless of whether a silent portion, a saturated portion, or the other same signal level continues, the same signal level is continuously recorded for a predetermined time (a predetermined number of samples) in the signal flat portion. For this reason, this part is data that can be easily compressed. Specifically, the three values of the head time position of the signal flat portion, the number of samples following the same signal level, and the signal level (sample value) are recorded as signal flat portion data separately from the sample sequence of each channel. I do. The signal flat portion is deleted from the sample sequence of each channel. This is schematically shown in FIGS. 5B and 5C. FIG. 5B shows a sample sequence before the signal flat portion processing. In FIG. 5B, a shaded portion indicates a signal flat portion. By the processing in step S21, the signal flat portion is deleted from the original sample sequence, and the result is as shown in FIG. However, in order to restore the original state at the time of decoding, the separated signal flat part is recorded in a format as shown in FIG.
[0034]
As described above, the signal flat portion data is recorded for each signal flat portion with three attributes of the start time (sample number), the number of samples, and the sample value. Here, the head time is the time from the start position of the signal, and in the example of FIG. 5E, it is recorded with the sample number from the head. As described above, if the sample number is divided by the sampling frequency, it will be converted to time. The sample number is information indicating how continuous the sample value continues. The end time of the signal flat portion may be recorded instead of the number of samples. The sample value indicates the digitized signal level. Here, since quantization is performed with 16 bits, the maximum value is “32767” and the minimum value is “−32768”. That is, “0” indicates a silent part, and “32767” and “−32768” indicate a saturated part. However, the signal flat portion is not unconditionally processed. Here, since the purpose is to compress data, it is meaningless if the signal flat portion data is larger than the reduction of the sample sequence. Therefore, only when the sample which becomes the signal flat portion continues for a predetermined number or more, the signal flat portion data is created and separated from the sample sequence of each channel.
[0035]
Subsequently, a conversion process from the original sample value to the prediction error is performed on each sample (Steps S1 to S5). This converts the value of each sample into a prediction error by executing the processing shown in the flowchart of FIG. When there are a plurality of channels, processing is performed on the sample sequence of each channel.
[0036]
(Calculation method between channels)
Next, a difference calculation between channels is performed on the error sample sequence of each channel in which the prediction error value is recorded (step S22). This is performed by simply taking the difference between the error sample values at the same time. The result of the difference operation is given as an error sample sequence of one channel, and the value of the error sample sequence of the other channel is left as it is. Specifically, in the case of a two-channel stereo sound signal as shown in FIG. 5C, the value of the L signal is recorded as it is for Ch1, and the RL difference value is given to Ch2. Generally, in a stereophonic signal, each data at the same time has a correlation, and the difference between the two data at each time is a smaller value than the original value. This is the same when predictive coding is performed by linear prediction. For this reason, in the example of FIG. 5D, the value of each error sample in Ch2 becomes small, and there is more room for subsequent compression.
[0037]
(Inter-frame operation method)
Subsequently, a frame having a predetermined section length is set for the error sample sequence of each channel on which the inter-channel operation has been performed, and the operation between the set frames is performed (step S23). The similarity of the error sample sequence constituting each frame is obtained, and similar frames are selected. Here, the frame length is fixed over the entire section from the start time to the end time of the error sample sequence. Specifically, one frame has 256 samples. 256 samples from the beginning of the sample sequence are extracted as one frame, and the similarity of each frame is determined. Since the similarity between frames means that the correlation between both signals is obtained, various methods for performing the correlation calculation can be used. Here, the difference between the 256 samples corresponding to each frame is calculated. Calculate and calculate the maximum value of each absolute value. Here, a difference absolute value that maximizes each of the 100 subsequent frames to the basic frame is calculated, and a frame whose maximum value is equal to or less than a predetermined value is selected as a correlation frame, and one group is formed with the basic frame. Will be. This process is performed over the entire section of the error sample sequence. FIGS. 7A to 7C show how the error sample sequence changes in the process of step S23. Although only one channel is shown in FIG. 7 unlike FIG. 5, the other channels are processed similarly. First, as shown in FIG. 7A, the error sample sequence framed to a fixed length is divided into frames F1, F2, F3,... Fm,.
[0038]
Subsequently, differences are calculated for a plurality of frames subsequent to one basic frame. First, a difference is calculated for each sample in the first frame F1 and the next frame F2. In this example, 256 difference values are obtained for each sample time. The maximum absolute value of the obtained difference value is recorded as an index value indicating the correlation with the F1 frame in the F2 frame. Similarly, the maximum value of the absolute difference between the F3 frame and the F1 frame is determined, and the frame having the smallest maximum value is selected as a correlation frame candidate. For example, when the frame F1 is a basic frame, the maximum difference absolute value of the frame F3 is the smallest, so that the frame F3 is a correlation frame candidate. Then, when the maximum value of the absolute value of the difference is smaller than or equal to the maximum value of the absolute value of each sample value of the frame F3 before taking the difference, the frame F3 is determined to be a correlation frame. , And a group A with the frame F1 which is a basic frame. At this time, the frame F1 remains unchanged, but each sample of the frame F3 is updated to a difference value from the frame F1. In order to indicate the difference value, the processed frame is represented by a frame “F3-F1”. Further, the same processing is performed on the subsequent frames. For example, the frame Fn is determined as a correlation frame with respect to the basic frame Fm, a group G is formed, and a difference process is performed on the frame Fn to obtain a frame “Fn−Fm”. After all, the basic frame in the group remains as it is, and the difference from the basic frame is recorded in the correlation frame in the group.
[0039]
In step S23, frame structure data, which is a relationship between frames, is recorded in parallel with the above-described difference calculation processing. Specifically, information on which frames have been grouped is recorded. The recording of a frame is performed by recording the frame number of each frame. Here, an example of the frame structure data is shown in FIG. As shown in FIG. 7D, the frame structure data is recorded by a group number and each ID number of a basic frame and a correlation frame belonging to the group. This frame structure data is required to faithfully restore the original signal during decoding. In step S23, similar frames are selected, and the correlation frame of each group is recorded by the difference from the basic frame. Since the difference value between similar frames is small, it is possible to represent the difference value with a small number of bits when changing the number of bits to be recorded in the processing described later.
[0040]
Thereafter, the processing of the positive / negative polarity as shown in FIG. 3 is performed (step S6). As shown in FIG. 3, the two's complement representation is converted to a signed absolute value representation, and the sign is shifted to the least significant bit. After that, variable length coding is performed (steps S7 to S13). In this case, the bit length of each sample is coded in a variable length by executing the processing shown in the flowchart of FIG.
[0041]
(Example of prediction error)
Next, the calculation of the prediction error performed in step S1 will be described. Here, a description will be given of a case where [Equation 2], which is predicted by two past samples, is used as a representative. For example, consider a case where the sample value x (t) is in a state as shown in FIG. In FIG. 8A, the horizontal axis represents time (sample number), and the vertical axis represents sample value x (t). The line segment at each time indicates the magnitude of the sample value x (t) at each time. The procedure of calculation using [Equation 2] will be described with reference to FIG. 8. First, each prediction error eo (t) is calculated without adding an error feedback component. As shown in FIG. 8B, when calculating the prediction error eo (t) at the time t, the sample value x (t-1) at the immediately preceding time t-1 and the sample value x (t-1) at the immediately preceding time t-2 are calculated. The prediction error eo (t) is calculated based on the difference between the value taken by the prediction line connecting the value x (t−2) at the time t and the sample value x (t) at the time t (shown by a thick dotted line in the figure). You. The same operation is performed after time t + 1 to calculate the prediction error eo (t + 1). The calculated prediction error eo (t) is as shown in FIG. As can be seen from a comparison between FIG. 8A and FIG. 8C, the range in which the value fluctuates is greatly narrowed, and data compression becomes more convenient.
[0042]
Subsequently, based on [Equation 2], 50% of the prediction error e2 (t-1) obtained by adding the correction at the immediately preceding time t-1 to the prediction error eo (t) is subtracted, and the error feedback processing is performed. FIG. 8D shows the added result. Compared with FIG. 8C, the reduction of the prediction error at the times t + 1 and t + 2 is remarkable. Conversely, the prediction error increases at times t + 3 and t + 4, but the prediction error is reduced on average, and the range in which the value fluctuates is further narrowed as compared with FIG. 8A, and the data compression effect is improved.
[0043]
(Device configuration for realization)
It goes without saying that the above encoding method is actually realized by a computer equipped with dedicated software. By installing a program that causes the computer to execute the above-described processing, the computer reads a time-series signal such as a digital acoustic signal, and then executes the processing of steps S1 to S13 to obtain compressed code data. .
[0044]
【The invention's effect】
As described above, according to the present invention, in performing lossless compression of a time-series signal composed of a time-series sample sequence, a plurality of samples in the sample sequence are sampled from a temporally past sample sequence. Calculates a plurality of prediction error values based on the prediction calculation formula of, and calculates an encoding target Is selected as a prediction error value of the target, and each sample is coded by performing coding with a variable length code on the prediction error value selected as a coding target, thereby calculating a prediction error, and calculating a coding target error. Since the selection and the variable length coding are performed for all the samples, it is possible to perform the compression with higher efficiency.
[Brief description of the drawings]
FIG. 1 is a diagram schematically showing a sample sequence of a digital time-series signal to be processed in the present invention.
FIG. 2 is a flowchart illustrating an outline of an adaptive linear prediction process according to the present invention.
FIG. 3 is a diagram showing a state of positive / negative polarity processing in step S6.
FIG. 4 is a flowchart showing an outline of variable-length coding according to the present invention.
FIG. 5 is a diagram illustrating a state of a signal flat portion process and an inter-channel calculation process.
FIG. 6 is a flowchart showing an outline of a process when another compression process suitable for the present invention is combined.
FIG. 7 is a diagram illustrating a state of an inter-frame calculation process.
FIG. 8 is a diagram showing a state of a prediction error calculation process using [Equation 2].
[Explanation of symbols]
R1 to R4: cumulative error Bv: changing unit bit length Bd (t): error sample bit length Bf: average bit length RB: cumulative bit length

Claims (12)

時系列のサンプル列で構成される時系列信号に対して、前記全てのサンプル列を再現できるように情報量を圧縮する符号化方法であって、
前記サンプル列の各サンプルに対して、時間的に過去のサンプル列から、複数の予測計算式に基づいて複数の予測誤差値を算出する予測誤差算出段階と、
過去のサンプル列の予測誤差値の各予測計算式別の累積値である累積誤差に基づいて、前記予測誤差算出段階で算出された複数の予測誤差値の中から、符号化対象の予測誤差値として1つを選択する符号化対象誤差選択段階と、
前記符号化対象として選択された予測誤差値を有する誤差サンプルに対して可変長符号で符号化を行う可変長符号化段階と、を有し、
前記予測誤差算出段階、符号化対象誤差選別段階、可変長符号化段階を全サンプルについて実行することにより、時系列信号の全サンプルを可変長符号化することを特徴とする時系列信号の符号化方法。
An encoding method for compressing the amount of information so that all the sample sequences can be reproduced for a time-series signal composed of a time-series sample sequence,
For each sample of the sample sequence, a prediction error calculation step of calculating a plurality of prediction error values based on a plurality of prediction formulas from a temporally past sample sequence,
Based on the cumulative error that is the cumulative value of the prediction error value of the past sample sequence for each prediction calculation formula, from among the plurality of prediction error values calculated in the prediction error calculation step, the prediction error value to be encoded An encoding target error selecting step of selecting one as
A variable-length encoding step of performing encoding with a variable-length code on an error sample having a prediction error value selected as the encoding target,
Encoding the time-series signal by performing variable-length encoding on all samples of the time-series signal by performing the prediction error calculating step, the encoding target error selecting step, and the variable-length encoding step on all the samples. Method.
請求項1において、
前記予測誤差算出段階における複数の予測計算式が、参照する過去のサンプル数の違いにより複数設けられていることを特徴とする時系列信号の符号化方法。
In claim 1,
A method for encoding a time-series signal, wherein a plurality of prediction calculation formulas in the prediction error calculation step are provided depending on a difference in the number of past samples to be referred to.
請求項1または請求項2において、
前記可変長符号化段階は、前記各誤差サンプルのビット成分のうち、下位のビット成分をそのままのビット成分で符号化し、残りの上位ビット成分に対してビット成分を変更して符号化を行うものであることを特徴とする時系列信号の符号化方法。
In claim 1 or claim 2,
In the variable length encoding step, among the bit components of each of the error samples, the lower bit component is encoded with the same bit component, and the encoding is performed by changing the bit component with respect to the remaining upper bit components. A time-series signal encoding method, characterized in that:
請求項1または請求項2において、
前記可変長符号化段階は、前記過去の誤差サンプルのビット長の移動平均に基づいて不変ビット長を決定し、前記各誤差サンプルのビット成分のうち、下位の前記不変ビット長分をそのままのビット成分で符号化し、残りの上位ビット成分に対してビット成分を変更して符号化を行うものであることを特徴とする時系列信号の符号化方法。
In claim 1 or claim 2,
The variable length encoding step determines an invariant bit length based on a moving average of the bit lengths of the past error samples, and the lower invariant bit length of the bit components of each error sample is used as it is. A coding method for a time-series signal, wherein coding is performed using a component, and coding is performed by changing a bit component with respect to the remaining higher-order bit components.
請求項1から請求項4のいずれかにおいて、
符号化対象誤差選択段階により選択された予測誤差値の絶対値に対して全体を1ビット上位にずらし、正負極性ビットを最下位ビットに挿入する極性処理段階を、前記可変長符号化段階の前段階として有することを特徴とする時系列信号の符号化方法。
In any one of claims 1 to 4,
A polarity processing step of shifting the entirety of the absolute value of the prediction error value selected in the encoding target error selecting step by one bit higher and inserting a positive / negative bit into the least significant bit is performed before the variable length coding step. A method for encoding a time-series signal, which is provided as stages.
請求項1から請求項5のいずれかにおいて、
前記累積誤差は、過去の所定数の予測誤差値の絶対値の累積を利用して、算出されるものであることを特徴とする時系列信号の符号化方法。
In any one of claims 1 to 5,
The encoding method of a time-series signal, wherein the accumulated error is calculated by using the accumulation of absolute values of a predetermined number of prediction error values in the past.
請求項1から請求項6のいずれかにおいて、
前記サンプル列の中で、サンプルの値が連続して同一値になっている信号平坦部を抽出し、当該サンプル列から分離すると共に分離したサンプルの先頭時間位置と、サンプル個数と、サンプル値の3つの値を信号平坦部データとして符号化する信号平坦部処理段階を、前記予測誤差算出段階の前段階として実行することを特徴とする時系列信号の符号化方法。
In any one of claims 1 to 6,
In the sample sequence, a signal flat portion in which the value of the sample is continuously the same is extracted, separated from the sample sequence, and the leading time position of the separated sample, the number of samples, and the sample value A time-series signal encoding method, characterized in that a signal flat portion processing step of coding three values as signal flat portion data is performed as a preceding stage of the prediction error calculation step.
請求項1から請求項6のいずれかにおいて、
前記サンプル列が同一時刻に複数の値をもつ複数のチャンネルで構成されている場合、チャンネル間の誤差サンプル列に所定の演算を施し、いずれかのチャンネルの誤差サンプル列を更新するようにしたチャンネル間演算段階を、前記符号化対象誤差選択段階と前記可変長符号化段階の間に実行することを特徴とする時系列信号の符号化方法。
In any one of claims 1 to 6,
When the sample sequence is composed of a plurality of channels having a plurality of values at the same time, a predetermined operation is performed on the error sample sequence between the channels to update the error sample sequence of any of the channels. A method for encoding a time-series signal, wherein an inter-operation step is performed between the encoding target error selecting step and the variable length encoding step.
請求項1から請求項6のいずれかにおいて、
前記誤差サンプル列の中から所定の個数の誤差サンプル列で構成されるフレームを複数個抽出し、抽出したフレーム間で所定の演算を施し、一方のフレームの各予測誤差値を、演算した値に更新するフレーム間演算段階を、前記符号化対象誤差選択段階と前記可変長符号化段階の間に実行することを特徴とする時系列信号の符号化方法。
In any one of claims 1 to 6,
A plurality of frames composed of a predetermined number of error sample sequences are extracted from the error sample sequence, a predetermined operation is performed between the extracted frames, and each prediction error value of one frame is calculated as a calculated value. A method for encoding a time-series signal, wherein an inter-frame operation to be updated is performed between the encoding target error selecting step and the variable length encoding step.
時系列のサンプル列で構成される時系列信号に対して、前記全てのサンプル列を再現できるように情報量を圧縮する符号化装置であって、
前記サンプル列の各サンプルに対して、時間的に過去のサンプル列から、複数の予測計算式に基づいて複数の予測誤差値を算出する予測誤差算出手段と、
前記複数の予測誤差値に対応して複数の累積予測誤差値を算出する累積誤差算出手段と、
前記累積予測誤差値に基づいて、前記予測誤差算出手段で算出された複数の予測誤差値の中から、符号化対象の予測誤差値として1つを選択する符号化対象誤差選択手段と、
前記符号化対象として選択された予測誤差値を有する誤差サンプルに対して可変長符号で符号化を行う可変長符号化手段と、
を有することを特徴とする時系列信号の符号化装置。
A coding apparatus that compresses the amount of information so that all the sample sequences can be reproduced with respect to a time-series signal including a time-series sample sequence,
For each sample of the sample sequence, a prediction error calculation unit that calculates a plurality of prediction error values based on a plurality of prediction calculation formulas from a temporally past sample sequence,
Cumulative error calculation means for calculating a plurality of cumulative prediction error values corresponding to the plurality of prediction error values,
Encoding target error selecting means for selecting one as a coding target prediction error value from among a plurality of prediction error values calculated by the prediction error calculating means, based on the cumulative prediction error value;
A variable-length encoding unit that performs encoding with a variable-length code on an error sample having a prediction error value selected as the encoding target,
An encoding device for a time-series signal, comprising:
請求項1から請求項9のいずれかの符号化方法により符号化された符号データを記録した記録媒体。A recording medium on which code data encoded by the encoding method according to claim 1 is recorded. 時系列のサンプル列で構成される時系列信号に対して、前記全てのサンプル列を再現できるように情報量を圧縮する符号化プログラムであって、
コンピュータに、
前記サンプル列の各サンプルに対して、時間的に過去のサンプル列から、複数の予測計算式に基づいて複数の予測誤差値を算出する予測誤差算出段階、過去のサンプル列の予測誤差値の各予測計算式別の累積値である累積誤差に基づいて、前記予測誤差算出段階で算出された複数の予測誤差値の中から、符号化対象の予測誤差値として1つを選択する符号化対象誤差選択段階、前記符号化対象として選択された予測誤差値に対して可変長符号で符号化を行う可変長符号化段階を実行させると共に、前記予測誤差算段階、符号化対象誤差選択段階、可変長符号化段階を全サンプルについて実行させるためのプログラム。
For a time-series signal composed of a time-series sample sequence, an encoding program that compresses the amount of information so that all the sample sequences can be reproduced,
On the computer,
For each sample of the sample sequence, a prediction error calculating step of calculating a plurality of prediction error values based on a plurality of prediction formulas from a temporally past sample sequence, each of the prediction error values of the past sample sequence An encoding target error that selects one as a prediction error value to be encoded from among a plurality of prediction error values calculated in the prediction error calculation step based on a cumulative error that is a cumulative value for each prediction calculation formula. A selecting step, performing a variable length coding step of performing coding with a variable length code on the prediction error value selected as the coding target, and calculating the prediction error, a coding target error selecting step, and a variable length coding step. A program that causes the encoding step to be performed on all samples.
JP2003017224A 2003-01-27 2003-01-27 Time series signal encoding method and apparatus Expired - Fee Related JP4139697B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003017224A JP4139697B2 (en) 2003-01-27 2003-01-27 Time series signal encoding method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003017224A JP4139697B2 (en) 2003-01-27 2003-01-27 Time series signal encoding method and apparatus

Publications (2)

Publication Number Publication Date
JP2004229184A true JP2004229184A (en) 2004-08-12
JP4139697B2 JP4139697B2 (en) 2008-08-27

Family

ID=32904435

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003017224A Expired - Fee Related JP4139697B2 (en) 2003-01-27 2003-01-27 Time series signal encoding method and apparatus

Country Status (1)

Country Link
JP (1) JP4139697B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175185A (en) * 2019-04-17 2019-08-27 南京天数智芯科技有限公司 A kind of self-adaptive non-loss compression based on time series data distribution characteristics

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175185A (en) * 2019-04-17 2019-08-27 南京天数智芯科技有限公司 A kind of self-adaptive non-loss compression based on time series data distribution characteristics

Also Published As

Publication number Publication date
JP4139697B2 (en) 2008-08-27

Similar Documents

Publication Publication Date Title
TW201537560A (en) Decoding device, method, and program
JP4139697B2 (en) Time series signal encoding method and apparatus
JP4357852B2 (en) Time series signal compression analyzer and converter
JP4170795B2 (en) Time-series signal encoding apparatus and recording medium
JP2004198559A (en) Encoding method and decoding method for time-series signal
JP4139704B2 (en) Time series signal encoding apparatus and decoding apparatus
JPWO2009090705A1 (en) Recording / playback device
JP4109124B2 (en) Time series signal encoding device
JP4676929B2 (en) Encoding apparatus, method thereof, program, and recording medium
JP4736331B2 (en) Acoustic signal playback device
JP4184817B2 (en) Time series signal encoding method and apparatus
JP4249540B2 (en) Time-series signal encoding apparatus and recording medium
JP2004070120A (en) Encoding device, decoding device and recording medium for time-series signal
JP4319895B2 (en) Time series signal encoding device
JPH11109996A (en) Voice coding device, voice coding method and optical recording medium recorded with voice coding information and voice decoding device
JP2005151327A (en) Pcm data compressing/decompressing method and apparatus
JP4556866B2 (en) High efficiency encoding program and high efficiency encoding apparatus
JP3387092B2 (en) Audio coding device
JPWO2010067800A1 (en) Encoding method, decoding method, apparatus thereof, program, and recording medium
JP2005166216A (en) Reproducing apparatus of sound signal
TWI266540B (en) A method for compressing audio data
JP3387094B2 (en) Audio coding method
JPH10124097A (en) Voice recording and reproducing device
JP3387093B2 (en) Audio coding method
JP2005215162A (en) Reproducing device of acoustic signal

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060118

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071121

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071127

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080108

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

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

R150 Certificate of patent or registration of utility model

Ref document number: 4139697

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110613

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110613

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120613

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120613

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130613

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140613

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees