[go: up one dir, main page]

JP3933072B2 - Wave compressor - Google Patents

Wave compressor Download PDF

Info

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
Application number
JP2003082923A
Other languages
Japanese (ja)
Other versions
JP2004294491A (en
Inventor
雅嗣 岡▲崎▼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yamaha Corp
Original Assignee
Yamaha Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yamaha Corp filed Critical Yamaha Corp
Priority to JP2003082923A priority Critical patent/JP3933072B2/en
Publication of JP2004294491A publication Critical patent/JP2004294491A/en
Application granted granted Critical
Publication of JP3933072B2 publication Critical patent/JP3933072B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

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 sound generating apparatus 1 shown in FIG. 1, the CPU 10 is a central processing unit that controls the operation of musical sound generation in the musical sound generating apparatus 1 by executing various programs related to musical sound generation. That is, when a sound generation start instruction (note-on) is generated by operating the performance operator, automatic performance, input from the communication I / O, or the like, generation of a tone corresponding to the sound generation start instruction is started to the sound source unit 30. I am instructing. A ROM (Read Only Memory) 11 is, for example, a flash ROM, and stores a program for musical tone generation processing executed by the CPU 10 and various data. A RAM (Random Access Memory) 12 is a main memory in the musical sound generation apparatus 1 and includes a waveform storage area 12a in which waveform data compressed by the waveform compression apparatus according to the present invention is stored in units of frames. This is a rewritable storage means in which an area such as a work area of the CPU 10 is set. The waveform storage area 12a can store a plurality of pieces of compressed waveform data.
[0009]
The operation element 13 is a performance operation element such as a keyboard or a panel switch for performing various settings, and the display unit 14 is a display unit including a liquid crystal or the like for displaying various types of information when a musical sound is generated. The communication I / O 15 is a network interface for connecting to a server computer via a communication network such as a LAN (Local Area Network), the Internet, or a telephone line. Via this communication I / O 15, it is possible to send out a MIDI message created inside the musical tone generating device 1 and to receive a MIDI message from the outside. The control register 20 is a register in which the sound generation parameters of each sound generation channel are written from the CPU 10. The sound source unit 30 includes a decoder that performs decompression processing of waveform data that is compressed in units of frames. Based on the control of the CPU 10, the compressed waveform necessary for generating musical sounds from the waveform storage area 12a of the RAM 12 is provided. Data is read for each small frame, which will be described later, and the read waveform data is expanded. Then, processing such as interpolation of the decoded waveform data, envelope addition, channel accumulation (mixing), and effect (effect) addition are performed and output as musical sound waveform data. The musical sound waveform data output from the sound source unit 30 is converted into an analog signal and emitted from the sound system 40. Each unit is connected via a bus line 16.
[0010]
Next, before describing the sound source unit 30, the data structure of the compressed waveform data stored in the waveform storage area 12a of the RAM 12 will be described with reference to FIG.
FIG. 2 shows waveform data for one piece of compressed waveform data stored in the waveform storage area 12a. The waveform data shown in FIG. 2 includes header information in which information related to the entire waveform data is written, and frames 1 to n in which compressed waveform data is accommodated. The header information includes the number of bits of the residual code sample, the reading start address, the reading end address, the loop address, the prediction coefficient and scale factor of the first frame, and other data. The data structure of each frame in which the residual code sample, which is compressed waveform data, is written is the same. FIG. 2 shows the data structure of frame 2 as an example. For example, one frame has a data amount corresponding to 10 addresses from “00” to “09” as shown in the figure, and the data width corresponding to one address can be defined as a small frame. That is, one frame shown in FIG. 2 is composed of ten small frames. This small frame consists of sub information and a residual code.
[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 sound generator 30 will be described. The address generator 32 generates a sample counter for accumulating frequency information (F number) and a read address for reading waveform data from the waveform storage area 12a in the RAM 12 for each small frame. A memory counter is provided. The sample counter accumulates the F number which is the pitch shift amount of the waveform data corresponding to the specified pitch, generates a sample address consisting of an integer part and a decimal part, and uses the integer part as a residual code cache The remaining fractional parts are supplied to the unit 33 to the interpolation unit 36, respectively. A request pulse is output every time the integer part of the sample address reaches the number of samples in the small frame. Note that the number of samples in the small frame differs depending on the number of bits of one sample of the residual code as described above with reference to FIG. The memory counter of the address generator 32 generates a read address for reading out a small frame by incrementing the memory address by one each time a request pulse is input from the sample counter.
[0014]
Each time a request pulse output from the sample counter of the address generator 32 is input, the frame reading unit 31 is a small frame indicated by a memory address supplied from the waveform storage area 12a of the RAM 12 from the memory counter of the address generator 32. Read the data. The sub information in the read small frame data is supplied to the sub information decoding unit 34, and the residual code sample of the read small frame data is supplied to the residual code cache unit 33. In the sub information decoding unit 34, sub information of each small frame supplied from the frame reading unit 31 is sequentially collected in a period of one frame, and each data of the sub information is decoded. The decoded prediction coefficient information and scale factor are supplied to the decoder 35 and other data are supplied to each block of the sound source unit 30 during the next frame period of the frame. That is, the sub information of each frame is not sub frame but used in the next frame.
[0015]
In the residual code cache unit 33, the latest three small frames among the read small frames are held in the cache. Then, according to the integer part of the sample address from the address generation unit 32, a number of residual code samples corresponding to the amount of progress of the integer part are taken out from the three cached small frames, and the taken out residual is obtained. Code samples are sent to the decoder 35. In the decoder (cache) 35, every time a residual code sample is sent from the residual code cache unit 33, the residual code sample is decoded by fourth-order linear prediction expansion to obtain a restored waveform sample. . For example, 4 samples of the restored waveform samples are stored in the waveform data cache in the decoder 35.
[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 / O 15 or the like, the CPU 10 sends a tone corresponding to the sound generation start instruction to the sound source unit 30. The generation start is instructed. The procedure in this case is as follows. Depending on the note-on (part PT, pitch N, intensity V)
(1) One of a plurality of sound generation channels of the sound source unit 30 is assigned to the generation of the musical sound.
(2) One of the waveform data stored in the waveform storage area 12a is selected based on the timbre data (on the RAM 12) currently selected in the part PT, and the pitch shift amount, volume EG parameter, LFO parameter, The output level and the like are set in the tone generation channel area assigned by the control register 20.
(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 sound source unit 30.
[0017]
Next, an example of the configuration of the decoder 35 in the sound source unit 30 is shown in FIG. Residual code sample L supplied from the residual code cache unit 33 n Is the sample L based on the bit number information of the residual code sample in the inverse quantization unit 71 in the decoder 35. n Each sample L based on a scale factor SF that is extracted every time and gives quantization accuracy n Are denormalized and dequantized. As a result, the residual code sample L from the inverse quantization unit 71. n A decoded waveform sample qn decoded every time is output. The decoded waveform sample qn is supplied to the adder 72 and output from the linear prediction calculation unit 73. n-1 Is added to restore waveform sample ◇ X n Is restored. Restored waveform sample ◇ X n Is cached in the waveform data cache unit 74 and decompressed restored waveform sample ◇ X n Is output as
[0018]
The waveform data cache unit 74 has four restored waveform samples ◇ X from the present to the past. n ~ ◇ X n-3 (D1 to D4) are cached, and the four restored waveform samples D1 to D4 cached are supplied to the linear prediction calculation unit 73. The linear prediction calculation unit 73 performs the fourth-order linear prediction by multiplying the four restored waveform samples D1 to D4 by the linear prediction coefficients P of the respective orders and adds them, and the next restored waveform sample ◇ X n + 1 Linear prediction sample to obtain ◇ S n Is generated. The bit number information of the residual code sample Ln is supplied from the sub information decoding unit 34 by decoding the header of the compressed waveform data in the sub information decoding unit 34, and is supplied with the scale factor SF and linearity. As described above, the prediction coefficient P is decoded and supplied by the sub information decoding unit 34.
[0019]
Returning to FIG. 1, the decompressed restored waveform data output from the decoder 35 is supplied to the interpolation unit 36. In this case, the four restored waveform samples D1 to D4 cached in the waveform data cache unit 74 in the decoder 35 are supplied to the interpolation unit 36. Based on the fractional part of the sample address from the address generation unit 32, the interpolation unit 36 interpolates the supplied four restored waveform samples D1 to D4, for example, to generate an interpolation sample. The volume of the interpolated sample output from the interpolation unit 36 is controlled by the volume EG unit 37 based on the volume EG parameter set in the control register 20 when the note is turned on, and is supplied to the mixer 38. In the mixer 38, waveform samples in all sound generation channels are accumulated, and an effect is given and output at every reproduction timing. The output from the mixer 38 is supplied to a digital-analog converter (DAC) 39 to be converted into an analog signal and emitted from the sound system 40.
[0020]
As described above, in the musical sound generating apparatus 1 according to the embodiment of the present invention, the waveform data is stored in the waveform storage area 12a in the format shown in FIG. 2, and the sound source unit 30 reproduces the residual code. Therefore, by sequentially reading out the small frames constituting the frame, the residual code samples necessary for the reproduction of each frame are sequentially taken out, and at the same time, sub information for expanding the residual code of the next frame is provided. It comes to be taken out. That is, the sound source unit 30 does not require a dedicated circuit for taking out the sub information in a timely manner, and the sub information of each subframe and the number of bits of the residual code are fixed. A configuration for extracting information and a residual code can also be made extremely simple.
[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 frame filling unit 67 shown in FIG. That is, in the waveform compression apparatus, the original waveform data is compressed to the number of bits k, and is framed and output. At this time, the scale factor search is performed in the waveform compression apparatus. In the search for the scale factor, the coder 60 sequentially supplies a plurality of samples of the original waveform data in the section of one frame to the quantizing unit 62 while changing the value of the scale factor, and the scale factor set at that time is used. A search is made for a scale factor value at which each level of the obtained residual sample dn of one frame hardly exceeds the allowable quantization error level. In this case, the scale factor is gradually increased to search for a suitable scale factor. However, since the scale factor is repeatedly set, the search time becomes longer. Thus, the initial scale factor corresponding to the nature of the original waveform data is calculated first so that the scale factor search time is shortened. The configuration for calculating the initial scale factor is the initial SF calculation unit 50 shown in FIG.
[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 waveform storage area 12a. n Is supplied for one frame. Then, in the prediction coefficient calculation unit 51, an original waveform sample S for one frame. n The linear prediction coefficient P is calculated based on the above, and the calculated linear prediction coefficient P is supplied to the linear prediction unit 52. The linear prediction unit 52 multiplies and adds the linear prediction coefficient P corresponding to the order to, for example, four samples from the present to the past, which are delayed by the delay means, and adds them. n-1 Has been generated. This linear prediction sample ◇ S n-1 Is supplied to the subtractor 53 and the original waveform sample S n The subtractor 53 outputs a residual sample dn. The residual sample dn is supplied to the peak detection and scale factor calculation unit 54 to which the bit number k of the residual code sample is given, and the peak of the residual sample dn is obtained. That is, the original waveform sample S for one frame n Are sequentially supplied, and when the residual sample dn for one frame is supplied to the peak detection and scale factor calculation unit 54, the peak value of the residual sample dn is detected, and the residual of the detected peak value is detected. An ideal scale factor SFP that is large enough to normalize and quantize the difference sample dn without overflowing with a given number of bits k is calculated. The constant D is subtracted from the ideal scale factor SFP thus calculated, and the initial scale factor (initial SF) is output from the initial SF calculator 50.
[0023]
The initial scale factor (initial SF) and the prediction coefficient P calculated in this way are set in the prediction coefficient & scale factor generation unit 63 of the coder 60 shown in FIG. 5 in the waveform compression apparatus. And the original waveform sample S before compression processing n Is input to the subtractor 61, and this original waveform sample S n Linear prediction sample ◇ S output from the linear prediction unit 64 n-1 Are subtracted and the residual sample dn (= S n -◇ S n-1 ) Is output. The linear prediction coefficient P set in the prediction coefficient & scale factor generation unit 63 is supplied to the linear prediction unit 64, and the initial scale factor (initial SF) is supplied as the scale factor SF to the quantization unit 62 and the inverse quantization unit 66. The Here, the residual sample dn output from the subtractor 61 is normalized by the quantization unit 62 based on the supplied scale factor SF, and then is quantized and scaled to the set number of bits k. , A residual code sample Ln is generated.
[0024]
The residual code sample Ln is output as compressed waveform data from the coder 60 and supplied to the frame stuffing unit 67, where a frame consisting of small frames is generated and output. Further, the residual code sample Ln is supplied to the inverse quantization unit 66, and is subjected to inverse normalization and inverse quantization to output a decoded waveform sample qn obtained by decoding the residual code sample Ln. The decoded waveform sample qn is added to the linear prediction sample ◇ S output from the linear prediction unit 64 in the adder 65. n-1 Is added to restore waveform sample ◇ X n Is restored and supplied to the linear prediction unit 64. The linear prediction unit 64 performs fourth-order linear prediction by multiplying and adding, for example, the four restored waveform samples from the present to the past, which are delayed by the delay means, with the respective linear prediction coefficients P. The next original waveform sample S n Next linear prediction sample for compressing ◇ S n Is generated. The frame stuffing portion 67 includes a residual code sample L n In addition, the linear prediction coefficient P and the scale factor SF and other information are supplied. Then, a linear prediction coefficient P and a scale factor SF and other information are stored in the sub information area, and a residual code sample is stored in the data area, and a small frame is formed. As shown in FIG. 1, one frame is configured.
[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 waveform storage area 12a is extracted for one frame in step S10. Next, the sample for one frame taken out in step S11 is supplied to the initial SF calculation unit 50 shown in FIG. 4, and the linear prediction coefficient P is calculated. In step S12, there is no AbS, that is, the original waveform samples for one frame are sequentially supplied to the initial SF calculation unit 50 shown in FIG. 4, and the residual sample dn for one frame is supplied by the peak detection and scale factor calculation unit 54. Is required. This residual sample dn corresponds to the error of the prediction signal, and the maximum scale of the residual sample dn for one frame is detected in step S13, and an ideal scale that can make the detected maximum amplitude equal to or smaller than a predetermined size. A factor SFP is determined. In step S14, an initial scale factor (initial SF) is calculated by subtracting a constant D from the ideal scale factor SFP. Here, the reason for subtracting the constant D is to make sure that the initial scale factor (initial SF) is smaller than the ideal scale factor SFP. However, since the scale factor is expressed in logarithm, the ideal scale factor SFP is divided by the constant D in step S14.
[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 linear prediction unit 64 in the coder 60, and the initial scale factor (initial SF) calculated in step S14 is the quantization factor 62 as the scale factor SF. And the inverse quantization unit 66 is set. When the noise level is obtained in step S16, it is determined in step S17 whether or not the scale factor SF set in the coder 60 has reached the maximum value. If it is determined that the scale factor SF has not reached the maximum value, the process proceeds to step S18.
[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 information decoding unit 34 to the address generation unit 32 and the residual code cache unit 33.
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 SYMBOLS 1 Musical sound production | generation apparatus, 10 CPU, 11 ROM, 12 RAM, 12a Waveform storage area, 13 Operator, 14 Display, 15 Communication I / O, 16 Bus line, 20 Control register, 30 Sound source part, 31 Frame reading part, 32 Address generator, 33 Residual code cache, 34 Sub information decoder, 35 Decoder, 36 Interpolator, 37 Volume EG, 38 Mixer, 39 DAC, 40 Sound system, 50 Initial SF calculator, 51 Prediction coefficient calculation Unit, 52 linear prediction unit, 53 subtractor, 54 peak detection and scale factor calculation unit, 60 coder, 61 subtractor, 62 quantization unit, 63 prediction coefficient & scale factor generation unit, 64 linear prediction unit, 65 adder, 66 Inverse quantization unit, 67 Frame filling unit, 71 Inverse quantization unit, 72 Adder, 73 Linear prediction operation unit, 74 waves Data cache unit

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.
前記閾値が、設定されている前記スケールファクタの大きさに対応して変更されるようになされていることを特徴とする請求項1記載の波形圧縮装置。2. The waveform compression apparatus according to claim 1, wherein the threshold value is changed in accordance with the set scale factor. 前記初期スケールファクタ算出手段は、前記供給手段から供給された波形データから線形予測圧縮するための初期予測係数を決定する初期予測係数決定手段と、該初期予測係数決定手段で決定された前記初期予測係数に基づいて線形予測することにより初期予測サンプルを出力する初期線形予測手段と、前記供給手段から供給された所定の区間の波形データのサンプルと前記初期予測サンプルとの残差を量子化した残差符号のサンプルを順次得て、その残差符号のサンプルの内のピーク値に応じた前記初期スケールファクタを算出する初期スケールファクタ決定手段とからなることを特徴とする請求項1記載の波形圧縮装置。 The initial scale factor calculation means, an initial prediction coefficient determining means for determining an initial prediction coefficients for linear prediction compressed from the waveform data supplied from said supply means, said initial estimate determined by the initial prediction coefficient determining means An initial linear prediction unit that outputs an initial prediction sample by performing linear prediction based on a coefficient; and a residual obtained by quantizing a residual between a sample of waveform data in a predetermined section supplied from the supply unit and the initial prediction sample. 2. The waveform compression according to claim 1, further comprising initial scale factor determination means for sequentially obtaining differential code samples and calculating the initial scale factor in accordance with a peak value of the residual code samples. apparatus. 前記初期スケールファクタ決定手段により算出される前記初期スケールファクタが、前記残差データの内のピーク値に応じたスケールファクタから所定値差し引かれた大きさのスケールファクタとされていることを特徴とする請求項3記載の波形圧縮装置。  The initial scale factor calculated by the initial scale factor determining means is a scale factor having a magnitude obtained by subtracting a predetermined value from a scale factor corresponding to a peak value in the residual data. The waveform compression apparatus according to claim 3.
JP2003082923A 2003-03-25 2003-03-25 Wave compressor Expired - Lifetime JP3933072B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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