JP3933072B2 - Wave compressor - Google Patents
Wave compressor Download PDFInfo
- Publication number
- JP3933072B2 JP3933072B2 JP2003082923A JP2003082923A JP3933072B2 JP 3933072 B2 JP3933072 B2 JP 3933072B2 JP 2003082923 A JP2003082923 A JP 2003082923A JP 2003082923 A JP2003082923 A JP 2003082923A JP 3933072 B2 JP3933072 B2 JP 3933072B2
- Authority
- JP
- Japan
- Prior art keywords
- sample
- scale factor
- initial
- waveform
- residual
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 238000007906 compression Methods 0.000 description 31
- 230000006835 compression Effects 0.000 description 30
- 238000013139 quantization Methods 0.000 description 26
- 238000004364 calculation method Methods 0.000 description 19
- 238000000034 method Methods 0.000 description 14
- 238000010586 diagram Methods 0.000 description 6
- 238000001514 detection method Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 230000003111 delayed effect Effects 0.000 description 2
- 230000005236 sound signal Effects 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000006837 decompression Effects 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- 230000037433 frameshift Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
Images
Landscapes
- Electrophonic Musical Instruments (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、波形データを圧縮する波形圧縮装置に関するものである。
【0002】
【従来の技術】
従来、電子楽器における楽音信号の発生方法の一つとして、自然楽器の楽音波形の瞬時値を逐次サンプリングしてディジタルとされたサンプル波形データとして予めメモリに記憶しておき、楽音の発生時にこのサンプル波形データを読み出して楽音信号を発生するようにしたPCM方式がある。このPCM方式は自然楽器に近い楽音を発生できるという点で優れているが、波形データを記憶しておくメモリの容量が膨大になってしまっていた。そこで、波形データ量を低減するために、波形データを圧縮し、この圧縮波形データをメモリに記憶しておき、再生時にはこの圧縮波形データを伸長して楽音信号を形成するようにした楽音信号発生装置が提案されている(例えば、特許文献1参照)。
また、波形圧縮装置により波形データをフレーム単位で線形予測圧縮して、圧縮波形データを得て、この圧縮波形データを波形メモリに記憶しておき、その波形メモリを使用した波形メモリ音源が知られている(例えば、特許文献2参照)。この波形圧縮装置では、圧縮波形データをフレーム単位でビット長可変として記憶している。さらに、圧縮波形データを得る圧縮波形データ処理の前段または後段にレベルダウンシフト処理を行い、レベルダウンシフト処理後の圧縮波形データをメモリに密に記憶するようにしている。
【0003】
【発明が解決しようとする課題】
このような波形圧縮装置においては、圧縮波形データのデータ量を削減するためにシフトダウンして記憶するようになっているが、そのシフトダウン量は制限ビット長に基づいて制御され、伸長される波形データの品質低下の程度については考慮されていないという問題点があった。また、このシフトダウン量は、フレーム内の残差データのピークを基準にしており、フレーム中にパルス的なノイズが入るとその影響でフレームのシフト量が不当に大きくなってしまい、量子化ノイズが増大してしまうという問題点があった。さらに、シフトデータの探索を波形データの特性と関係しない所定値を初期値として行なうようにしていたため、その探索に時間がかかるという問題点があった。
【0004】
そこで本発明は、量子化精度を与えるスケールファクタを用いて波形データを圧縮できるようにした波形圧縮装置を提供することを目的としている。
【0005】
【特許文献1】
特許第2605434号
【特許文献2】
特許第2727798号
【0006】
【課題を解決するための手段】
上記目的を達成するため、本発明にかかる波形圧縮装置は、所定の区間における波形データを線形予測圧縮する際に、所定の区間において一定の値とされているスケールファクタは、残差符号サンプルに基づくノイズレベルが閾値より小さくなる大きさのスケールファクタとされている。これにより、所定の区間においてパルス的なノイズが入ってもその影響で所定の区間における量子化ノイズが増大することを防止することができる。また、閾値をスケールファクタの値に対応して変更するようにしたため、適切な許容量子化誤差レベルを設定することができる。さらに、初期スケールファクタ算出手段を設けて、前記波形データに対応する初期スケールファクタを算出するようにしたので、スケールファクタを探索する時間を短縮することができるようになる。
【0008】
【発明の実施の形態】
本発明にかかる波形圧縮装置により圧縮された波形データがフレームを単位として記憶されている記憶手段を備える楽音生成装置のブロック図を図1に示す。図1に示す楽音生成装置1おいて、CPU10は楽音生成に関連する各種プログラムを実行することにより楽音生成装置1における楽音生成の動作を制御する中央処理装置(Central Processing Unit)である。すなわち、演奏操作子の操作、自動演奏、通信I/Oからの入力などにより発音開始指示(ノートオン)が発生したときには、音源部30に対してその発音開始指示に応じた楽音の生成開始を指示している。ROM(Read Only Memory)11は、例えばフラッシュROMとされており、CPU10が実行する楽音生成処理のプログラムや、各種データが格納されている。RAM(Random Access Memory)12は楽音生成装置1におけるメインメモリであり、本発明にかかる波形圧縮装置により圧縮された波形データがフレームを単位として記憶されている波形記憶領域12aを備えていると共に、CPU10のワークエリア等の領域が設定されている書き換え可能な記憶手段である。なお、波形記憶領域12aには複数曲の圧縮された波形データを記憶することができる。
【0009】
また、操作子13は、鍵盤等の演奏操作子や各種設定を行うパネルスイッチであり、表示器14は楽音生成時に各種情報を表示させる液晶等からなる表示器である。通信I/O15は、LAN(Local Area Network )やインターネット、電話回線等の通信ネットワークを介してサーバコンピュータに接続するためのネットワークインタフェースである。この通信I/O15を介して、楽音生成装置1内部で作成したMIDIメッセージを外部へ送出したり、外部からのMIDIメッセージを受信することができる。制御レジスタ20は、CPU10から各発音チャンネルの発音パラメータが書き込まれるレジスタである。音源部30は、フレームを単位として圧縮されている波形データの伸長処理を行うデコーダを備えており、CPU10の制御に基づいて、RAM12の波形記憶領域12aから楽音生成に必要とする圧縮された波形データを後述する小フレーム毎に読み出し、読み出した波形データの伸長処理を行っている。そして、デコードされた波形データの補間、エンベロープ付与、チャンネル累算(ミキシング)、および効果(エフェクト)付与などの処理を行って、楽音波形データとして出力している。音源部30から出力された楽音波形データはアナログ信号に変換されてサウンドシステム40から放音されるようになる。なお、各部はバスライン16を介して接続されている。
【0010】
次に、音源部30について説明する前にRAM12の波形記憶領域12aに記憶されている圧縮された波形データのデータ構造を図2を参照して説明する。
波形記憶領域12aに記憶されている圧縮された波形データの1曲分の波形データが図2に示されている。図2に示す波形データは、波形データの全体に関する情報が書き込まれているヘッダ情報と、圧縮された波形データが収容されているフレーム1ないしフレームnから構成されている。ヘッダ情報は、残差符号のサンプルのビット数、読出開始アドレス、読出終了アドレス、ループアドレス、最初のフレームの予測係数およびスケールファクタ、その他データからなる。圧縮された波形データである残差符号のサンプルが書き込まれている各フレームのデータ構造は同様とされており、図2には例としてフレーム2のデータ構造が示されている。1フレームは、例えば図示するようにアドレスが「00」から「09」の10アドレスに対応するデータ量とされており、1アドレスに対応するデータ幅を小フレームと定義することができる。すなわち、図2に示す1フレームは、10の小フレームから構成されている。この小フレームは副情報と残差符号からなる。
【0011】
この場合、副情報のビット数は予め定められたビット数とされており、残差符号の1サンプルのビット数は、圧縮する前の元波形データの性質に適するよう波形データ毎に定められた固定のビット数とされている。そして、小フレームのデータ幅を図2に示すように16ビットとすると共に、残差符号の1サンプルのビット数を3ビットに固定した場合は、例えば副情報に4ビットのデータ領域が割り当てられ、残差符号に12ビットのデータ領域が割り当てられて、1小フレームのサンプル数は4となる。また、残差符号の1サンプルのビット数を6ビットに固定すると、図2における残差符号の下段に示されるように1小フレームのサンプル数は2となる。同様に、固定とされている残差符号の1サンプルのビット数を4ビットとすると、図2における残差符号のさらに下段に示されるように1小フレームのサンプル数は3となり、固定とされている残差符号の1サンプルのビット数を2ビットとすると、図2における残差符号のさら下段に示されるように1小フレームのサンプル数は6となる。なお、小フレームのデータ幅を16ビットとした場合は、1フレームを構成するビット数は160ビットとなり、その内の40ビットのデータ領域が副情報の領域となり、残る120ビットのデータ領域が残差符号の領域となる。このように、1フレームあるは1小フレームにおける残差符号のサンプル数は、曲毎に固定とされる残差符号の1サンプルのビット数に応じて変更されるようになる。
【0012】
ところで、副情報は、次のフレームの残差符号の伸長に用いる線形予測係数である予測係数情報と、次のフレームの残差符号の伸長に用いるスケールファクタとその他の情報とされている。スケールファクタは、1フレームを構成する複数の残差符号を逆正規化するためのファクタである。この場合、スケールファクタを絶対値ではなく、フレーム間の比や対数スケールにおける差で記憶するとビット数に対する情報量の効率を向上することができる。スケールファクタをフレーム間の比や対数スケールにおける差とした場合においては、逆量子化時に絶対値に変換されて残差符号に乗算されるようになる。また、その他の情報を、音量情報や波形データのループアドレス等の情報としても良い。
【0013】
次に、音源部30について説明すると、アドレス発生部32は、周波数情報(Fナンバ)を累算するサンプルカウンタと、RAM12における波形記憶領域12aから波形データを小フレーム毎に読み出す読出アドレスを生成するメモリカウンタを備えている。サンプルカウンタは、指定された音高に対応する波形データのピッチシフト量であるFナンバを累算して整数部と小数部からなるサンプルアドレスを生成し、その内の整数部を残差符号キャッシュ部33に、残る小数部を補間部36にそれぞれ供給する。また、サンプルアドレスの整数部が、小フレームのサンプル数に達するごとに要求パルスを出力する。なお、小フレームのサンプル数は、図2において前述したように残差符号の1サンプルのビット数に応じて異なるようになる。アドレス発生部32のメモリカウンタでは、サンプルカウンタから要求パルスが入力されるごとに、メモリアドレスを1ずつカウントアップすることにより小フレームを読み出す読出アドレスを生成している。
【0014】
フレーム読出部31は、アドレス発生部32のサンプルカウンタから出力される要求パルスが入力されるごとに、RAM12の波形記憶領域12aからアドレス発生部32のメモリカウンタから供給されるメモリアドレスの示す小フレームのデータを読み出す。読み出された小フレームのデータにおける副情報は副情報デコード部34に供給され、読み出された小フレームのデータの残差符号のサンプルは残差符号キャッシュ部33に供給される。副情報デコード部34には、1フレームの期間において、フレーム読出部31から供給される各小フレームの副情報が順次収集され、副情報の各データがデコードされる。そして、そのフレームの次のフレームの期間に、デコードされた予測係数情報およびスケールファクタがデコーダ35に供給されると共に、その他データが音源部30の各ブロックに供給される。すなわち、各フレームの副情報は、当該フレームではなくその次のフレームで使用される副情報となる。
【0015】
残差符号キャッシュ部33には、読み出された小フレームのうちの最新の3つの小フレームがキャッシュに保持される。そして、アドレス発生部32からのサンプルアドレスの整数部に応じて、その整数部の進行量に相当する数の残差符号のサンプルがキャッシュされた3つの小フレームから取り出され、取り出された残差符号のサンプルがデコーダ35に送られる。デコーダ(キャッシュ)35では、残差符号キャッシュ部33から残差符号のサンプルが送られてくる毎に、4次の線形予測伸長により残差符号のサンプルがデコードされて復元波形サンプルを得ている。この復元波形サンプルは、デコーダ35内の波形データキャッシュに、例えば4サンプル保存される。
【0016】
ここで、演奏操作子の操作、自動演奏、通信I/O15からの入力などにより発音開始指示(ノートオン)が発生したときには、CPU10が音源部30に対してその発音開始指示に応じた楽音の生成開始を指示している。この場合の手順は次のようになる。ノートオン(パートPT、音高N、強度V)に応じて、
(1)音源部30の複数発音チャンネルのうちの1つを当該楽音の発生に割当てる。
(2)パートPTで現在選択されている音色データ(RAM12上)に基づいて、波形記憶領域12aに記憶されている波形データの1つを選択し、ピッチシフト量、音量EGパラメータ、LFOパラメータ、出力レベル等を制御レジスタ20の割り当てた発音チャンネル領域に設定する。
(3)選択された波形データのヘッダを読み出し、残差符号のサンプルのビット数、読出開始アドレス、読出終了アドレス、ループアドレス、最初のフレームの予測係数、スケールファクタ、その他データを、上記発音チャンネル領域に設定する。この場合の各アドレスは、フレームを単位としたアドレスでも良い。
(4)上記発音チャンネル領域にノートオンを書き込む。
これにより、音源部30において楽音の生成が開始されるようになる。
【0017】
次に、音源部30におけるデコーダ35の構成の一例を図3に示す。残差符号キャッシュ部33から供給された残差符号のサンプルLnは、デコーダ35における逆量子化部71において残差符号のサンプルのビット数情報に基づいてサンプルLn毎に抽出され、量子化精度を与えるスケールファクタSFに基づいて各サンプルLnが逆正規化されると共に逆量子化される。これにより、逆量子化部71からは残差符号のサンプルLn毎に復号された復号波形サンプルqnが出力される。復号波形サンプルqnは加算器72に供給されて、線形予測演算部73より出力される線形予測サンプル◇Sn-1が加算されて復元波形サンプル◇Xnが復元される。復元波形サンプル◇Xnは波形データキャッシュ部74にキャッシュされると共に、伸長された復元波形サンプル◇Xnとして出力される。
【0018】
波形データキャッシュ部74には、現在から過去の4つの復元波形サンプル◇Xn〜◇Xn-3(D1〜D4)がキャッシュされており、このキャッシュされた4つの復元波形サンプルD1〜D4が線形予測演算部73に供給される。線形予測演算部73では、この4つの復元波形サンプルD1〜D4にそれぞれの次数の線形予測係数Pを乗算して加算することにより4次の線形予測を行い、次の復元波形サンプル◇Xn+1を得るための線形予測サンプル◇Snを生成している。なお、残差符号のサンプルLnのビット数情報は、圧縮された波形データのヘッダが副情報デコード部34においてデコードされることにより、副情報デコード部34から供給されており、スケールファクタSFおよび線形予測係数Pは前述したように副情報デコード部34においてデコードされて供給されている。
【0019】
図1に戻り、デコーダ35から出力される伸長された復元波形データは、補間部36に供給される。この場合、デコーダ35における波形データキャッシュ部74にキャッシュされている4つの復元波形サンプルD1〜D4が補間部36に供給される。そして、補間部36ではアドレス発生部32からのサンプルアドレスの小数部に基づいて、供給された4つの復元波形サンプルD1〜D4を、例えば4点補間して、補間サンプルを生成する。補間部36から出力される補間サンプルは、音量EG部37において制御レジスタ20にノートオン時に設定された音量EGパラメータに基づいて音量制御され、ミキサ38に供給される。ミキサ38では全ての発音チャンネルにおける波形サンプルがチャンネル累算されると共に、効果が付与されて再生タイミング毎に出力される。ミキサ38からの出力は、ディジタル−アナログ変換器(DAC)39に供給されてアナログ信号に変換され、サウンドシステム40から放音されるようになる。
【0020】
以上説明したように、本発明の実施の形態にかかる楽音生成装置1では、波形データが図2に示す形式で波形記憶領域12aに記憶されており、その音源部30が残差符号の再生のためにフレームを構成している小フレームを順次読み出すことにより、各フレームの再生に必要な残差符号のサンプルが順次取り出されると同時に、次のフレームの残差符号を伸長するための副情報が取り出されるようになっている。すなわち、音源部30には、副情報をタイミングよく取り出すための専用の回路が不要とされ、また、各サブフレームの副情報と残差符号のビット数は固定とされているので、そこから副情報と残差符号を取り出すための構成も極めて簡単とすることができる。
【0021】
次に、線形予測を利用して波形データの圧縮処理を行う本発明の波形圧縮装置の構成を図4および図5に示す。
本発明にかかる波形圧縮装置は、後述する図4に示す初期SF算出部50と、図5に示すコーダ60とフレーム詰込部67から構成されている。すなわち、波形圧縮装置においては元波形データがビット数kに圧縮処理されて、フレーム化されて出力されるようになる。この際に、スケールファクタの探索が波形圧縮装置において行われる。このスケールファクタの探索では、コーダ60においてスケールファクタの値を変更しながら1フレームの区間における複数の元波形データのサンプルを順次量子化部62に供給し、その際に設定されているスケールファクタにおいて得られた1フレームの残差サンプルdnの各レベルが、許容量子化誤差レベルをほとんど超えないようになるスケールファクタの値を探索している。この場合スケールファクタを次第に大きくして適したスケールファクタを探索しているが、スケールファクタを繰り返し設定することから探索時間が長くなってしまうようになる。そこで、元波形データの性質に応じた初期スケールファクタを最初に算出することによりスケールファクタの探索時間が短くなるようにしている。この初期スケールファクタを算出する構成が図4に示す初期SF算出部50とされている。
【0022】
図4に示す初期SF算出部50には波形記憶領域12aから選択された元波形データのサンプル(以下、「元波形サンプル」という)Snが1フレーム分供給される。そして、予測係数算出部51において1フレーム分の元波形サンプルSnに基づいて線形予測係数Pが算出され、算出された線形予測係数Pは線形予測部52に供給される。線形予測部52では遅延手段により遅延された現在から過去の、例えば4サンプルに次数に応じた線形予測係数Pを乗算して加算することにより線形予測サンプル◇Sn-1が生成されている。この線形予測サンプル◇Sn-1は減算器53に供給されて、元波形サンプルSnから減算されて、減算器53から残差サンプルdnが出力される。残差サンプルdnは、残差符号のサンプルのビット数kが与えられているピーク検出およびスケールファクタ算出部54に供給され、残差サンプルdnのピークが求められる。すなわち、1フレーム分の元波形サンプルSnが順次供給されて、1フレーム分の残差サンプルdnがピーク検出およびスケールファクタ算出部54に供給された際に、残差サンプルdnの内のピーク値が検出され、検出されたピーク値の残差サンプルdnを、与えられているビット数kでオーバフローすることなく正規化して量子化することができる大きさの理想的スケールファクタSFPが算出される。このようにして算出された理想的スケールファクタSFPから定数Dが差し引かれて、初期スケールファクタ(初期SF)として初期SF算出部50から出力される。
【0023】
このようにして算出された初期スケールファクタ(初期SF)および予測係数Pは、波形圧縮装置における図5に示すコーダ60の予測係数&スケールファクタ生成部63に設定される。そして、圧縮処理前の元波形サンプルSnが減算器61に入力され、この元波形サンプルSnから線形予測部64より出力される線形予測サンプル◇Sn-1が減算されて、残差サンプルdn(=Sn−◇Sn-1)が出力される。予測係数&スケールファクタ生成部63に設定された線形予測係数Pは線形予測部64に供給され、初期スケールファクタ(初期SF)はスケールファクタSFとして量子化部62および逆量子化部66に供給される。ここで、減算器61から出力された残差サンプルdnは、供給されたスケールファクタSFに基づき量子化部62において正規化された後、量子化され設定されたビット数kにスケーリングされることにより、残差符号のサンプルLnが生成される。
【0024】
この残差符号のサンプルLnは、圧縮波形データとしてコーダ60から出力されてフレーム詰込部67に供給され、フレーム詰込部67において小フレームからなるフレームが生成されて出力される。さらに、残差符号のサンプルLnは逆量子化部66に供給されて、逆正規化されると共に逆量子化されて残差符号のサンプルLnを復号した復号波形サンプルqnが出力される。復号波形サンプルqnは加算器65において、線形予測部64より出力されている線形予測サンプル◇Sn-1が加算されて復元波形サンプル◇Xnが復元されて、線形予測部64に供給されるようになる。線形予測部64では、遅延手段により遅延されている例えば現在から過去の4つの復元波形サンプルに、それぞれの次数の線形予測係数Pが乗算されて加算されることにより4次の線形予測が行われて、次の元波形サンプルSnを圧縮処理するための次の線形予測サンプル◇Snが生成される。フレーム詰込部67には、残差符号のサンプルLnに加えて、線形予測係数PおよびスケールファクタSFとその他情報が供給されている。そして、副情報の領域に線形予測係数PおよびスケールファクタSFとその他情報が格納され、データ領域に残差符号のサンプルが格納されることにより小フレームが構成され、例えば10の小フレームにより図2に示すように1フレームが構成されるようになる。
【0025】
図4に示すようなフィードバックすることなく残差符号のサンプルを求める方法を、ここではAbS(Analysys by Synthesys)なしと定義し、図5に示すようにフィードバックすることにより残差符号のサンプルを求める方法をAbSありと定義する。
【0026】
次に、本発明の波形圧縮装置において実行される1フレーム分SF探索処理のフローチャートを図6に示す。
図6に示す1フレーム分SF探索処理おいて、スケールファクタの探索が開始されると、ステップS10において波形記憶領域12aから選択された波形データのサンプル(元波形サンプル)が1フレーム分取り出される。次いで、ステップS11にて取り出された1フレーム分のサンプルが、図4に示す初期SF算出部50に供給され線形予測係数Pが算出される。そして、ステップS12においてAbSなし、すなわち図4に示す初期SF算出部50に1フレーム分の元波形サンプルが順次供給されて、ピーク検出およびスケールファクタ算出部54にて1フレーム分の残差サンプルdnが求められる。この残差サンプルdnは予測信号の誤差分に相当し、ステップS13にて1フレーム分の残差サンプルdnの最大振幅が検出され、検出された最大振幅を所定の大きさ以下とできる理想的スケールファクタSFPが求められる。そして、ステップS14において理想的スケールファクタSFPから定数Dを差し引いて初期スケールファクタ(初期SF)を算出する。ここで、定数Dを差し引くのは、理想的スケールファクタSFPより小さめの初期スケールファクタ(初期SF)として万全を期すためである。ただし、スケールファクタは対数で表されているので、ステップS14では理想的スケールファクタSFPが定数Dで除算されることになる。
【0027】
次いで、ステップS15にて算出された線形予測係数Pおよび初期スケールファクタ(初期SF)に基づいてAbSあり、すなわち図5に示すコーダ60において残差符号のサンプルLnが求められる。そして、ステップS15にて求められた残差符号のサンプルLnに基づいて元波形との誤差であるノイズレベルがステップS16にて求められる。この場合、コーダ60にはステップS11にて算出された線形予測係数Pが線形予測部64に設定され、ステップS14にて算出された初期スケールファクタ(初期SF)がスケールファクタSFとして量子化部62および逆量子化部66に設定されている。ノイズレベルがステップS16にて求められると、ステップS17にてコーダ60に設定されているスケールファクタSFが最大値に達しているか否かが判断される。ここで、スケールファクタSFが最大値に達していないと判断された場合は、ステップS18に進む。
【0028】
ステップS18では、ステップS16で求められたノイズレベルが閾値より小さいか否かが判断され、ノイズレベルが閾値より大きいと判断された場合は、スケールファクタが適した大きさとなっていないことからステップS19へ分岐する。ステップS19では、スケールファクタと閾値とを1段階大きな値に変更してステップS15に戻るようになる。この新たなスケールファクタの値を反映させて、ステップS15ないしステップS18の処理を繰り返し行う。そして、ノイズレベルが閾値より小さいとステップS18において判断された際に1フレーム分SF探索処理は終了する。このように、1フレーム分におけるノイズレベルが閾値未満である場合に、適したスケールファクタとなったと判断しているが、ノイズレベルが瞬間的に閾値を超える場合はこれを無視して、ノイズレベルが平均的に閾値未満となる場合に適したスケールファクタになったと判断しても良い。また、閾値の大きさをスケールファクタの大きさに応じて変更するようにしたので、ノイズレベルの大きさをスケールファクタの大きさに応じて許容することができるようになる。
【0029】
なお、ステップS17においてスケールファクタSFが最大値に達している場合は、そのまま1フレーム分SF探索処理は終了する。このようにして探索されたスケールファクタSFを用いて元波形データを圧縮処理した残差符号のサンプルからなるフレーム化された波形データは、記憶手段に記憶されるようになる。また、ステップS18において、次の場合にノイズレベルが閾値より小さいと判断するものとする。
(1)残差サンプルdnのピーク値ではなく、残差サンプルdn(波形)の1フレーム期間における実効レベルが許容量子化誤差より小さい場合。
(2)1フレーム区間の残差サンプルdnのうち、所定の割合(例えば9割)以上が許容量子化誤差以内に含まれる場合。
(3)各残差サンプルdnが許容量子化誤差を超えた量(ないしその二乗)の、1フレーム区間にわたる積算値が所定の基準値より小さい場合。
【0030】
本発明の波形圧縮装置において実行される1フレーム分SF探索処理においては、以上説明したように初期スケールファクタを算出する際に波形データの1フレーム分のサンプルを最初に初期SF算出部50に供給して、予測係数Pと初期スケールファクタとを算出している。そして、算出した予測係数Pと初期スケールファクタとをコーダ60に設定し、スケールファクタを変更することで元波形サンプルと線形予測サンプルとの誤差であるノイズレベルが許容量子化誤差レベルとされる閾値より小さくなるまで、1フレーム分の元波形サンプルをコーダ60に繰り返し供給するようにしている。このように、波形圧縮装置においては、波形データの1フレーム分のサンプルを繰り返し読み出して処理することにより、当該波形データに適した圧縮処理を行うようにしている。このように、初期SF算出部50において初期スケールファクタを算出するようにしたので、コーダ60におけるスケールファクタを探索する回数を大幅に低減することができる。これにより、圧縮処理を高速に行うことができるようになる。
【0031】
以上の説明では、残差符号のサンプルのビット数は曲毎の波形データにおいては固定としたが、各フレーム毎に残差符号のサンプルのビット数を可変にし、副情報でそのビット数を指定するようにしてもよい。この場合、副情報におけるビット数の情報は、副情報デコード部34からアドレス発生部32や残差符号キャッシュ部33に供給される。
上記した本発明の波形圧縮装置においては、線形予測による圧縮伸長を行うようにしたが、適応差分などの線形予測以外の方式で圧縮伸長を行うようにしてもよい。
【0032】
【発明の効果】
本発明は以上説明したように、所定の区間における波形データを線形予測圧縮する際に、所定の区間において一定の値とされているスケールファクタは、残差データの各レベルが許容量子化誤差レベルをほとんど超えないようになる値とされている。これにより、所定の区間においてパルス的なノイズが入ってもその影響で所定の区間における量子化ノイズが増大することを防止することができる。また、許容量子化誤差レベルをスケールファクタの値に対応して変更するようにしたため、適切な許容量子化誤差レベルを設定することができる。さらに、初期スケールファクタ算出手段を設けて、前記波形データに対応する初期スケールファクタを算出するようにしたので、スケールファクタを探索する時間を短縮することができるようになる。
【図面の簡単な説明】
【図1】 本発明にかかる波形圧縮装置により圧縮された波形データがフレームを単位として記憶されている記憶手段を備える楽音生成装置のブロック図である。
【図2】 本発明にかかる波形圧縮装置により圧縮された波形データのデータ構造を示す図である。
【図3】 図1に示す楽音生成装置が備えるデコーダの詳細構成を示す図である。
【図4】 本発明の実施の形態にかかる波形圧縮装置が備える初期SF算出部の構成を示す図である。
【図5】 本発明の実施の形態にかかる波形圧縮装置が備えるコーダの構成を示す図である。
【図6】 本発明の実施の形態にかかる波形圧縮装置が実行する1フレーム分SF探索処理のフローチャートである。
【符号の説明】
1 楽音生成装置、10 CPU、11 ROM、12 RAM、12a 波形記憶領域、13 操作子、14 表示器、15 通信I/O、16 バスライン、20 制御レジスタ、30 音源部、31 フレーム読出部、32 アドレス発生部、33 残差符号キャッシュ部、34 副情報デコード部、35 デコーダ、36 補間部、37 音量EG部、38 ミキサ、39 DAC、40 サウンドシステム、50 初期SF算出部、51 予測係数算出部、52 線形予測部、53 減算器、54 ピーク検出およびスケールファクタ算出部、60 コーダ、61 減算器、62 量子化部、63 予測係数&スケールファクタ生成部、64 線形予測部、65 加算器、66 逆量子化部、67 フレーム詰込部、71 逆量子化部、72 加算器、73 線形予測演算部、74 波形データキャッシュ部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a waveform compression apparatus that compresses waveform data.
[0002]
[Prior art]
Conventionally, as one method of generating a musical sound signal in an electronic musical instrument, the instantaneous value of a musical sound waveform of a natural musical instrument is sequentially sampled and stored in advance as digital sample waveform data, and this sample is generated when a musical sound is generated. There is a PCM system in which waveform data is read to generate a musical sound signal. This PCM method is excellent in that it can generate musical sounds close to natural instruments, but the capacity of the memory for storing waveform data has become enormous. Therefore, in order to reduce the amount of waveform data, the waveform data is compressed, the compressed waveform data is stored in the memory, and the compressed waveform data is expanded during reproduction to generate a musical signal. An apparatus has been proposed (see, for example, Patent Document 1).
Also, a waveform memory sound source using a waveform memory is known in which waveform data is linearly predicted and compressed by a waveform compression device to obtain compressed waveform data, and the compressed waveform data is stored in a waveform memory. (For example, refer to Patent Document 2). In this waveform compression apparatus, compressed waveform data is stored as variable bit length in units of frames. Further, level downshift processing is performed before or after the compressed waveform data processing for obtaining compressed waveform data, and the compressed waveform data after the level downshift processing is densely stored in the memory.
[0003]
[Problems to be solved by the invention]
In such a waveform compression apparatus, the data is compressed and stored in order to reduce the data amount of the compressed waveform data, but the shift down amount is controlled and expanded based on the limit bit length. There is a problem that the degree of deterioration of the quality of the waveform data is not taken into consideration. This shift-down amount is based on the residual data peak in the frame. If pulse-like noise enters the frame, the frame shift amount becomes unreasonably large due to the influence of quantization noise. There has been a problem that increases. Further, since the search for the shift data is performed using a predetermined value not related to the characteristics of the waveform data as an initial value, there is a problem that the search takes time.
[0004]
Therefore, an object of the present invention is to provide a waveform compression apparatus that can compress waveform data using a scale factor that gives quantization accuracy.
[0005]
[Patent Document 1]
Patent No. 2605434
[Patent Document 2]
Japanese Patent No. 2727798
[0006]
[Means for Solving the Problems]
In order to achieve the above object, the waveform compression apparatus according to the present invention, when performing linear predictive compression on waveform data in a predetermined section, a scale factor that is a constant value in the predetermined section is a residual. A scale factor whose noise level based on the code sample is smaller than the threshold It is said that. Thereby, even if pulse noise enters in a predetermined section, it is possible to prevent the quantization noise in the predetermined section from increasing due to the influence. Also, Threshold Is changed according to the value of the scale factor. Conversion An error level can be set. Furthermore, since the initial scale factor calculation means is provided to calculate the initial scale factor corresponding to the waveform data, the time for searching for the scale factor can be shortened.
[0008]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 shows a block diagram of a musical tone generation apparatus including a storage means in which waveform data compressed by the waveform compression apparatus according to the present invention is stored in units of frames. In the musical
[0009]
The
[0010]
Next, before describing the
FIG. 2 shows waveform data for one piece of compressed waveform data stored in the
[0011]
In this case, the number of bits of the sub information is a predetermined number of bits, and the number of bits of one sample of the residual code is determined for each waveform data so as to be suitable for the properties of the original waveform data before compression. The number of bits is fixed. When the data width of the small frame is 16 bits as shown in FIG. 2 and the number of bits of one sample of the residual code is fixed to 3 bits, for example, a 4-bit data area is allocated to the sub information. A 12-bit data area is allocated to the residual code, and the number of samples in one small frame is 4. When the number of bits of one sample of the residual code is fixed to 6 bits, the number of samples of one small frame is 2 as shown in the lower stage of the residual code in FIG. Similarly, if the number of bits of one sample of the residual code that is fixed is 4 bits, the number of samples of one small frame is 3 as shown in the lower stage of the residual code in FIG. If the number of bits of one sample of the residual code is 2 bits, the number of samples of one small frame is 6 as shown in the lower stage of the residual code in FIG. When the data width of a small frame is 16 bits, the number of bits constituting one frame is 160 bits, of which 40-bit data area is sub-information area and the remaining 120-bit data area is remaining. This is the difference code area. As described above, the number of samples of the residual code in one frame or one small frame is changed according to the number of bits of one sample of the residual code fixed for each music piece.
[0012]
By the way, the sub information includes prediction coefficient information which is a linear prediction coefficient used for decompressing the residual code of the next frame, a scale factor used for decompressing the residual code of the next frame, and other information. The scale factor is a factor for denormalizing a plurality of residual codes constituting one frame. In this case, if the scale factor is stored not as an absolute value but as a ratio between frames or a difference in logarithmic scale, the efficiency of the information amount with respect to the number of bits can be improved. When the scale factor is a ratio between frames or a difference in logarithmic scale, it is converted into an absolute value at the time of inverse quantization and multiplied by a residual code. Other information may be information such as volume information and loop address of waveform data.
[0013]
Next, the
[0014]
Each time a request pulse output from the sample counter of the
[0015]
In the residual
[0016]
Here, when a sound generation start instruction (note-on) is generated by operation of a performance operator, automatic performance, input from the communication I /
(1) One of a plurality of sound generation channels of the
(2) One of the waveform data stored in the
(3) Read the header of the selected waveform data, and read the number of bits of the residual code, the read start address, the read end address, the loop address, the prediction coefficient of the first frame, the scale factor and other data, Set to area. Each address in this case may be an address in units of frames.
(4) Write note-on in the sounding channel area.
As a result, the generation of the musical tone is started in the
[0017]
Next, an example of the configuration of the
[0018]
The waveform
[0019]
Returning to FIG. 1, the decompressed restored waveform data output from the
[0020]
As described above, in the musical
[0021]
Next, FIG. 4 and FIG. 5 show the configuration of the waveform compression apparatus of the present invention that performs compression processing of waveform data using linear prediction.
The waveform compression apparatus according to the present invention includes an initial SF calculation unit 50 shown in FIG. 4 to be described later, a coder 60 and a
[0022]
The initial SF calculation unit 50 shown in FIG. 4 includes a sample (hereinafter referred to as “original waveform sample”) S of original waveform data selected from the
[0023]
The initial scale factor (initial SF) and the prediction coefficient P calculated in this way are set in the prediction coefficient & scale
[0024]
The residual code sample Ln is output as compressed waveform data from the coder 60 and supplied to the
[0025]
A method for obtaining a residual code sample without feedback as shown in FIG. 4 is defined here as AbS (Analysys by Synthesys), and the residual code sample is obtained by feedback as shown in FIG. Define the method as AbS.
[0026]
Next, FIG. 6 shows a flowchart of the SF search process for one frame executed in the waveform compression apparatus of the present invention.
In the SF search process for one frame shown in FIG. 6, when the search for the scale factor is started, the sample of waveform data (original waveform sample) selected from the
[0027]
Next, AbS is present based on the linear prediction coefficient P and the initial scale factor (initial SF) calculated in step S15, that is, the residual code sample Ln is obtained in the coder 60 shown in FIG. Then, a noise level that is an error from the original waveform is obtained in step S16 based on the residual code sample Ln obtained in step S15. In this case, the linear prediction coefficient P calculated in step S11 is set in the
[0028]
In step S18, it is determined whether or not the noise level obtained in step S16 is smaller than the threshold value. If it is determined that the noise level is larger than the threshold value, the scale factor is not an appropriate size, so that step S19 is performed. Branch to In step S19, the scale factor and the threshold value are changed to a value larger by one step, and the process returns to step S15. The process of step S15 to step S18 is repeated by reflecting this new scale factor value. Then, when it is determined in step S18 that the noise level is smaller than the threshold value, the SF search process for one frame ends. As described above, when the noise level in one frame is less than the threshold, it is determined that the scale factor is suitable. However, if the noise level instantaneously exceeds the threshold, this is ignored and the noise level is ignored. It may be determined that the scale factor is suitable when the average value is less than the threshold value. In addition, since the threshold value is changed according to the scale factor, the noise level can be allowed according to the scale factor.
[0029]
If the scale factor SF has reached the maximum value in step S17, the SF search process for one frame is finished as it is. The framed waveform data composed of the residual code samples obtained by compressing the original waveform data using the scale factor SF searched in this way is stored in the storage means. In step S18, it is determined that the noise level is smaller than the threshold value in the following case.
(1) When the effective level in one frame period of the residual sample dn (waveform) is smaller than the allowable quantization error instead of the peak value of the residual sample dn.
(2) A case where a predetermined ratio (for example, 90%) or more of the residual samples dn in one frame section is included within the allowable quantization error.
(3) When the integrated value over one frame section of the amount (or its square) that each residual sample dn exceeds the allowable quantization error is smaller than a predetermined reference value.
[0030]
In the SF search process for one frame executed in the waveform compression apparatus of the present invention, as described above, when calculating the initial scale factor, the sample for one frame of the waveform data is first supplied to the initial SF calculation unit 50. Thus, the prediction coefficient P and the initial scale factor are calculated. Then, the calculated prediction coefficient P and the initial scale factor are set in the coder 60, and the threshold at which the noise level, which is the error between the original waveform sample and the linear prediction sample, is changed to the allowable quantization error level by changing the scale factor. The original waveform sample for one frame is repeatedly supplied to the coder 60 until it becomes smaller. As described above, in the waveform compression apparatus, compression processing suitable for the waveform data is performed by repeatedly reading and processing the sample for one frame of the waveform data. Thus, since the initial scale factor is calculated in the initial SF calculation unit 50, the number of times the coder 60 searches for the scale factor can be significantly reduced. As a result, the compression process can be performed at high speed.
[0031]
In the above description, the number of bits of the residual code sample is fixed in the waveform data for each song, but the number of bits of the residual code sample is variable for each frame, and the number of bits is specified by the sub information. You may make it do. In this case, information on the number of bits in the sub information is supplied from the sub
In the waveform compression apparatus of the present invention described above, compression / expansion is performed by linear prediction, but compression / expansion may be performed by a method other than linear prediction such as adaptive difference.
[0032]
【The invention's effect】
As described above, according to the present invention, when linear prediction compression is performed on waveform data in a predetermined section, the scale factor that is set to a constant value in the predetermined section indicates that each level of the residual data has an allowable quantization error level. It is assumed that the value will not exceed. Thereby, even if pulse noise enters in a predetermined section, it is possible to prevent the quantization noise in the predetermined section from increasing due to the influence. Further, since the allowable quantization error level is changed according to the value of the scale factor, an appropriate allowable quantization error level can be set. Furthermore, since the initial scale factor calculation means is provided to calculate the initial scale factor corresponding to the waveform data, the time for searching for the scale factor can be shortened.
[Brief description of the drawings]
FIG. 1 is a block diagram of a musical sound generating apparatus including storage means in which waveform data compressed by a waveform compression apparatus according to the present invention is stored in units of frames.
FIG. 2 is a diagram showing a data structure of waveform data compressed by the waveform compression apparatus according to the present invention.
FIG. 3 is a diagram showing a detailed configuration of a decoder included in the musical sound generating device shown in FIG. 1;
FIG. 4 is a diagram illustrating a configuration of an initial SF calculation unit included in the waveform compression device according to the embodiment of the present invention.
FIG. 5 is a diagram showing a configuration of a coder included in the waveform compression device according to the embodiment of the present invention.
FIG. 6 is a flowchart of SF search processing for one frame executed by the waveform compression apparatus according to the embodiment of the present invention.
[Explanation of symbols]
DESCRIPTION OF
Claims (4)
該供給手段から供給された波形データのサンプルから線形予測圧縮するための予測係数を決定する予測係数決定手段と、
前記供給手段から供給された波形データのサンプルと予測サンプルとの残差である残差サンプルを、量子化精度を与えるスケールファクタに基づいて正規化し、正規化された前記残差サンプルを符号化して、残差符号のサンプルとして出力する量子化手段と、
該量子化手段から出力された前記残差符号のサンプルを復号化し、前記スケールファクタに基づいて逆正規化し、復号残差サンプルとして出力する逆量子化手段と、
該逆量子化手段から出力された前記復号残差サンプルと前記予測サンプルとを加算して生成した復号サンプルを、前記予測係数に基づいて線形予測して、次波形データの線形予測圧縮に用いる前記予測サンプルを出力する線形予測手段とを備え、
前記スケールファクタは、所定の区間における前記波形データのサンプルを線形予測圧縮する際に、所定の区間において一定の値とされていると共に、前記波形データに対応する初期スケールファクタが初期スケールファクタ算出手段により算出されるようになされており、
該初期スケールファクタ算出手段で算出された前記初期スケールファクタを初期値として、前記スケールファクタの値を変更しながら前記所定の区間における複数の前記波形データのサンプルを順次前記量子化手段に供給することにより得られた前記スケールファクタ毎の前記残差符号のサンプルに基づくノイズレベルが閾値より小さくなる大きさのスケールファクタを探索し、当該スケールファクタを所定の区間における前記波形データの圧縮に用いる前記スケールファクタとして決定するようにしたことを特徴とする波形圧縮装置。Supply means for supplying waveform data to be compressed;
Prediction coefficient determination means for determining a prediction coefficient for linear prediction compression from a sample of waveform data supplied from the supply means;
A residual sample, which is a residual between a sample of waveform data supplied from the supply means and a prediction sample, is normalized based on a scale factor that provides quantization accuracy, and the normalized residual sample is encoded. Quantizing means for outputting as a residual code sample;
Dequantizing means for decoding the residual code sample output from the quantizing means, denormalizing based on the scale factor, and outputting as a decoded residual sample;
The decoded sample generated by adding the decoded residual sample and the prediction sample output from the inverse quantization means is linearly predicted based on the prediction coefficient, and used for linear prediction compression of the next waveform data. Linear prediction means for outputting a prediction sample,
The scale factor is set to a constant value in the predetermined section when the waveform data sample in the predetermined section is subjected to linear predictive compression, and the initial scale factor corresponding to the waveform data is an initial scale factor calculating means. Is calculated by
Using the initial scale factor calculated by the initial scale factor calculating means as an initial value, sequentially supplying a plurality of waveform data samples in the predetermined section to the quantizing means while changing the scale factor value. The scale factor of which the noise level based on the sample of the residual code for each of the scale factors obtained by the above is searched for is smaller than a threshold value, and the scale factor is used for compressing the waveform data in a predetermined section A waveform compression apparatus characterized by being determined as a factor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003082923A JP3933072B2 (en) | 2003-03-25 | 2003-03-25 | Wave compressor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003082923A JP3933072B2 (en) | 2003-03-25 | 2003-03-25 | Wave compressor |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2004294491A JP2004294491A (en) | 2004-10-21 |
JP3933072B2 true JP3933072B2 (en) | 2007-06-20 |
Family
ID=33398549
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003082923A Expired - Lifetime JP3933072B2 (en) | 2003-03-25 | 2003-03-25 | Wave compressor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3933072B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008170488A (en) | 2007-01-06 | 2008-07-24 | Yamaha Corp | Waveform compressing apparatus, waveform decompressing apparatus, program and method for producing compressed data |
JP5262171B2 (en) * | 2008-02-19 | 2013-08-14 | 富士通株式会社 | Encoding apparatus, encoding method, and encoding program |
-
2003
- 2003-03-25 JP JP2003082923A patent/JP3933072B2/en not_active Expired - Lifetime
Also Published As
Publication number | Publication date |
---|---|
JP2004294491A (en) | 2004-10-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7692087B2 (en) | Compressed data structure and apparatus and method related thereto | |
US5744739A (en) | Wavetable synthesizer and operating method using a variable sampling rate approximation | |
US6096960A (en) | Period forcing filter for preprocessing sound samples for usage in a wavetable synthesizer | |
JP2002335161A (en) | Signal processor and processing method, signal encoder and encoding method, signal decoder and decoding method | |
US8706506B2 (en) | Waveform compressing apparatus, waveform decompressing apparatus, and method of producing compressed data | |
JP3933072B2 (en) | Wave compressor | |
US20050188819A1 (en) | Music synthesis system | |
US20030108108A1 (en) | Decoder, decoding method, and program distribution medium therefor | |
KR20060125484A (en) | Methods, devices and circuits for compressing and decompressing data | |
JP2003511776A (en) | Method and apparatus for interpolating digital signals | |
JP3826870B2 (en) | Compressed data structure, waveform generation device, and waveform storage device | |
JP3933073B2 (en) | Waveform expansion device | |
JP4107085B2 (en) | Waveform data compression method | |
JP2796408B2 (en) | Audio information compression device | |
JP4007194B2 (en) | Sound generator | |
JP3912304B2 (en) | Compressed data structure, waveform generation device, and waveform storage device | |
Maher | Wavetable synthesis strategies for mobile devices | |
JP4538705B2 (en) | Digital signal processing method, learning method and apparatus, and program storage medium | |
JP3603343B2 (en) | Waveform reading device | |
JP3945435B2 (en) | Waveform data compression method, tone signal generation method, tone signal processing apparatus, and program | |
JPH02146599A (en) | Sound source data compressing and encoding method | |
Maher | Compression and decompression of wavetable synthesis data | |
JP3747357B2 (en) | Music signal encoding apparatus and decoding apparatus | |
JP3353482B2 (en) | Audio coding device | |
JP2000132195A (en) | Signal encoding device and method therefor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050927 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20060906 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20061003 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20061110 |
|
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: 20070227 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20070312 |
|
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: 20110330 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110330 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120330 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130330 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140330 Year of fee payment: 7 |