JP3884131B2 - Data compression device and data decompression device - Google Patents

Data compression device and data decompression device Download PDF

Info

Publication number
JP3884131B2
JP3884131B2 JP21512597A JP21512597A JP3884131B2 JP 3884131 B2 JP3884131 B2 JP 3884131B2 JP 21512597 A JP21512597 A JP 21512597A JP 21512597 A JP21512597 A JP 21512597A JP 3884131 B2 JP3884131 B2 JP 3884131B2
Authority
JP
Japan
Prior art keywords
data
phrase
compressed
mantissa
decompression
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 - Fee Related
Application number
JP21512597A
Other languages
Japanese (ja)
Other versions
JPH1152996A (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.)
Roland Corp
Original Assignee
Roland 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 Roland Corp filed Critical Roland Corp
Priority to JP21512597A priority Critical patent/JP3884131B2/en
Publication of JPH1152996A publication Critical patent/JPH1152996A/en
Application granted granted Critical
Publication of JP3884131B2 publication Critical patent/JP3884131B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Electrophonic Musical Instruments (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、音声データの連続からなるフレーズデータにデータ圧縮処理を施すデータ圧縮装置、音声フレーズを表す、圧縮されたフレーズデータにデータ伸長処理を施すデータ伸長装置に関する。尚、本発明において音声とは、人間の声の他、楽音や効果音など可聴域の音全てを含む概念をいう。
【0002】
【従来の技術】
従来から、音声フレーズを表すフレーズデータを記憶媒体に記憶したり、通信媒体を介して送受信することが広く行われている。この場合、フレーズデータにデータ圧縮を施して圧縮データを生成し、この圧縮データを記憶したり、送受信すると記憶容量や通信時間が少なくて済むので経済的である。また、経済性をより高めるためにはより高い圧縮率を有する圧縮処理を施す方がよい。しかし、より高い圧縮率を有する圧縮処理が施されて生成された圧縮データに基づいて再生された楽音は音質がより低下しがちなので、再生される楽音の音質を許容範囲内に維持するためには、より低い圧縮率を有する圧縮処理を選ぶ必要がある。従って経済性と音質との兼ね合いで所望の圧縮率が決まり、その所望の圧縮率を有する圧縮処理が選ばれることとなる。
【0003】
【発明が解決しようとする課題】
ところで、音声には、ピアノの演奏音等のように高い音質を必要とする音声(楽音)もあれば、ノイズ状の効果音などのように低い音質でもよい音声もある。従って、経済性と音質との兼ね合いで決まる所望の圧縮率は音声の種類に応じて変わるので、その音声の種類に応じた所望の圧縮率を有する圧縮処理を選んで圧縮データを生成することが望ましい。
【0004】
しかし、このように生成された、複数の種類の音声を表す、圧縮率が異なる複数の圧縮データに基づいて、複数の種類の音声を再生する場合には、複数の圧縮データそれぞれを生成した圧縮処理に対応する伸長処理をそれら複数の圧縮データそれぞれに施す必要があるため、伸長処理が煩わしいという問題や同時再生が困難であるという問題がある。
【0005】
本発明は、上記事情に鑑み、圧縮率が異なる複数の圧縮データに基づいて、複数の音声を再生する場合であっても伸長処理や同時再生が容易なデータ圧縮装置およびデータ伸長装置を提供することを目的とする。
【0006】
【課題を解決するための手段】
上記目的を達成する本発明のデータ圧縮装置は、音声フレーズを表す、音声データの連続からなるフレーズデータにデータ圧縮処理を施すデータ圧縮装置において、
音声フレーズに圧縮率を規定する複数のパラメータを対応づけるパラメータ対応付手段と、
圧縮率可変のデータ圧縮アルゴリズムを用いて、音声フレーズを表すフレーズデータを、その音声フレーズに対応づけられた複数のパラメータに応じた圧縮率でデータ圧縮するデータ圧縮手段とを備えたことを特徴とする。
【0007】
尚、本発明において音声フレーズは、1つの音、もしくは一連の複数の音の連続から成るものであり、フレーズデータは、音の波形をあらわす波形データである。
このデータ圧縮装置によれば、単一のデータ圧縮アルゴリズムで、圧縮率が異なる複数の圧縮データを生成することができるので、これら複数の圧縮データの伸長処理は、単一のデータ伸長アルゴリズムに基づいて容易に行うことができる。
【0008】
本発明のデータ圧縮装置は、上記データ圧縮手段が、上記フレーズデータに圧縮処理を施すにあたりフレーズデータが所定数の連続した音声データ毎に分割されてなる各区分毎に、区分に含まれる連続した音声データそれぞれのデータレベルにそれぞれ対応するデータレベルに共通な、データレベルの基準を表す指数データ部を、それら連続した音声データに基づいて生成するとともに、基準のデータレベルを単位として、その区分に含まれる連続した音声データのデータレベルに対応するデータレベルそれぞれを、そのフレーズデータに対応づけられてなるパラメータおよび基準のデータレベルに基づいて決定されるビット数で表す仮数データ部を生成し、区分に含まれる一連の音声データを、指数データ部および仮数データ部からなる圧縮データに置き換えるものであることが好ましい。
【0009】
ここで、「音声データそれぞれのデータレベルにそれぞれ対応するデータレベル」「音声データのデータレベルに対応するデータレベル」は、音声データそれぞれのデータレベルそのものであってもよく、音声データどうしの差分データのデータレベルであってもよく、もともとの音声データのデータレベルを復元できるものであればどのようなものであってもよいことを意味している。
【0010】
上記目的を達成する本発明のデータ伸長装置は、音声フレーズを表す、音声データの連続からなるフレーズデータが、圧縮率可変のデータ圧縮アルゴリズムにより、音声フレーズに応じた圧縮率でデータ圧縮されてなる圧縮フレーズデータにデータ伸長処理を施すデータ伸長装置において、
圧縮フレーズデータに対応する、圧縮フレーズデータの圧縮率を規定した複数のパラメータを取得するパラメータ取得手段と、
圧縮フレーズデータを、データ圧縮アルゴリズムに対応するデータ伸長アルゴリズムおよびパラメータ取得手段で取得した複数のパラメータに基づいてデータ伸長するデータ伸長手段とを備えたことを特徴とする。
【0011】
このデータ伸長装置によれば、本発明のデータ圧縮装置によって生成された、圧縮率が異なる複数の圧縮データを単一のデータ伸長アルゴリズムに基づいて容易にデータ伸長することができる。
本発明のデータ伸長装置は、上記圧縮フレーズデータが、音声フレーズを表す、音声データの連続からなるフレーズデータが所定数の連続した音声データ毎に分割されてなる各区分に含まれる連続した音声データそれぞれのデータレベルにそれぞれ対応するデータレベルに共通な、データレベルの基準を表す指数データ部、および基準のデータレベルを単位として、その区分に含まれる連続した音声データのデータレベルに対応するデータレベルそれぞれを、そのフレーズデータに対応づけられてなる複数のパラメータおよび基準のデータレベルに基づいて決定されるビット数で表す仮数データ部からなる圧縮データによって構成されてなる圧縮フレーズデータであり、
上記伸長手段が、圧縮データを構成する指数データ部を取得し、その圧縮データを含む圧縮フレーズデータに対応するパラメータおよびその指数データ部に基づいて、その圧縮データを構成する仮数部のビット数を求め、そのビット数に応じて仮数データ部を取得し、その圧縮データをデータ伸長するものであることが好ましい。
【0012】
また、本発明のデータ伸長装置は、上記データ伸長手段が、複数の圧縮フレーズデータそれぞれを、上記データ圧縮アルゴリズムに対応する、これら複数の圧縮フレーズデータに共通のデータ伸長アルゴリズムおよび上記パラメータ取得手段で取得した、これら複数の圧縮フレーズデータそれぞれに応じた複数のパラメータに基づいて、同時にデータ伸長するものであることも好ましい。
【0013】
さらに本発明のデータ伸長装置は、音声フレーズを表す、音声データの連続からなるフレーズデータが、圧縮率可変のデータ圧縮アルゴリズムにより、音声フレーズに応じた圧縮率でデータ圧縮されてなる複数の圧縮フレーズデータそれぞれを、データ圧縮アルゴリズムに対応する、これら複数の圧縮フレーズデータに共通のデータ伸長アルゴリズムおよび、これら複数の圧縮フレーズデータそれぞれの圧縮率を規定した、これら複数の圧縮フレーズデータそれぞれに応じたパラメータに基づいて、同時にデータ伸長するデータ伸長手段を備えたことを特徴とする。
【0014】
このデータ伸長装置によれば、圧縮率が異なる複数の圧縮データを単一のデータ伸長アルゴリズムに基づいて容易にデータ伸長することができ、それら複数の圧縮データに基づく複数の音声フレーズを同時に再生することができる。
【0015】
【発明の実施の形態】
以下、本発明の実施形態について説明する。
図1は本発明のデータ圧縮装置の一実施形態を示すブロック図である。
このデータ圧縮装置1には、メモリ11と、入力部12と、ブロック形成部13とが備えられている。メモリ11には本発明にいう音声データである、2の補数形式の16ビットのPCMデータが、複数の音声フレーズ分記憶されており、メモリ11から入力部12によってPCMデータが読み込まれてブロック形成部13に送られ、ブロック形成部13によってPCMデータ16個毎に、本発明にいう区分であるブロックが形成される。
【0016】
なお、入力部12は本実施形態に限定される必要はなく、PCMデータを、A/Dコンバータから読み出すものであってもよいし、ハードディスク等の外部の記憶装置から読み出すものであってもよいし、通信回線から受け取るものであってもよい。
また、データ圧縮装置1には、データ圧縮部14と、パラメータ設定部15と、出力部16と、メモリ17とが備えられており、パラメータ設定部15によって、後述する圧縮処理に必要なパラメータがユーザによって音声フレーズ毎に任意に設定される。このパラメータに基づいて、データ圧縮部14によって、ブロック形成部13から1ブロック分ずつ送られてきたPCMデータに、後述するデータ圧縮処理が施されるとともに、その結果生成された圧縮データが1ブロック分ずつ出力部16へ送られる。以下、表1を参照してデータ圧縮処理について詳細に説明する。
【0017】
【表1】

Figure 0003884131
【0018】
表1の左から2列目には16個のPCMデータが示されており、本実施形態では上述のようにPCMデータ16個で1ブロックが形成されている。また、表1には16個のPCMデータそれぞれに対応して絶対値、仮数および伸長データが示されている。なお、PCMデータ、絶対値、仮数および伸長データはすべて16進数表示で示されている。以下、16進数表示で表示されている値については記号「$」を先頭に付して区別する。また、互いに対応づけられた一組のPCMデータ、絶対値、仮数および伸長データのことを以下サンプルと称し、表1に示された16個のサンプルには0番から15番までの番号が付されている。
【0019】
表1に示す1ブロック分のPCMデータに基づいて圧縮データが作成される手順を以下説明する。まずこれらのPCMデータのなかから最大の絶対値を持つPCMデータが検索される。表1の例では15番のサンプルのPCMデータがこれに該当する。
次に、最大の絶対値を持つ、15番のサンプルのPCMデータの符号ビットの最下位が求められる。15番のサンプルのPCMデータの値「$F8C4」を2進数表示で表すと「1111100011000100」となる。上述のように本実施形態では2の補数形式のPCMデータが用いられているので、このPCMデータは負であり、MSBから順にサーチされて最初に0が出現する(PCMデータが正であれば最初に1が出現する)ビット位置の1ビット手前が符号ビットの最下位となる。以下、LSBを第0ビットと称し、MSB側に向かって順に第1ビット、第2ビット等と称することとすると、上記の例では符号ビットの最下位は第11ビットである。PCMデータの値が「$0000」および「$FFFF」のいずれかの値である場合には全ビットの値が同一であり、上記の手順では符号ビットの最下位が見つからないので、この場合には第0ビットが符号ビットの最下位とされる。この符号ビットの最下位のビット位置を示す値を以下基準指数と称する。基準指数は、1ブロック内の音声データの最大音量を表しており、表1の例では基準指数は「11」となる。なお、PCMデータが16ビットのデータであり基準指数は0から15までのいずれかの値となるので、本実施形態では基準指数は4ビットで表される。
【0020】
16個のPCMデータそれぞれの、基準指数が示すビット位置からLSB方向へ、以下で述べる方法で決定されるビット数分、仮数が抽出され、基準指数と16個の仮数とで1ブロック分の圧縮データが生成される。このとき仮数の最下位が抽出されるビット位置を示す値を以下実効指数と称する。表1の例では基準指数が「11」なので仮数が7ビットであるとすれば実効指数は「5」となる。
【0021】
楽音の音質を維持するためには、楽音の音量が大きいときは仮数のビット長を長くする必要があるが、楽音の音量が小さいときには仮数のビット長を短くしても楽音の音質に悪影響を及ぼさないことが実験的に解っている。従って、例えば大音量の楽音の場合には仮数のビット長が8ビットとされ、音量が小さくなるにつれて仮数のビット長が7ビット、6ビットと短くされることで、仮数のビット長が固定されているデータ圧縮処理における音質と同等以上の音質を維持しつつ、仮数のビット長が固定されているデータ圧縮処理における圧縮率より高い圧縮率を実現することができる。
【0022】
本実施形態においては、仮数のビット長を計算するためのパラメータとして、基準指数が「15」のときの仮数のビット長である最大ビット長maxと、基準指数が小さくなるにつれて仮数のビット長が短くなる程度を表すステップstpとが設定され、以下の計算式によって、ブロック毎に、基準指数expに応じて仮数のビット長bitが決定される。
【0023】
bit=max−(15−exp)/stp
但し、演算「x/y」はxをyで割った値の整数部を求める演算である。
また、楽音の種類によっては、初めからPCMデータの下位のビットを無視し、実効指数に下限を設けても音質が維持される場合がある。そこで本実施形態ではパラメータとして最低実効指数minが設定され、上記の計算の結果得られた仮数のビット長bitと基準指数expとから求められる実効指数(exp−(bit−1))が最低実効指数minよりも小さくなる場合には、仮数のビット長bitは以下の計算式で決定される。
【0024】
bit=exp−min+1
また、当然ながら、実際の仮数のビット長は負の値になり得ないので、仮数のビット長bitの計算結果が負の値になった場合には、仮数のビット長は「0」とされ、指数のみの圧縮データとなる。
最大ビット長max、ステップstpおよび最低実効指数minに基づいて、基準指数から求められた仮数のビット長および実効指数の例を表2および表3に示す。
【0025】
【表2】
Figure 0003884131
【0026】
【表3】
Figure 0003884131
【0027】
表2の例では、最大ビット長maxが「6」、ステップstpが「3」に設定されており、基準指数が「3」小さくなる度に仮数のビット長が「1」短くなっている。また、最低実効指数minが「4」に設定されているので基準指数が「5」のとき仮数のビット長は「2」となり、基準指数が「4」のときは仮数のビット長は「1」となって実効指数が「4」に維持される。
【0028】
表3の例では、最大ビット長maxが「8」、ステップstpが「4」に設定されており、基準指数が「4」小さくなる度に仮数のビット長が「1」短くなっている。また、最低実効指数minが「0」に設定されているので基準指数が「0」でも仮数が存在し、表2の例に較べて高い音質が得られる設定となっている。
【0029】
表1に示す仮数は表3の条件で求められた仮数であり、上述のように基準指数が「11」なので、仮数のビット数は「7」である。即ち、第11ビットから第5ビットまでが仮数として抽出されている。15番のサンプルのPCMデータから仮数が抽出される場合を例にして説明すると、上述のように、15番のサンプルのPCMデータは2進数表示で「1111100011000100」であるので、第11ビットから第5ビットまでが抽出されると「1000110」となる。これを16進数表示に直せば表1に示すように「$46」となる。
【0030】
以上説明したように、圧縮処理に先立って各パラメータが調整されることによって、圧縮率と音質との最適化が計られる。また、パラメータが変更されることによって、異なる圧縮率の圧縮データが単一のデータ圧縮アルゴリズムに基づいて生成されるので、生成された、圧縮率が異なる複数の圧縮データそれぞれに伸長処理を施すことは容易である。
【0031】
なお、上述したパラメータの他に、仮数のビット長がmaxとなる指数の幅を示すパラメータextが設定され、15−extの値が基準指数expよりも小さい場合には仮数のビット長bitが最大ビット長maxとされ、15−extの値が基準指数exp以上である場合には以下の計算式によって仮数のビット長bitが決定されてもよい。
【0032】
bit=max−1−(15−ext−exp)/stp
ここで演算「x/y」は上記同様に、xをyで割った値の整数部を求める演算である。
図1には図示されていない指令手段を介して、ユーザから圧縮対象のフレーズの指定および圧縮処理開始の指令がなされると、図1に示す出力部16によって、圧縮処理に先立って、パラメータ設定部15で設定された各パラメータがメモリ17のヘッダ領域に記憶され、圧縮処理開始後は、データ圧縮部14によって生成された圧縮データがメモリ17の圧縮データ領域に順次記憶される。なお、楽音フレーズの最後のブロックに関しては、音声フレーズの最終のPCMデータがそのブロックの最後のデータでない場合には、最後のブロックのそれより後の仮数データを全て0を示すものとする。また、本実施形態では、圧縮記憶領域は、基準指数が記憶される領域と仮数が記憶される領域とに分けられている。これは、1ワードが16ビットから構成されるメモリを使用した場合に、基準指数が4ビットであるので4ブロック分の基準指数がメモリの1ワードに丁度収まり、仮数は16個で1ブロック分であるのでビット長に関わらず1ブロック分のデータ長が16ビットの整数倍となることから、このように領域を分けた方がデータ管理が容易となるからである。
【0033】
なお、メモリ配置は本実施形態の配置に限定される必要はなく、同一の領域にパラメータ、基準指数および仮数が連続して格納されてもよいことは当然である。
1つの音声フレーズを表す一連のPCMデータの圧縮処理が終了すると、出力部16により、その音声フレーズの先頭ブロックの圧縮データを構成する基準指数が記憶されている、基準指数領域のアドレスを示すデータと、その音声フレーズの先頭ブロックの圧縮データを構成する仮数のうちの先頭の仮数が記憶されている、圧縮データ領域のアドレスを示すデータと、その音声フレーズの最終ブロックの圧縮データを構成する仮数のうちの先頭の仮数が記憶されている、圧縮データ領域のアドレスを示すデータと、その音声フレーズの最終のPCMデータに対応する仮数の、そのPCMデータが含まれるブロック内の相対アドレス(ブロックの先頭から何データめかを示す)とがメモリ17のその音声フレーズのヘッダ領域に追加記憶される。各音声フレーズ毎にパラメータの設定および圧縮処理開始の指令を行なうことにより、各音声フレーズ毎に、圧縮データが生成されるとともにその圧縮データを生成する際に用いられた圧縮率を規定するパラメータとその圧縮データとが対応付けられる。
【0034】
なお、本実施形態ではパラメータがメモリ17のヘッダ領域に記憶され、データ伸長装置へ自動的に受け渡されるが、ユーザがパラメータを記録しておいて、データ伸長処理の際にデータ伸長装置に入力してもよい。
また、出力部16は本実施形態に限定される必要はなく、圧縮データをハードディスク等の外部の記憶装置に書き込むものであってもよいし、通信回線に送り出すものであってもよい。
【0035】
図2は、本発明のデータ伸長装置の一実施形態を包含する楽音再生装置を示すブロック図である。
この楽音再生装置2には、メモリ21と、入力部22と、パラメータ取得部23とが備えられており、メモリ21には、図1に示すデータ圧縮装置1によって生成された圧縮データが上述の形式で記憶されている。図示されていない指令手段を介してユーザから与えられたデータ伸長処理開始の指令によって入力部22は動作を開始し、伸長処理に先立って入力部22によってメモリ21のヘッダ領域から、伸長処理の対象となる音声フレーズに対応するパラメータ等のデータが読み込まれパラメータ取得部23へ送られる。伸長開始後は、入力部22によってメモリ21の圧縮データ領域から圧縮データが読み込まれる。パラメータ取得部23により、入力部22から送られてきたデータから、伸長処理の対象となる音声フレーズに対応するパラメータ等が抽出される。
【0036】
楽音再生装置2には、データ伸長部24と出力部25が備えられており、メモリ21から出力部25までが本発明のデータ伸長装置の一実施形態に相当する。データ伸長部24は、複数の音声フレーズを表す複数の圧縮フレーズデータを、時分割的に処理することによって平行してデータ伸長することができ、これはデータ伸長部24が複数個のトラックを有し、それら複数個のトラックそれぞれが伸長対象の1つずつの音声フレーズに対応しており、各トラックが、そのトラックに対応する音声フレーズを表す圧縮フレーズデータのデータ伸長を行うことと同じである。以下ではこのようなトラックが存在するものとして説明する。また、これらのトラックそれぞれに対して独立に、図示されていない指令手段を介してユーザによって任意のフレーズの伸長処理の開始および停止が指示される。以下、各トラックによる伸長処理の原理を説明する。
【0037】
各トラックは、伸長処理の開始に先立って、そのトラックに対応する音声フレーズに対応するパラメータをパラメータ取得部23から受け取り、伸長開始後は、このパラメータと、入力部22から送られてきた基準指数とに基づいてブロック毎に仮数のビット長を計算する。
仮数のビット長が「0」である場合には、トラックによって値が「$0000」であるPCMデータが伸長データとして16個生成されて出力部25へ送られる。なお、仮数のビット長が「0」である場合にはデータ伸長部24では伸長データの生成が行われずに、仮数のビット長が「0」であることが出力部25に伝えられ、出力部25が伸長データを生成するものであってもよい。
【0038】
仮数部のビット長が正である場合には、このビット長に応じて入力部22を介して16個の仮数を取得する。各仮数それぞれが16個の16ビットレジスタそれぞれに右詰めで格納され、各仮数のMSBがその上位の全ビットにコピーされる符号拡張が行われ、パラメータおよび基準指数によって求められた実効指数に従って全レジスタが左シフトされ、実効指数が「0」でない場合は仮数のLSBのすぐ下位のビットが1にされる(表1の第4列目参照)。上記の最後の処理は圧縮時に切り捨てを行っていることに対応するもので、例えば表1の例では実効指数が「5」であり、11番のサンプルの場合にはPCMデータが「$FBFD」であり、仮数が「$5F」なので、この最後の処理を行わなければ伸長データは「$FBE0」となり切り捨て誤差は「$001D」となるが、この最後の処理を行うことで伸長データは表1に示すように「$FBF0」となり、この結果切り捨て誤差は「$000D」に抑えられる。
【0039】
このようにして伸長処理が行われた結果、圧縮データが伸長されて伸長データとして16個のPCMデータが形成され出力部25に供給される。以降、これと同様に各ブロックの圧縮データの伸長が行なわれる。
以下、フロー図を参照してデータ伸長部24の動作を説明する。
図3は、データ伸長部24の動作を示すフローチャートである。
【0040】
ユーザによって第n番目のトラックに対して伸長処理の開始が指示されると、図示しない処理によりそのトラックの処理状況を表すフラグflag[n]が、伸長処理中を表す値「1」に設定され、1ブロック分の圧縮データを構成する仮数のうちの先頭の仮数が記憶されているアドレスを示す変数point[n]に、第n番目のトラックに対応する音声フレーズの先頭ブロックの圧縮データを構成する仮数のうちの先頭の仮数が記憶されているアドレスが代入され、ブロック内の相対アドレス(ブロックの先頭から何データめかを示す)を示す変数count[n]が「0」に設定される。また、ユーザによって第n番目のトラックに対して伸長処理の停止が指示されると図示しない処理によりフラグflag[n]が、伸長処理停止中を表す値「0」に設定される。
【0041】
データ伸長部24は、サンプリング周波数のクロック周期毎にフローチャートに示す動作を実行する。
データ伸長部24が動作を開始すると、ステップS101において、トラック番号を示す変数nが「0」に初期化され、ステップS102に進み、フラグflag[n]の値が判定される。
【0042】
ステップS102において、フラグflag[n]の値が「0」であると判定された場合には、第nトラックは伸長処理停止中であるので、ステップS103に進み、第nトラックのPCMデータとして値「$0000」が出力部25に送られ、ステップS111に進む。
ステップS102において、フラグflag[n]の値が「1」であると判定された場合には、第nトラックは伸長処理中であるので、ステップS104に進み、基準指数とパラメータとから定まる仮数のビット長に基づいて、変数point[n]によって示されるアドレスにその先頭の仮数が記憶されている1ブロック分の仮数の中のそのブロックの先頭からcount[n]番目の仮数に基づいて伸長データが生成されて出力部25に送られ、ステップS105に進み、第nトラックに対応する音声フレーズを表す圧縮フレーズデータの最後に到達したか否かが判定される。この判定は、point[n]をその音声フレーズの最終ブロックの圧縮データを構成する仮数のうちの先頭の仮数が記憶されている圧縮データ領域のアドレスと比較するとともに、count[n]をその音声フレーズの最終のPCMデータに対応する仮数の、そのPCMデータが含まれるブロック内の相対アドレスとを比較することにより行なう。
【0043】
ステップS105において、圧縮フレーズデータの最後に到達したと判定された場合には、ステップS106に進み、フラグflag[n]の値が「0」に設定され、これにより第nトラックが伸長処理停止中となってステップS111に進む。
ステップS105において、圧縮フレーズデータの最後に到達していないと判定された場合には、ステップS107に進み、変数count[n]の値が歩進されてステップS108に進む。
【0044】
ステップS108では、変数count[n]の値が「16」になったか否かが判定され、これによって、1ブロック分のデータが出力されたか否かが判定される。ステップS108において、変数count[n]の値が「16」になっていないと判定された場合は、1ブロック分のデータが出力されていないことを意味するので、何もせずにステップS111に進む。ステップS108において、変数count[n]の値が「16」になったと判定された場合は、1ブロック分のデータが出力されたことを意味するので、ステップS109において変数count[n]の値が「0」に設定されてステップS110に進み、基準指数とパラメータとに基づいて仮数のビット長を求め、仮数のビット長に応じて変数point[n]の値を1ブロック分進め、次のブロックの圧縮データを構成する基準指数を取得して、ステップS111に進む。
【0045】
ステップS111では変数nの値が歩進されてステップS112に進み、変数nの値がトラックの数TRKに到達したか否かが判定される。変数nの値がトラックの数TRKに到達していれば動作を終了し、到達していなければステップS102に戻って、次のトラックについて上記の動作が繰り返される。
図4は、データ伸長部24の別の動作を示すフローチャートである。
【0046】
図3のフローチャートが示す動作は、サンプリング周期毎に実行されて1トラック毎に1つのPCMデータが出力される動作であるが、このフローチャートが示す動作は、16サンプリング周期毎に実行され、1トラック毎に1ブロック分のPCMデータがまとめて出力される動作である。
データ伸長部24の動作が開始されると、ステップS201において、トラック番号を示す変数nが「0」に初期化され、ステップS202に進み、フラグflag[n]の値が判定される。
【0047】
ステップS202において、フラグflag[n]の値が「0」であると判定された場合には、ステップS203に進み、第nトラックのPCMデータとして値「$0000」が16個出力部25に送られ、ステップS208に進む。
ステップS102において、フラグflag[n]の値が「1」であると判定された場合には、ステップS204に進み、第nトラックに対応する音声フレーズの、変数point[n]で示されるアドレスから始まる1ブロック分の圧縮データがすべて伸長されて出力部25に送られ、ステップS205に進む。
【0048】
ステップS205では、第nトラックに対応する音声フレーズの最終ブロックに到達したか否かが判定され、最終ブロックに到達したと判定された場合は、ステップS206に進み、フラグflag[n]の値が「0」に設定され、これにより第nトラックが伸長処理停止中となってステップS208に進む。ステップS205において、最終ブロックに到達していないと判定された場合は、ステップS207に進み、変数point[n]の値が1ブロック分進められて、ステップS208に進む。
【0049】
ステップS208では変数nの値が歩進されてステップS209に進み、変数nの値がトラックの数TRKに到達したか否かが判定される。変数nの値がトラックの数TRKに到達していれば動作を終了し、到達していなければステップS202に戻って、次のトラックについて上記の動作が繰り返される。
以上の動作によってデータ伸長部24で作成されたPCMデータが出力部25に送られる。
【0050】
図2に戻って説明を続ける。出力部25には、1ブロック分のPCMデータを記憶するメモリがデータ伸長部24の各トラック毎に2面設けられており、一方の面のメモリにデータ伸長部24から送られてきたPCMデータが記憶されるとともに、他方の面のメモリに記憶されているPCMデータがサンプリング周期毎に出力される。PCMデータが16個出力される度に2つのメモリの使用形態が切り替えられ上記の動作が繰り返される。
【0051】
楽音再生装置2には、さらに、アンプ26と、スピーカ27が備えられている。出力部25から出力された複数トラックのPCMデータは、アンプ26によって増幅され、スピーカ27から複数の音声フレーズが同時に発音される。なお、出力部25においては伸長された全トラックの信号を加算した後に出力してもよい。この場合、圧縮データが伸長された状態ではデータの形式(この場合16ビット)はそろっているので加算することは容易になる。
【0052】
上記の各実施形態では、音声フレーズがモノラルである場合について説明したが、本発明のデータ圧縮装置、データ伸長装置および楽音再生装置は、音声フレーズがステレオであってもよい。この場合には、例えば、データ圧縮時に音声フレーズがステレオであるかモノラルであるかを示すデータが音声フレーズ毎に記憶され、データ伸長時に、ステレオであるかモノラルであるかを示すデータに基づいて、モノラルであれば1トラックでデータ伸長処理が行われ、ステレオであれば2トラックでデータ伸長処理が行われる。
【0053】
また、上記の各実施形態ではサンプリング周波数がいずれの音声フレーズについても同じである場合について説明したが、複数のサンプリング周波数が用意され、データ圧縮時に音声フレーズ毎に最適なサンプリング周波数が選択され、そのサンプリング周波数を示すデータが音声フレーズに対応づけられて記憶され、データ伸長時に音声フレーズ毎のサンプリング周波数でデータ伸長処理が行われてもよい。
【0054】
この場合、データ圧縮装置のメモリ11にPCMデータが記憶される際に、音声フレーズに対応するサンプリング周波数で記憶されてもよいし、メモリ11に記憶される際にはすべての音声フレーズが同じサンプリング周波数で一旦記憶され、その後サンプリング周波数が変換されたデータに書き換えられてもよい。一般に、サンプリング周波数をM/N倍(M、Nはともに整数)に変換する場合には、以下の処理が順次行われる。
【0055】
(第1処理)
各PCMデータ間にM−1個の、値が「0」のPCMデータが挿入されるいわゆるM倍オーバサンプリングが行われる。
(第2処理)
元のサンプリング周波数、および変換後の、M/N倍になったサンプリング周波数のうちの低い方のサンプリング周波数に対応するナイキスト周波数以下の周波数成分を通過させるフィルタに、第1処理が施されたPCMデータが通される。
【0056】
(第3処理)
第2処理が施されたPCMデータから、N個目毎にPCMデータが抽出されるいわゆる1/N倍ダウンサンプリングが行われる。抽出されたPCMデータ以外のPCMデータは破棄される。
このようなサンプリング周波数の変換が施されたPCMデータにデータ圧縮処理が施されて得られた圧縮データは、上述のように、音声フレーズ毎のサンプリング周波数でデータ伸長処理が行われて出力されるが、その際に各音声フレーズに対応づけられた各サンプリング周波数で出力されてもよいし、外部の機器の能力に応じた1つのサンプリング周波数に統一されるように再度サンプリング周波数の変換が行われて出力されてもよい。1つのサンプリング周波数に統一するためには、例えば以下のように処理を行なう。伸長処理装置を複数のサンプリング周波数の最小公倍数の周期ごとに動作させ、各トラックでは自分のトラックのフレーズのサンプリング周波数の周期(上記最小公倍数の周波数の周期の何回かに1回に)で読み出し・伸長を行ない、それ以外のタイミングでは「0」を出力し、上記最小公倍数の周波数の周期でフィルタ処理を行なう。また、1つのサンプリング周波数に統一されるように再度サンプリング周波数の変換が行われた後、各PCMデータが加算されて出力されてもよい。
【0057】
【発明の効果】
以上説明したように、本発明のデータ圧縮装置によれば、単一のデータ圧縮アルゴリズムで、圧縮率が異なる複数の圧縮データを生成することができるので、これら複数の圧縮データの伸長処理は、単一のデータ伸長アルゴリズムに基づいて容易に行うことができる。
【0058】
本発明のデータ伸長装置によれば、本発明のデータ圧縮装置によって生成された、圧縮率が異なる複数の圧縮データを単一のデータ伸長アルゴリズムに基づいて容易にデータ伸長することができる。
本発明のデータ伸長装置によれば、圧縮率が異なる複数の圧縮データを単一のデータ伸長アルゴリズムに基づいて容易にデータ伸長することができ、それら複数の圧縮データに基づく複数の音声フレーズを同時に再生することができる。
【図面の簡単な説明】
【図1】本発明のデータ圧縮装置の一実施形態を示すブロック図である。
【図2】本発明のデータ伸長装置の一実施形態を包含する楽音再生装置を示すブロック図である。
【図3】データ伸長部24の動作を示すフローチャートである。
【図4】データ伸長部24の別の動作を示すフローチャートである。
【符号の説明】
1 データ圧縮装置
2 楽音再生装置
14 データ圧縮部
15 パラメータ設定部
23 パラメータ取得部
24 データ伸長部
26 音源
27 アンプ
28 スピーカ[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a data compression apparatus that performs data compression processing on phrase data composed of a series of audio data, and a data expansion apparatus that performs data expansion processing on compressed phrase data representing an audio phrase. In the present invention, the term “sound” refers to a concept including all sounds in the audible range such as musical sounds and sound effects in addition to human voices.
[0002]
[Prior art]
Conventionally, phrase data representing an audio phrase has been widely stored in a storage medium or transmitted / received via a communication medium. In this case, the compressed data is generated by performing data compression on the phrase data, and storing this compressed data or transmitting / receiving it is economical because the storage capacity and communication time can be reduced. In order to further improve the economy, it is better to perform a compression process having a higher compression rate. However, since the tone of music that is played back based on compressed data generated by compression processing with a higher compression ratio tends to be lower in quality, in order to maintain the tone quality of the played tone within an acceptable range. Needs to choose a compression process with a lower compression ratio. Therefore, a desired compression rate is determined by a balance between economy and sound quality, and a compression process having the desired compression rate is selected.
[0003]
[Problems to be solved by the invention]
By the way, there are voices (musical sounds) that require high sound quality, such as piano performance sounds, and other sounds that may have low sound quality, such as noise-like sound effects. Therefore, the desired compression rate determined by the balance between economic efficiency and sound quality varies depending on the type of audio. Therefore, it is possible to generate compressed data by selecting a compression process having a desired compression rate according to the type of audio. desirable.
[0004]
However, when a plurality of types of audio are reproduced based on a plurality of types of compressed data having different compression rates and representing a plurality of types of audio generated in this manner, the compression generated by each of the plurality of compressed data is generated. Since it is necessary to perform decompression processing corresponding to the processing on each of the plurality of compressed data, there are problems that the decompression processing is troublesome and that simultaneous reproduction is difficult.
[0005]
In view of the above circumstances, the present invention provides a data compression apparatus and a data expansion apparatus that can easily perform decompression processing and simultaneous reproduction even when a plurality of sounds are reproduced based on a plurality of compressed data having different compression rates. For the purpose.
[0006]
[Means for Solving the Problems]
The data compression device of the present invention that achieves the above object is a data compression device that performs data compression processing on phrase data consisting of a series of audio data, which represents an audio phrase.
A parameter association means for associating a plurality of parameters defining the compression rate with the audio phrase;
Data compression means comprising data compression means for compressing phrase data representing a voice phrase at a compression rate according to a plurality of parameters associated with the voice phrase using a data compression algorithm with a variable compression ratio To do.
[0007]
In the present invention, a voice phrase is composed of one sound or a series of a plurality of sounds, and phrase data is waveform data representing a sound waveform.
According to this data compression apparatus, a plurality of compressed data having different compression ratios can be generated by a single data compression algorithm. Therefore, decompression processing of the plurality of compressed data is based on a single data decompression algorithm. Can be done easily.
[0008]
In the data compression apparatus of the present invention, when the data compression means performs compression processing on the phrase data, the phrase data is divided into a predetermined number of continuous audio data, and each continuous division included in the division An index data part representing a data level reference common to the data level corresponding to each data level of the audio data is generated on the basis of the continuous audio data, and is divided into the categories with the reference data level as a unit. Generate a mantissa data part that represents each data level corresponding to the data level of the continuous audio data contained in the number of bits determined based on the parameter associated with the phrase data and the reference data level, and A series of audio data included in the It is preferable that the replacing data.
[0009]
Here, “the data level corresponding to the data level of each of the audio data” and “the data level corresponding to the data level of the audio data” may be the data level of each of the audio data, and the difference data between the audio data. This means that any data level can be used as long as the data level of the original audio data can be restored.
[0010]
In the data decompression apparatus of the present invention that achieves the above object, phrase data consisting of a series of voice data representing a voice phrase is compressed by a data compression algorithm with a variable compression ratio at a compression ratio corresponding to the voice phrase. In a data decompression device that performs data decompression processing on compressed phrase data,
Parameter acquisition means for acquiring a plurality of parameters that define the compression rate of the compressed phrase data corresponding to the compressed phrase data;
The compressed phrase data includes a data decompression algorithm corresponding to the data compression algorithm and data decompression means for decompressing data based on a plurality of parameters acquired by the parameter acquisition means.
[0011]
According to this data decompression device, a plurality of compressed data having different compression rates generated by the data compression device of the present invention can be easily decompressed based on a single data decompression algorithm.
In the data decompression apparatus of the present invention, the compressed phrase data represents a speech phrase, and the continuous speech data included in each division in which phrase data composed of continuous speech data is divided into a predetermined number of continuous speech data A data level corresponding to a data level corresponding to each data level, and an index data portion representing a data level standard, and a data level corresponding to the data level of continuous audio data included in the classification with the standard data level as a unit Each of which is compressed phrase data composed of compressed data composed of a mantissa data portion represented by a plurality of parameters associated with the phrase data and the number of bits determined based on a reference data level;
The decompression means obtains an exponent data part constituting the compressed data, and based on the parameter corresponding to the compressed phrase data including the compressed data and the exponent data part, calculates the number of bits of the mantissa part constituting the compressed data. It is preferable to obtain the mantissa data portion according to the number of bits and decompress the compressed data.
[0012]
In the data decompression apparatus of the present invention, the data decompression means includes a plurality of compressed phrase data corresponding to the data compression algorithm, a data decompression algorithm common to the plurality of compressed phrase data, and the parameter obtaining means. It is also preferable that the data is decompressed simultaneously based on a plurality of parameters obtained according to the acquired plurality of compressed phrase data.
[0013]
Furthermore, the data decompression apparatus of the present invention includes a plurality of compressed phrases in which phrase data that is a series of voice data representing a voice phrase is compressed with a compression ratio corresponding to the voice phrase by a data compression algorithm with a variable compression ratio. A parameter corresponding to each of the plurality of compressed phrase data, which defines a data decompression algorithm common to the plurality of compressed phrase data, and a compression rate of each of the plurality of compressed phrase data, corresponding to the data compression algorithm. And a data expansion means for expanding data simultaneously.
[0014]
According to this data decompression device, a plurality of compressed data with different compression rates can be easily decompressed based on a single data decompression algorithm, and a plurality of audio phrases based on the plurality of compressed data are reproduced simultaneously. be able to.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described.
FIG. 1 is a block diagram showing an embodiment of a data compression apparatus of the present invention.
The data compression apparatus 1 includes a memory 11, an input unit 12, and a block formation unit 13. The memory 11 stores 16-bit PCM data in 2's complement format, which is the audio data referred to in the present invention, for a plurality of audio phrases, and the PCM data is read from the memory 11 by the input unit 12 to form a block. The block forming unit 13 forms a block which is a section referred to in the present invention for every 16 pieces of PCM data.
[0016]
The input unit 12 is not necessarily limited to the present embodiment, and PCM data may be read from an A / D converter or read from an external storage device such as a hard disk. However, it may be received from a communication line.
In addition, the data compression apparatus 1 includes a data compression unit 14, a parameter setting unit 15, an output unit 16, and a memory 17, and parameters necessary for compression processing described later are set by the parameter setting unit 15. It is arbitrarily set for each voice phrase by the user. Based on this parameter, the data compression unit 14 applies data compression processing to be described later to the PCM data sent from the block forming unit 13 one block at a time, and the compressed data generated as a result is one block. Each minute is sent to the output unit 16. Hereinafter, the data compression process will be described in detail with reference to Table 1.
[0017]
[Table 1]
Figure 0003884131
[0018]
16 PCM data are shown in the second column from the left in Table 1, and in this embodiment, one block is formed by 16 PCM data as described above. Table 1 shows absolute values, mantissas, and decompressed data corresponding to each of 16 pieces of PCM data. The PCM data, absolute value, mantissa and decompressed data are all shown in hexadecimal notation. Hereinafter, the values displayed in hexadecimal notation are distinguished by attaching the symbol “$” to the head. A set of PCM data, absolute value, mantissa and decompressed data associated with each other is hereinafter referred to as a sample, and the 16 samples shown in Table 1 are numbered from 0 to 15. Has been.
[0019]
A procedure for creating compressed data based on one block of PCM data shown in Table 1 will be described below. First, PCM data having the maximum absolute value is searched from these PCM data. In the example of Table 1, this corresponds to PCM data of the 15th sample.
Next, the least significant sign bit of the PCM data of the 15th sample having the maximum absolute value is obtained. When the PCM data value “$ F8C4” of the 15th sample is expressed in binary notation, it becomes “1111100011000100”. As described above, since PCM data in 2's complement format is used in the present embodiment, this PCM data is negative, and is searched sequentially from the MSB, and 0 appears first (if the PCM data is positive) The first bit before the bit position (where 1 appears first) is the least significant sign bit. Hereinafter, when the LSB is referred to as the 0th bit and is referred to as the first bit, the second bit, etc. in order toward the MSB side, the least significant bit of the code bit is the 11th bit in the above example. If the value of the PCM data is either “$ 0000” or “$ FFFF”, the values of all bits are the same, and in the above procedure, the least significant sign bit is not found. The 0th bit is the least significant bit of the sign bit. A value indicating the least significant bit position of the sign bit is hereinafter referred to as a reference index. The reference index represents the maximum volume of the audio data in one block. In the example of Table 1, the reference index is “11”. Since the PCM data is 16-bit data and the reference index is any value from 0 to 15, in this embodiment, the reference index is represented by 4 bits.
[0020]
For each of the 16 PCM data, the mantissa is extracted from the bit position indicated by the reference exponent in the LSB direction by the number of bits determined by the method described below, and compression for one block is performed with the reference exponent and the 16 mantissas. Data is generated. A value indicating the bit position from which the least significant part of the mantissa is extracted is hereinafter referred to as an effective exponent. In the example of Table 1, since the reference exponent is “11”, if the mantissa is 7 bits, the effective exponent is “5”.
[0021]
In order to maintain the tone quality of the musical tone, it is necessary to increase the bit length of the mantissa when the volume of the musical tone is high, but when the volume of the musical tone is low, reducing the bit length of the mantissa will adversely affect the tone quality of the musical tone. It has been experimentally understood that it does not reach. Therefore, for example, in the case of a high volume musical tone, the bit length of the mantissa is set to 8 bits, and the bit length of the mantissa is shortened to 7 bits and 6 bits as the volume decreases, so that the bit length of the mantissa is fixed. A compression rate higher than the compression rate in the data compression processing in which the bit length of the mantissa is fixed can be realized while maintaining the sound quality equivalent to or higher than the sound quality in the data compression processing.
[0022]
In this embodiment, as a parameter for calculating the bit length of the mantissa, the maximum bit length max that is the bit length of the mantissa when the reference exponent is “15”, and the bit length of the mantissa as the reference exponent decreases. A step stp indicating the degree of shortening is set, and the bit length bit of the mantissa is determined for each block according to the reference exponent exp according to the following calculation formula.
[0023]
bit = max- (15-exp) / stp
However, the operation “x / y” is an operation for obtaining an integer part of a value obtained by dividing x by y.
Also, depending on the type of musical sound, the lower quality bits of the PCM data are ignored from the beginning, and the sound quality may be maintained even if a lower limit is set for the effective exponent. Therefore, in this embodiment, the minimum effective index min is set as a parameter, and the effective index (exp− (bit−1)) obtained from the bit length bit of the mantissa obtained as a result of the above calculation and the reference index exp is the minimum effective. When it is smaller than the exponent min, the bit length bit of the mantissa is determined by the following calculation formula.
[0024]
bit = exp-min + 1
Of course, since the actual mantissa bit length cannot be a negative value, if the calculation result of the mantissa bit length bit becomes a negative value, the bit length of the mantissa is set to “0”. , Compressed data with only an exponent.
Tables 2 and 3 show examples of mantissa bit lengths and effective exponents obtained from the reference exponent based on the maximum bit length max, the step stp, and the minimum effective exponent min.
[0025]
[Table 2]
Figure 0003884131
[0026]
[Table 3]
Figure 0003884131
[0027]
In the example of Table 2, the maximum bit length max is set to “6”, the step stp is set to “3”, and the bit length of the mantissa is shortened by “1” every time the reference index becomes “3”. Since the minimum effective exponent min is set to “4”, the bit length of the mantissa is “2” when the reference exponent is “5”, and the bit length of the mantissa is “1” when the reference exponent is “4”. The effective index is maintained at “4”.
[0028]
In the example of Table 3, the maximum bit length max is set to “8”, the step stp is set to “4”, and the mantissa bit length is shortened by “1” every time the reference exponent is decreased by “4”. In addition, since the minimum effective index min is set to “0”, there is a mantissa even when the reference index is “0”, and the sound quality is higher than that in the example of Table 2.
[0029]
The mantissa shown in Table 1 is a mantissa obtained under the conditions of Table 3. Since the reference exponent is “11” as described above, the number of bits of the mantissa is “7”. That is, the 11th to 5th bits are extracted as mantissas. The case where the mantissa is extracted from the PCM data of the 15th sample will be described as an example. As described above, the PCM data of the 15th sample is “1111100011000100” in binary notation. When up to 5 bits are extracted, “1000110” is obtained. If this is converted to hexadecimal notation, it will be “$ 46” as shown in Table 1.
[0030]
As described above, the compression rate and the sound quality are optimized by adjusting each parameter prior to the compression process. In addition, by changing the parameters, compressed data with different compression rates is generated based on a single data compression algorithm, so decompression processing is performed on each of the generated compressed data with different compression rates. Is easy.
[0031]
In addition to the parameters described above, a parameter ext indicating the width of the exponent where the bit length of the mantissa is max is set, and when the value of 15-ext is smaller than the reference exponent exp, the bit length bit of the mantissa is maximum. When the bit length is max and the value of 15-ext is equal to or greater than the reference exponent exp, the bit length bit of the mantissa may be determined by the following calculation formula.
[0032]
bit = max-1- (15-ext-exp) / stp
Here, the operation “x / y” is an operation for obtaining an integer part of a value obtained by dividing x by y, as described above.
When a user designates a compression target phrase and starts compression processing via command means not shown in FIG. 1, the output unit 16 shown in FIG. 1 sets parameter settings prior to compression processing. Each parameter set by the unit 15 is stored in the header area of the memory 17, and after starting the compression process, the compressed data generated by the data compression unit 14 is sequentially stored in the compressed data area of the memory 17. As for the last block of the musical phrase, if the last PCM data of the voice phrase is not the last data of the block, all the mantissa data after that of the last block indicate 0. In this embodiment, the compressed storage area is divided into an area for storing the reference exponent and an area for storing the mantissa. This is because if the memory is composed of 16 bits per word, the base index is 4 bits, so the base index for 4 blocks fits exactly in 1 word of memory, and the mantissa is 16 blocks for 1 block. Therefore, the data length for one block is an integer multiple of 16 bits regardless of the bit length, and thus data management becomes easier if the areas are divided in this way.
[0033]
Note that the memory arrangement is not necessarily limited to the arrangement of the present embodiment, and it is natural that the parameters, the reference exponent, and the mantissa may be stored successively in the same area.
When the compression processing of a series of PCM data representing one voice phrase is completed, the output unit 16 stores the reference index constituting the compressed data of the first block of the voice phrase and indicating the address of the reference index area Data indicating the address of the compressed data area in which the first mantissa of the compressed data of the first block of the speech phrase is stored, and the mantissa constituting the compressed data of the last block of the speech phrase Data indicating the address of the compressed data area in which the first mantissa is stored and the mantissa corresponding to the last PCM data of the speech phrase, the relative address within the block containing the PCM data (block Is stored in the header area of the audio phrase in the memory 17. . By setting parameters for each voice phrase and instructing compression processing to start, compressed data is generated for each voice phrase and a parameter that defines the compression ratio used when generating the compressed data; The compressed data is associated.
[0034]
In this embodiment, the parameter is stored in the header area of the memory 17 and automatically transferred to the data decompression device. However, the user records the parameter and inputs it to the data decompression device during the data decompression process. May be.
The output unit 16 need not be limited to the present embodiment, and may be one that writes compressed data to an external storage device such as a hard disk, or one that sends out to a communication line.
[0035]
FIG. 2 is a block diagram showing a musical sound reproducing apparatus including an embodiment of the data decompression apparatus of the present invention.
The musical sound reproducing device 2 includes a memory 21, an input unit 22, and a parameter acquisition unit 23. The compressed data generated by the data compression device 1 shown in FIG. Stored in the format. The input unit 22 starts to operate in response to a data decompression process start command given by the user via a command unit (not shown). Prior to the decompression process, the input unit 22 performs decompression processing from the header area of the memory 21. Data such as a parameter corresponding to the voice phrase to be read is read and sent to the parameter acquisition unit 23. After starting the decompression, compressed data is read from the compressed data area of the memory 21 by the input unit 22. The parameter acquisition unit 23 extracts parameters and the like corresponding to the speech phrase that is the target of the decompression process from the data sent from the input unit 22.
[0036]
The musical sound reproducing device 2 includes a data decompression unit 24 and an output unit 25, and the memory 21 to the output unit 25 correspond to an embodiment of the data decompression device of the present invention. The data decompression unit 24 can decompress a plurality of compressed phrase data representing a plurality of audio phrases in parallel by time-division processing. This is because the data decompression unit 24 has a plurality of tracks. Each of the plurality of tracks corresponds to one audio phrase to be decompressed, and each track is the same as performing data decompression of compressed phrase data representing the audio phrase corresponding to the track. . In the following description, it is assumed that such a track exists. Also, for each of these tracks, the user is instructed to start and stop an arbitrary phrase expansion process via command means (not shown). Hereinafter, the principle of the extension process by each track will be described.
[0037]
Prior to the start of the decompression process, each track receives a parameter corresponding to the audio phrase corresponding to that track from the parameter acquisition unit 23, and after the decompression starts, this parameter and the reference index sent from the input unit 22 Based on the above, the bit length of the mantissa is calculated for each block.
When the bit length of the mantissa is “0”, 16 pieces of PCM data having a value of “$ 0000” are generated by the track as decompressed data and sent to the output unit 25. If the bit length of the mantissa is “0”, the data decompression unit 24 does not generate decompressed data, but informs the output unit 25 that the bit length of the mantissa is “0”. 25 may generate decompressed data.
[0038]
When the bit length of the mantissa part is positive, 16 mantissas are acquired via the input unit 22 according to the bit length. Each mantissa is stored right-justified in each of the 16 16-bit registers, each significand's MSB is copied to all the high-order bits, and sign extension is performed, all in accordance with the effective exponent determined by the parameters and reference exponent. If the register is shifted to the left and the effective exponent is not “0”, the bit immediately below the mantissa LSB is set to 1 (see the fourth column of Table 1). The last process corresponds to truncation during compression. For example, in the example of Table 1, the effective index is “5”, and in the case of the 11th sample, the PCM data is “$ FBFD”. Since the mantissa is “$ 5F”, if this final process is not performed, the decompressed data is “$ FBE0” and the truncation error is “$ 001D”. As shown in FIG. 1, “$ FBF0” is obtained, and as a result, the truncation error is suppressed to “$ 000D”.
[0039]
As a result of performing the decompression process in this way, the compressed data is decompressed, and 16 pieces of PCM data are formed as decompressed data and supplied to the output unit 25. Thereafter, similarly to this, the compressed data of each block is expanded.
The operation of the data decompression unit 24 will be described below with reference to the flowchart.
FIG. 3 is a flowchart showing the operation of the data decompression unit 24.
[0040]
When the user instructs the start of the decompression process for the nth track, a flag flag [n] indicating the processing status of the track is set to a value “1” indicating that the decompression process is in progress by a process not shown. The compressed data of the first block of the audio phrase corresponding to the nth track is configured in the variable point [n] indicating the address where the first mantissa of the compressed data for one block is stored. An address at which the first mantissa of the mantissa is stored is substituted, and a variable count [n] indicating a relative address in the block (which indicates how many data is from the head of the block) is set to “0”. When the user instructs the n-th track to stop the expansion process, the flag flag [n] is set to a value “0” indicating that the expansion process is stopped by a process not shown.
[0041]
The data decompression unit 24 performs the operation shown in the flowchart for each clock cycle of the sampling frequency.
When the data decompression unit 24 starts the operation, in step S101, the variable n indicating the track number is initialized to “0”, the process proceeds to step S102, and the value of the flag flag [n] is determined.
[0042]
If it is determined in step S102 that the value of the flag flag [n] is “0”, the n-th track is stopped, and the process proceeds to step S103, where the value is set as the PCM data of the n-th track. “$ 0000” is sent to the output unit 25, and the process proceeds to step S111.
If it is determined in step S102 that the value of the flag flag [n] is “1”, the nth track is being expanded, and the process proceeds to step S104, where the mantissa determined from the reference exponent and the parameter is set. Based on the bit length, the decompressed data based on the count [n] th mantissa from the head of the block in the mantissa of one block whose head mantissa is stored at the address indicated by the variable point [n]. Is sent to the output unit 25, and the process proceeds to step S105 to determine whether or not the end of the compressed phrase data representing the audio phrase corresponding to the nth track has been reached. In this determination, point [n] is compared with the address of the compressed data area in which the first mantissa of the compressed data of the final block of the speech phrase is stored, and count [n] is compared with the speech. This is done by comparing the mantissa corresponding to the final PCM data of the phrase with the relative address in the block containing the PCM data.
[0043]
If it is determined in step S105 that the end of the compressed phrase data has been reached, the process proceeds to step S106, where the value of the flag flag [n] is set to “0”, so that the nth track is not being decompressed. The process proceeds to step S111.
If it is determined in step S105 that the end of the compressed phrase data has not been reached, the process proceeds to step S107, the value of the variable count [n] is incremented, and the process proceeds to step S108.
[0044]
In step S108, it is determined whether or not the value of the variable count [n] has become “16”, and thereby it is determined whether or not data for one block has been output. If it is determined in step S108 that the value of the variable count [n] is not “16”, it means that one block of data has not been output, and the process proceeds to step S111 without doing anything. . If it is determined in step S108 that the value of the variable count [n] has become “16”, this means that one block of data has been output. Therefore, in step S109, the value of the variable count [n] Set to “0” and proceed to step S110, the bit length of the mantissa is obtained based on the reference exponent and the parameter, the value of the variable point [n] is advanced by one block according to the bit length of the mantissa, and the next block The reference index constituting the compressed data is acquired, and the process proceeds to step S111.
[0045]
In step S111, the value of the variable n is incremented and the process proceeds to step S112, where it is determined whether or not the value of the variable n has reached the number of tracks TRK. If the value of the variable n has reached the number of tracks TRK, the operation is terminated. If not, the operation returns to step S102, and the above operation is repeated for the next track.
FIG. 4 is a flowchart showing another operation of the data decompression unit 24.
[0046]
The operation shown in the flowchart of FIG. 3 is an operation that is executed every sampling cycle and one PCM data is output for each track. However, the operation shown in this flowchart is executed every 16 sampling cycles, This is an operation in which one block of PCM data is output together.
When the operation of the data decompression unit 24 is started, a variable n indicating a track number is initialized to “0” in step S201, and the process proceeds to step S202, where the value of the flag flag [n] is determined.
[0047]
If it is determined in step S202 that the value of the flag flag [n] is “0”, the process proceeds to step S203, and 16 values “$ 0000” are sent to the output unit 25 as PCM data of the nth track. The process proceeds to step S208.
If it is determined in step S102 that the value of the flag flag [n] is “1”, the process proceeds to step S204, where the address of the voice phrase corresponding to the nth track is indicated by the variable point [n]. All the compressed data for one block starting is decompressed and sent to the output unit 25, and the process proceeds to step S205.
[0048]
In step S205, it is determined whether or not the final block of the audio phrase corresponding to the nth track has been reached. If it is determined that the final block has been reached, the process proceeds to step S206, and the value of the flag flag [n] is set. As a result, the nth track is stopped and the process proceeds to step S208. If it is determined in step S205 that the final block has not been reached, the process proceeds to step S207, the value of the variable point [n] is advanced by one block, and the process proceeds to step S208.
[0049]
In step S208, the value of the variable n is incremented and the process proceeds to step S209, where it is determined whether or not the value of the variable n has reached the number of tracks TRK. If the value of the variable n has reached the number of tracks TRK, the operation is terminated. If not, the operation returns to step S202, and the above operation is repeated for the next track.
The PCM data created by the data decompression unit 24 by the above operation is sent to the output unit 25.
[0050]
Returning to FIG. 2, the description will be continued. The output unit 25 has two memories for storing one block of PCM data for each track of the data decompression unit 24, and the PCM data sent from the data decompression unit 24 to the memory on one side Is stored, and the PCM data stored in the memory on the other side is output every sampling period. Each time 16 pieces of PCM data are output, the usage mode of the two memories is switched and the above operation is repeated.
[0051]
The music sound reproducing device 2 is further provided with an amplifier 26 and a speaker 27. The PCM data of a plurality of tracks output from the output unit 25 is amplified by the amplifier 26, and a plurality of audio phrases are simultaneously generated from the speaker 27. Note that the output unit 25 may add the signals of all the expanded tracks and output them. In this case, in a state where the compressed data is expanded, the data formats (in this case, 16 bits) are complete, so that it is easy to add.
[0052]
In each of the above embodiments, the case where the audio phrase is monaural has been described. However, in the data compression device, the data decompression device, and the music sound reproduction device of the present invention, the audio phrase may be stereo. In this case, for example, data indicating whether the audio phrase is stereo or monaural is stored for each audio phrase at the time of data compression, and based on data indicating whether the audio phrase is stereo or monaural at the time of data decompression. In the case of monaural, data expansion processing is performed in one track, and in the case of stereo, data expansion processing is performed in two tracks.
[0053]
In each of the above embodiments, the case where the sampling frequency is the same for any audio phrase has been described. However, a plurality of sampling frequencies are prepared, and an optimal sampling frequency is selected for each audio phrase during data compression. Data indicating the sampling frequency may be stored in association with the audio phrase, and the data expansion processing may be performed at the sampling frequency for each audio phrase at the time of data expansion.
[0054]
In this case, when PCM data is stored in the memory 11 of the data compression device, it may be stored at a sampling frequency corresponding to the voice phrase, or when stored in the memory 11, all voice phrases are sampled at the same sampling rate. The data may be temporarily stored in the frequency, and then rewritten to the data in which the sampling frequency is converted. Generally, when the sampling frequency is converted to M / N times (M and N are both integers), the following processing is sequentially performed.
[0055]
(First process)
So-called M-times oversampling is performed in which M−1 pieces of PCM data having a value of “0” are inserted between each PCM data.
(Second process)
A PCM in which a first process is applied to a filter that passes a frequency component equal to or lower than the Nyquist frequency corresponding to the lower sampling frequency of the original sampling frequency and the converted sampling frequency multiplied by M / N Data is passed.
[0056]
(Third process)
So-called 1 / N times downsampling is performed in which PCM data is extracted every Nth piece from the PCM data subjected to the second processing. PCM data other than the extracted PCM data is discarded.
The compressed data obtained by subjecting the PCM data subjected to such sampling frequency conversion to data compression processing is output after being subjected to data decompression processing at the sampling frequency for each audio phrase as described above. However, it may be output at each sampling frequency associated with each voice phrase at that time, or the sampling frequency is converted again so that it is unified to one sampling frequency according to the capability of the external device. May be output. In order to unify to one sampling frequency, for example, processing is performed as follows. Operate the decompression device at the least common multiple cycles of multiple sampling frequencies, and read each track at the sampling frequency cycle of the track's own phrase (once every one of the least common multiple frequency cycles). -Decompression is performed, "0" is output at other timings, and filter processing is performed at the frequency cycle of the least common multiple. Further, after conversion of the sampling frequency is performed again so as to be unified to one sampling frequency, each PCM data may be added and output.
[0057]
【The invention's effect】
As described above, according to the data compression apparatus of the present invention, a plurality of compressed data with different compression rates can be generated with a single data compression algorithm. It can be easily done based on a single data decompression algorithm.
[0058]
According to the data decompression apparatus of the present invention, it is possible to easily decompress the plurality of compressed data generated by the data compression apparatus of the present invention and having different compression ratios based on a single data decompression algorithm.
According to the data decompression apparatus of the present invention, it is possible to easily decompress a plurality of compressed data having different compression ratios based on a single data decompression algorithm, and simultaneously to a plurality of audio phrases based on the plurality of compressed data. Can be played.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of a data compression apparatus of the present invention.
FIG. 2 is a block diagram showing a musical sound reproducing apparatus including an embodiment of the data decompression apparatus of the present invention.
FIG. 3 is a flowchart showing the operation of the data decompression unit 24;
FIG. 4 is a flowchart showing another operation of the data decompression unit 24;
[Explanation of symbols]
1 Data compression device
2 Musical sound playback device
14 Data compression unit
15 Parameter setting section
23 Parameter acquisition unit
24 Data decompression section
26 Sound source
27 Amplifier
28 Speaker

Claims (3)

音声フレーズを表す、音声データの連続からなるフレーズデータにデータ圧縮処理を施して、指数データ部および仮数データ部からなる圧縮データによって構成されてなる圧縮フレーズデータを生成するデータ圧縮装置において、
前記音声フレーズに、前記指数データ部に対する前記仮数データ部のビット数の対応関係を規定する複数のパラメータを対応づけるパラメータ対応付手段と、
前記仮数データ部のビット数が可変のデータ圧縮アルゴリズムを用いて、音声フレーズを表すフレーズデータを、該音声フレーズに対応づけられた複数のパラメータに応じたビット数の仮数データ部を用いてデータ圧縮するデータ圧縮手段とを備え、
前記データ圧縮手段が、前記フレーズデータに圧縮処理を施すにあたり該フレーズデータが所定数の連続した音声データ毎に分割されてなる各区分毎に、該区分に含まれる連続した音声データそれぞれのデータレベルのうち最大のデータレベルを表す指数データ部を生成するとともに、該最大のデータレベルを基準として、該区分に含まれる連続した音声データのデータレベルに対応するデータレベルそれぞれを、該フレーズデータに対応づけられてなるパラメータおよび該最大のデータレベルに基づいて、該最大のデータレベルが大きいほど等しいか大きくなるように決定されるビット数で表す仮数データ部を生成し、該区分に含まれる一連の音声データを、該指数データ部および該仮数データ部からなる圧縮データに置き換えるものであることを特徴とするデータ圧縮装置。
In a data compression device for generating compressed phrase data composed of compressed data consisting of an exponent data part and a mantissa data part by performing data compression processing on phrase data consisting of a series of voice data representing a voice phrase,
Parameter association means for associating a plurality of parameters defining a correspondence relationship between the number of bits of the mantissa data portion with respect to the exponent data portion to the voice phrase;
Using a data compression algorithm in which the number of bits of the mantissa data portion is variable, the phrase data representing the speech phrase is compressed using the mantissa data portion having the number of bits corresponding to a plurality of parameters associated with the speech phrase. Data compression means for
When the data compression means performs compression processing on the phrase data, the data level of each continuous audio data included in the division is divided into each division obtained by dividing the phrase data into a predetermined number of continuous audio data. The index data portion representing the maximum data level is generated, and the data level corresponding to the data level of the continuous audio data included in the section is associated with the phrase data with the maximum data level as a reference. A mantissa data part represented by the number of bits determined to be equal or larger as the maximum data level is larger based on the parameter and the maximum data level, and a series of data included in the partition Replace audio data with compressed data consisting of the exponent data part and the mantissa data part. Data compression apparatus characterized by.
音声フレーズを表す、音声データの連続からなるフレーズデータがデータ圧縮されてなる圧縮フレーズデータにデータ伸長処理を施すデータ伸長装置において、
前記圧縮フレーズデータが、音声フレーズを表す、音声データの連続からなるフレーズデータが所定数の連続した音声データ毎に分割されてなる各区分に含まれる連続した音声データそれぞれのデータレベルのうち最大のデータレベルを表す指数データ部、および該最大のデータレベルを基準として、該区分に含まれる連続した音声データのデータレベルに対応するデータレベルそれぞれを表した仮数データ部からなる圧縮データによって構成されてなるものであり、該仮数データ部は、前記指数データ部に対する該仮数データ部のビット数の対応関係を規定するために該フレーズデータに対応づけられた複数のパラメータおよび該最大のデータレベルに基づいて、該最大のデータレベルが大きいほど等しいか大きくなるように決定されるビット数を有するものであって、
前記圧縮フレーズデータに対応する複数のパラメータを取得するパラメータ取得手段と、
前記圧縮データを構成する指数データ部を取得し、該圧縮データを含む圧縮フレーズデータに対応する、前記パラメータ取得手段により取得されたパラメータ、および該指数データ部に基づいて、該圧縮データを構成する仮数部のビット数を求め、該ビット数に応じて該仮数データ部を取得し、該圧縮データをデータ伸長することによって、前記圧縮フレーズデータをデータ伸長するデータ伸長手段とを備えたことを特徴とするデータ伸長装置。
In a data decompression device that performs data decompression processing on compressed phrase data obtained by compressing phrase data consisting of a series of speech data that represents a speech phrase,
The compressed phrase data represents a voice phrase. Phrase data consisting of a series of voice data is divided into a predetermined number of pieces of continuous voice data. An exponent data portion representing a data level, and compressed data including a mantissa data portion representing each of the data levels corresponding to the data levels of continuous audio data included in the section with the maximum data level as a reference The mantissa data portion is based on a plurality of parameters associated with the phrase data and the maximum data level to define a correspondence relationship between the exponent data portion and the number of bits of the mantissa data portion. Therefore, the larger the maximum data level is, the larger or the same is determined. Be one having a bet number,
Parameter acquisition means for acquiring a plurality of parameters corresponding to the compressed phrase data;
An exponent data part constituting the compressed data is obtained, and the compressed data is constituted based on the parameter obtained by the parameter obtaining unit corresponding to the compressed phrase data including the compressed data, and the exponent data part. Data decompression means for obtaining the number of bits of the mantissa part, obtaining the mantissa data part according to the number of bits, and decompressing the compressed data, thereby decompressing the compressed phrase data. Data decompression device.
前記データ伸長手段が、複数の圧縮フレーズデータそれぞれを、前記データ圧縮アルゴリズムに対応する、これら複数の圧縮フレーズデータに共通のデータ伸長アルゴリズム、および前記パラメータ取得手段で取得した、これら複数の圧縮フレーズデータそれぞれに応じた複数のパラメータに基づいて、同時にデータ伸長するものであることを特徴とする請求項2記載のデータ伸長装置。  The plurality of compressed phrase data obtained by the data decompression means, the data decompression algorithm corresponding to the data compression algorithm, the data decompression algorithm common to the plurality of compressed phrase data, and the parameter obtaining means. 3. The data decompression apparatus according to claim 2, wherein data decompression is performed simultaneously based on a plurality of parameters corresponding to each.
JP21512597A 1997-08-08 1997-08-08 Data compression device and data decompression device Expired - Fee Related JP3884131B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21512597A JP3884131B2 (en) 1997-08-08 1997-08-08 Data compression device and data decompression device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21512597A JP3884131B2 (en) 1997-08-08 1997-08-08 Data compression device and data decompression device

Publications (2)

Publication Number Publication Date
JPH1152996A JPH1152996A (en) 1999-02-26
JP3884131B2 true JP3884131B2 (en) 2007-02-21

Family

ID=16667151

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21512597A Expired - Fee Related JP3884131B2 (en) 1997-08-08 1997-08-08 Data compression device and data decompression device

Country Status (1)

Country Link
JP (1) JP3884131B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6596647B2 (en) * 2016-03-24 2019-10-30 国立研究開発法人防災科学技術研究所 Earthquake motion time series data processing apparatus, earthquake motion time series data processing system using the same, and time series data processing method

Also Published As

Publication number Publication date
JPH1152996A (en) 1999-02-26

Similar Documents

Publication Publication Date Title
US5744739A (en) Wavetable synthesizer and operating method using a variable sampling rate approximation
KR20010039504A (en) A period forcing filter for preprocessing sound samples for usage in a wavetable synthesizer
US5824936A (en) Apparatus and method for approximating an exponential decay in a sound synthesizer
JP3884131B2 (en) Data compression device and data decompression device
US20020066359A1 (en) Tone generator system and tone generating method, and storage medium
JP2001255876A (en) Method for expanding and compressing musical sound waveform signal in time base direction
JP4174859B2 (en) Method and apparatus for mixing digital audio signal
JP2007142547A (en) Coding method and decoding method, and coder and decoder employing same
JP3925349B2 (en) Apparatus and method for synchronous reproduction of audio data and performance data
US6300552B1 (en) Waveform data time expanding and compressing device
JP3826870B2 (en) Compressed data structure, waveform generation device, and waveform storage device
JPS642960B2 (en)
JP2674161B2 (en) Sound source data compression coding method
JP2003271198A (en) Compressed data processor, method and compressed data processing program
JP2712421B2 (en) Sound source device
JP3510493B2 (en) Audio signal encoding / decoding method and recording medium recording the program
US7795526B2 (en) Apparatus and method for reproducing MIDI file
JP4107085B2 (en) Waveform data compression method
JP2864508B2 (en) Waveform data compression encoding method and apparatus
JP4037973B2 (en) Waveform playback device
JPH06342291A (en) Electronic musical instrument
JPH02137889A (en) Signal recording method
JP2900076B2 (en) Waveform generator
JP2900078B2 (en) Waveform recording / playback method and waveform playback device
JP2712422B2 (en) Continuous sound data playback device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040720

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060516

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060523

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060713

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061017

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061026

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061116

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313532

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20101124

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111124

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees