JP2004239930A - Method and system for detecting pitch in packet loss compensation - Google Patents

Method and system for detecting pitch in packet loss compensation Download PDF

Info

Publication number
JP2004239930A
JP2004239930A JP2003025727A JP2003025727A JP2004239930A JP 2004239930 A JP2004239930 A JP 2004239930A JP 2003025727 A JP2003025727 A JP 2003025727A JP 2003025727 A JP2003025727 A JP 2003025727A JP 2004239930 A JP2004239930 A JP 2004239930A
Authority
JP
Japan
Prior art keywords
frame
pitch
correlation
data
calculation
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.)
Pending
Application number
JP2003025727A
Other languages
Japanese (ja)
Inventor
Sachiko Nagakura
祥子 長倉
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.)
Iwatsu Electric Co Ltd
Original Assignee
Iwatsu Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Iwatsu Electric Co Ltd filed Critical Iwatsu Electric Co Ltd
Priority to JP2003025727A priority Critical patent/JP2004239930A/en
Publication of JP2004239930A publication Critical patent/JP2004239930A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce the load applied to a CPU caused by the pitch detection of speech being carried out between initial frames of a frame disappearance section in the pitch detection of speech communication using a packet. <P>SOLUTION: Correlation computation is performed at all times and the pitch detection (7) is performed to form interpolation data by pitch buffers PB 1 to 5, a correlation computation section 5, and a correlation buffer 6 so as to be ready for disappearance of the next frame. When the frame disappearance occurs, input data 1 is subjected to interpolation processing (8), by which the immediate interpolation of the disappeared speech data can be immediately interpolated. Since the load of the correlation computation is small, the amount of the operation requiring urgency that arises in the event of the disappearance is extremely little and the circuit arrangement of the correlation computation section 5 and the like by the slow-speed and low-cost CPU is possible. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、パケットによる音声通信におけるピッチ検出方法と装置に関する。さらに具体的には、フレームが消失した場合のパケット損失を補償する音声ピッチ検出方法と装置に関わる。国際電気通信連合の電気通信標準化部門(ITU−T)の勧告G.711 APPENDIX I(以下単に、ITU−T勧告という)に示している推薦案「パケット損失補償方法」において、演算処理を平均化することでCPUにかかる負荷を軽減する改良された方法と装置を提供するものである。
【従来の技術】
【0002】
ITU−T勧告の「パケット損失補償方法」では、音声通信において、フレームが消失した場合のフレーム消失区間の最初のフレーム間で音声のピッチ検出が行われる。このピッチ検出において、消失したフレームの直前の20ms(160サンプル)の音声とそれより過去の音声との正規化相互相関計算が実行される。これが、CPUにおける演算量の大部分を占めている。
【0003】
ITU−T勧告では、フレーム消失区間の最初に、消失したフレームの直前の音声データを48.75ms(390サンプル)長のピッチ・バッファにコピー(記憶)する。この記憶(格納)された音声データは、現時点の音声のピッチ(基本波の周期)を計算するため、および、消失したフレームの期間に存在したであろうと推定される音声の波形を抽出し再現するために、使用される。
【0004】
音声データのピッチは、5ms(40サンプル)から15ms(120サンプル)までの範囲であり、ピッチ・バッファに記憶した最近(最新)の20ms(160サンプル)の音声とそれより過去の音声との、正規化相互相関のピークを見つけることで、推定される。
【0005】
正規化相互相関 pitch(i) は、相互相関M(i)を自己相関S(i)の平方根で除算して求めることができる。消失したフレームの期間である消失区間の直前に入力された音声データをx(n)、サンプル番号をi,kおよびnとする。
M(i)=Σx(n−k)・x(n−i−k) (1)
S(i)=Σx(n−i−k) (2)
ここで、Σはk=0からkまでの累和を表している。x(n−k)はx(n)のkサンプル前の音声データを表し、x(n−i−k)はx(n−k)のiサンプル前の音声データを表している。
【0006】
式(1),(2)を用いて、正規化相互相関 pitch(i)を求めると、
pitch(i)=M(i)/{S(i)}1/2 (3)
となる。ピッチ検出は、k=0〜159の160サンプルにつきi=40〜120の範囲において、 pitch(i)が最大値を示すiの値を検出する。
【0007】
式(3)では、1つの正規化相互相関 pitch(i)を求めるために、式(1)の積和演算を160回(k=0〜159)、式(2)の積和演算を160回(k=0〜159)と平方根({ }1/2)を1回行い、さらに、式(3)の除算を1回実行する必要がある。式(1)と(2)の積和演算にそれぞれ1サイクル、式(2)の平方根に10サイクルおよび式(3)の除算に10サイクルの演算量がかかると仮定すると、1回の正規化相互相関 pitch(i)を求める計算で、160×2+10+10=340サイクルを必要とし、これを、i=40〜120について81回計算するので、27,540サイクルの演算量を必要とする。
【0008】
すなわち、式(3)の正規化相互相関 pitch(i)を求めるためには、27,540サイクルの演算量を必要とするのである。これだけの演算量を実行して、はじめて、式(3)の正規化相互相関 pitch(i)が最大値を示すiの値を検出することが可能となる。
【0009】
このように大きな演算量の実行を回避するために、ITU−T勧告では、以下の方法による低演算量化を提案している。
【0010】
ピッチの推定は、2段階に分けて計算する。その第1段階では、2対1に間引いた音声データ信号で粗い探索を実行してピーク値を検出する。第2段階では、粗い探索で検出したピーク値の付近で、詳細な探索を実行する。
【0011】
第1段階の粗い探索では、式(2)の自己相関計算で、i=120において、
S(i)=Σx(n−i−2k) (4)
すなわち、
S(120)=Σx(n−120−2k)
ここで、第1段階で2対1に間引いた結果、式(4)において、Σはk=0から79までの累和を表し、2対1に間引いたので式(2)のkに代えて2kを用いている。
【0012】
差分計算は、
S(i+1)−S(i)=x(n−120−i) −x(n−i) (5)
で表されることから、
S(i)=S(i+1)−x(n−120−i) +x(n−i) (6)
となる。式(6)において、i=119〜40のうち、2対1に間引いたのでiが偶数のときのみ、すなわち、40回計算する。
【0013】
自己相関計算の場合と同様に、式(1)の相互相関計算で、i=120とおいて、
M(i)=Σx(n−2k)・x(n−i−2k) (7)
となる。ここで、第1段階で2対1に間引いた結果、式(7)において、Σはk=0から79までの累和を表し、式(1)のkに代えて2kを用いている。式(7)において、i=119〜40のうち、iが偶数のときのみ、すなわち、41回計算する。
【0014】
式(7)で得た相互相関M(i)と、式(6)で得た自己相関S(i)とから、粗い(i=119〜40のうちのiが偶数時)正規化相互相関 pitch(i)を求める。
pitch(i)=M(i)/{S(i)}1/2 (8)
【0015】
したがって、式(8)の粗い正規化相互相関 pitch(i)を探索するのに必要な演算量は、自己相関計算に80サイクル、差分計算に2×40=80サイクル、相互相関計算に80×41サイクル、平方根計算に10×41サイクル、除算計算に10×41サイクルの第1段階の計4,260サイクルが必要となる。
【0016】
第2段階では、第1段階で4,260サイクルの計算により求めた式(8)の粗い正規化相互相関 pitch(i)の探索で検出したピーク値iとその前後の3値(i−1,i,i+1)で、サンプルを間引かずに詳細な正規化相互相関 pitch(i)の探索を実行する。
【0017】
すなわち、式(3)において、k=0〜159として、
pitch(i+1)=M(i+1)/{S(i+1)}1/2 (9)
pitch(i)=M(i)/{S(i)}1/2 (10)
pitch(i−1)=M(i−1)/{S(i−1)}1/2 (11)
となる。
【0018】
第2段階の演算量は、自己相関計算に160サイクル、差分計算に2×2=4サイクル、相互相関計算に160×3サイクル、平方根計算に10×3サイクル、除算計算に10×3サイクルの第2段階の計704サイクルとなる。第1段階と第2段階の合計は、4,964サイクルとなる。
【0019】
第1段階と第2段階の合計では、4,964サイクルとなるから、ITU−T勧告をそのまま実行したときに必要とされる27,540サイクルの演算量に対して、約20%に削減される。しかしながら、ITU−T勧告の低演算量化提案を実行したときに発生する演算量は、4,964サイクルである。これを125μs(8kHz)の期間内で処理しようとすると、CPUにおける処理量(IPS:1秒あたりの命令数)は、4964/0.000125=39.712MIPS(M:メガ)となり、依然として、CPUにとって大きな負荷となっている。
【0020】
図10には、従来例の装置における補間処理の動作を示すタイムチャートが示されている。同図(a)に示した音声の入力データ1においては、データ番号0〜79=80個のサンプル(sa)のデータが1フレーム(t8〜t10)に含まれている。ここで、1saは、125μsである。時点t10〜t12のフレームが消失した場合を想定する。同図(c)には、(a)の入力データ1を30sa分遅れさせた遅延データ3が示されている。ここで、(b)は、説明の便宜上、欠番となっている。
【0021】
(d)のフレーム消失信号15は、時点t10までは“L”のままであるが、時点t10においてフレームの消失を検出すると“H”となり、時点t12においてフレームが検出されると、再び“L”となる。ITU−T勧告では、補間データと消失直前の入力データ1を滑らかに接続するために、消失直前の30サンプル(sa)分の遅延データ3(c)と補間データを前方(t32〜t34の方向)に延長したデータの重畳加算を時点t32〜t34の間行っている。また、補間データと消失直後の入力データを滑らかに接続するために、消失フレームの直後の30sa分の遅延データ3(c)と補間データを後方に延長したデータとの重畳加算を時点t35〜t36の間行っている。
【0022】
重畳加算は、時点t10〜t33の遅延データ3(c)において、t10のデータ番号50を補間データに加算する場合には、遅延データの割合を大きく補間データの割合を小さくし、その後t33に近づくにつれて遅延データの割合を小さく補間データの割合を大きくしている。1sa遅れた出力データ2(e)の時点t32〜t34の間は、遅延データの割合を徐々に小さく補間データの割合を徐々に大きくして、t34以後はt35迄補間データのみとなる。
【0023】
さらに、時点t37〜t38の遅延データ3(c)において、t37のデータ番号0を補間データに加算する場合には、遅延データの割合を小さく補間データの割合を大きくし、その後t38に近づくにつれて補間データの割合を小さく遅延データの割合を大きくしている。1sa遅れた出力データ2(e)の時点t35〜t36の間は、補間データの割合を徐々に大きくして、t36以後は遅延データのみとなる。
【0024】
(e)の出力データ2は、(c)の遅延データ3よりも1saだけ遅れて出力される。時点t10においてフレームの消失が検出されると、そこから1sa分の125μsの期間内で、前記第1段階と第2段階の演算処理がなされて、補間データが出力される。出力データ2は、時点t10から125μs遅れた時点t32からt34の間(30サンプル分:3.75ms)は重畳加算された補間データであり、t34〜t35の間は重畳加算されていない補間データであり、t35からt36の間は重畳加算された補間データとなっている。
【0025】
フレーム消失信号(d)の発生した時点t10からt32の125μsの間に前記第1段階と第2段階の演算処理が完了しなければ、消失フレームの発生によって、音声データが途切れることになる。このような事態は絶対に避けねばならないから、この125μsの間に演算処理を完了しなければならないCPUにとって大きな負荷となる。
【0026】
【発明が解決しようとする課題】
ITU−T勧告をそのまま実行したときに必要とされる27,540サイクルの大きな演算量の実行を回避するために、ITU−T勧告の低演算量化提案を採用したとしても、CPUに対する負荷は依然として重い。さりとて、CPUにおける演算処理時間を延ばすことは、消失フレームの補間処理が遅延して音声信号に不都合を生じてしまうこととなるから許されず、解決されなければならない課題であった。
【0027】
CPUおよび、その周辺の回路素子の演算速度を上げることにより、補間処理の遅延を避けることは技術的には可能であるが、著しいコストアップを伴うから、実施することができないという重大な問題点があった。
【0028】
【課題を解決するための手段】
本発明は、パケットによる音声通信において、フレームが消失した場合のパケット損失を補償する場合に発生する、CPUにかかる大きな負荷を軽減するべく、演算処理を平均化するようにしている。
【0029】
音声データを含むフレームが消失するのに備えて、フレーム消失の有無にかかわらず、常時、一連の正常なフレーム列から正規化相互相関計算をして音声のピッチを検出して、一連の正常なフレーム列の直後に入力される次フレームが消失フレームであった場合に、その消失フレームに、検出された音声のピッチに基づいて得た補間データを補間するようにした。この補間作業においては、フレームの消失寸前の30サンプル分のデータを、重畳加算できるようにしている。
【0030】
ピッチ・バッファはフレーム周期が10ms(80サンプル)の場合は、フレーム消失直前の390サンプルを格納(記憶)するとして、390/80=4.9 となるから、5個のピッチ・バッファを用意している。
【0031】
自己相関および相互相関を求めて、音声データのピッチ検出をし、補間データを作成しておく演算作業を、フレーム消失が発生するか否かにかかわらず、常時実行している。演算は、常時分散して実行されているために、その計算速度は遅いものでも、十分に対応できる。
【0032】
フレーム消失が発生すると、ピッチ・バッファにおける音声データの更新は止められ、すでに検出された最新の音声データのピッチから得た補間データにより、消失したフレームを補間する。フレーム消失という異常な事態が発生した時点では、消失したフレームを補間するのに必要なピッチおよび補間データがすでに作成済みであるから、フレーム消失の発生時における処理量は、極めて小さく、消失フレームの補間処理が遅延して音声信号に不都合を生じてしまうこともない。
【0033】
【発明の実施の形態】
図1および図2は、本発明の実施の形態を示す回路構成図、および回路構成の動作を従来例(図10)と対比して説明するためのタイムチャートである。ここにおいて、従来例を示す図10の要素と同じものについては、同じ記号を用いた。図2において、図10と異なる点は、(b)のスイッチ30と(f)のスイッチSWの機能が追加されている点である。
【0034】
すなわち、(b)のスイッチ30は、時点t31からt10の間(30sa分:3.75ms)はオンとなり、それ以外においてオフとなっている。(f)のスイッチSWは、時点t32からt36の間は端子a側に接続され、それ以外において端子b側に接続される。時点t10までに相関計算は終了している。
【0035】
音声データが入力データ1(a)として印加されている。入力データ1は、遅延器DLによって30sa分(t31からt10の間)遅延し、切替スイッチSWの端子b側に接続されて、出力バッファ10において1sa(サンプル:1サンプルは125μs)遅れて、従来例と同じく出力データ2として出力される。入力データ1はフレーム構成で、1フレーム中に音声信号からサンプルして得た80サンプル分のデータを含んでいる。
【0036】
何等かの理由でフレームが消失すると、消失したフレームの音声を再現できなくなるから、消失したフレームのデータを、消失前の音声データから相関計算し、音声のピッチを検出して推定し、その推定したデータで、消失したフレームのデータを補間している。入力データ1にフレームの消失が発生すると、フレーム消失検出部9がこれを検出し、フレーム消失信号15を出力し(t10)、1sa分遅れて(t32)切替スイッチSWを端子a側に切替て、消失したフレームを補間する補間データ26を、出力バッファ10を介して出力データ2として出力する。このフレーム消失検出部9、遅延器DLおよび出力バッファ10の構成は従来例と同じであり、公知である。
【0037】
補間処理が終り、正常なフレームの入力をフレーム消失検出部9が時点t12で確認すると、フレーム消失信号15が終了した後、60sa分(t12〜t38)経過することにより、次のサンプルで切替スイッチSWを端子b側に切替える(t36)。正常なフレームの入力をフレーム消失検出部9が確認している間は、切替スイッチSWは端子b側にあって、出力データ2は出力され、ピッチ・バッファPB1〜5にも同時に印加され、そこに一時格納(記憶)される。遅延データ3(c)における消失フレーム開始時点t33は、遅延器DLによって30sa分遅れている。
【0038】
スイッチ30(b)は、入力データ1(a)の1フレームの最後の30sa分(t31〜t10:3.75ms:データ番号50〜79)の間オンすることにより、消失するかもしれない次のフレーム開始の直前の30sa分をピッチ・バッファPB1に格納する。この30sa分は、遅延データ3(c)における時点t10〜t33(データ番号50〜79)に対応しており、ピッチ検出と出力データ2(e)における時点t32〜t34(データ番号50〜79)の重畳加算において、使用される。
【0039】
ピッチ・バッファ出力21は、補間処理部8と相関計算部5に送られる。相関バッファ6には、5個の経過バッファPAB1〜5、2個の自己相関バッファSCB1,2と、2個の相互相関バッファMCB1,2が含まれている。相関計算部5と相関バッファ6の間においては、相関入出力22により、相関計算中のデータのやりとりが行われる。
【0040】
自己相関バッファSCB1,2の自己相関バッファ出力23と、相互相関バッファMCB1,2の相互相関バッファ出力24とは、ピッチ検出部7に送られる。ここで音声のピッチが検出されて、ピッチ・データ25が補間処理部8に送られ、作成された補間データ26が切替スイッチSWの端子a側に印加される。フレーム検出部9がフレームの消失を検出すると、フレーム消失信号15により、切替スイッチSWは端子a側に切替られて、補間データ26で補間されたフレームが出力バッファ10を介して出力データ2として出力される。
【0041】
図3には、図1に示した回路構成の動作原理を説明するためのタイムチャートが示されている。5個のピッチ・バッファPB1〜5のうちの1つのピッチ・バッファPB1を代表例として、説明している。
【0042】
図3(a)のフレーム(F)は、時点t0に始まり、時点t2迄に0〜79の80サンプル(sa)分のデータを含んでいる。以下同様に、t4,t6,・・・t10と続いている。同図(b)のピッチ・バッファPB1は、記憶開始時点tsからデータの一時記憶を開始する。ピッチ・バッファPB1の記憶容量は390sa分(0〜389)である。時点t10において、ピッチ・バッファPB1は満杯となる。
【0043】
音声のピッチ計算には280sa分のデータを必要とする。そこで時点t3において、同図(c)の相関計算部5の動作が開始されたとする。自己相関計算は時点t3〜t7(160sa分)の間に行われる。自己相関差分計算は時点t7〜t9(80sa分)の間に行われる。相関計算部5の動作は、時点t6〜t10(160sa分)の間に行われる。
【0044】
同図において、もし、時点t10以後のフレームが消失したときには、ピッチ検出部7および補間処理部8の動作により、時点t10から1sa分(125μs)の間にピッチを検出し、補間データ26を得ている。ピッチ・バッファPB1〜5、CPU構成の相関計算部5および相関バッファ6は、ピッチ・バッファ制御部11と相関バッファ制御部12の制御下におかれる。時点t10〜t12において存在すべきフレームが消失したと仮定すると、この消失したフレームを補間するべく、時点t10から1sa分(125μs)の間に得た補間データ26を出力することになる。
【0045】
図3において実行される相関計算およびピッチ検出について、詳細に説明する。同図(b)のピッチ・バッファPB1には、音声のピッチを推定し、消失したフレーム区間(t10〜t12)の音声波形を抽出し推定するべく、消失した時点t10より前のts〜t10の390sa(0〜389のサンプル)が格納されている。演算処理を分散するために、自己相関計算(t3〜t7)、および相互相関計算(t6〜t10)は、データが入力されて、計算が可能となった時点で順次行う。
【0046】
ピッチ・バッファPB1が110saを格納(記憶)した時点t3から160sa格納した時点t7までの自己相関S(0)を求める。サンプル番号nの入力データをx(n)とすると、n=110〜269のとき(図3(b)ではサンプル番号0,110,230,270,349,389を表示している)、
S(0)=S(0)+x(n) (12)
を計算する。
【0047】
サンプル番号n=269になると、自己相関S(0)が求まる。
つぎに、n=111を先頭とする160saの自己相関S(1)を求める。これは、S(0)を用いて、n=270になったとき、
S(1)=S(0)−x(n−160)+x(n) (13)
で求められる。
【0048】
以降、n=190を先頭とする時点t9のn=349までの160saを用いて、t7〜t9の間に80個(=349−269)の自己相関S(i)を求めることができる。自己相関S(i)は、n=270〜349において、
i=n−269として、
S(i)=S(i−1)−x(n−160)+x(n) (14)
【0049】
相互相関M(i)は、フレームが消失する直前の160sa(t6〜t10)すなわち、n=230を先頭にした160saに対し、それぞれiサンプル(sa)前のデータを掛け合わせたものを、順次加算して求める。すなわち、t6〜t10のn=230〜389のデータに対し、たとえば、i=120のときは、同図(f)のn−i−kに1点鎖線の枠で示すn=110〜269(t3〜t7)のデータを掛け合わせて加算する。
【0050】
同図(d)のn−kに1点鎖線の枠で示すn=230〜389(t6〜t10)のデータに対し、たとえば、i=40のときは、同図(e)のn−i−kに1点鎖線の枠で示すn=190〜349(t5〜t9)のデータを掛け合わせて加算する。
【0051】
n=389のとき、i=40〜120について、相互相関M(i)は、
M(i)=Σx(n−k)・x(n−i−k) (15)
と表すことができる。ここに、Σは、k=0〜159としたときの累和を表している。
【0052】
相互相関M(i)は、n=230〜389のとき、i=40〜120について、それぞれ、
M(i)=M(i−1)+x(n)・x(n−i) (16)
を計算すれば、n=389のとき(t10)、81個全ての相互相関M(i)が求められる。
【0053】
式(12),(14),(16)によるデータ入力時の積和演算の回数は、以下のようになる。式(12)の自己相関計算でS(0)にx(n) を加算する計算を1回(=1サイクル)行う。式(14)の自己相関差分計算でS(i−1)からx(n−160) を減算する計算とx(n) を加算する計算の2回(=2サイクル)実行する。式(16)の相互相関計算で81個のi(=40〜120)についてM(i−1)にx(n)・x(n−i)を加算するから81回(=81サイクル)計算する。
【0054】
図3の相互相関計算中の時点t6〜t10の間には、自己相関計算の一部(t6〜t7)と自己相関差分計算(t7〜t9)が同時に並行して実行されるために、最大で83回(=83サイクル)の積和計算を行う。さらに、式(8)の {S(i)}1/2 を得るために式(14)の結果の平方根を得る計算に10サイクルを要するから、演算量は、83+10=93サイクルとなる。
【0055】
フレーム消失が時点t10において発生すると、すでに求めた相互相関M(i)と自己相関の平方根{S(i)}1/2 で除算する計算をして、式(8)の正規化相互相関 pitch(i)を求めて消失したフレームを補間する。フレーム消失が発生した時点t10において、必要とされる計算は、演算量削減のために2対1に間引いた信号で粗い探索を行う。
【0056】
その後に、粗い探索で求めたピーク付近で詳細な探索をするならば、41+2=43回の除算で済むので、各除算に10サイクルを要するから、その除算をするのに43回×10サイクル=430サイクルとなる。これは、ITU−T勧告の低演算量化提案をそのまま実行したときの4,964サイクルの10%以下であるから、相関計算部5などを含むCPUの負荷は極めて小さい。
【0057】
以上の説明においては、ピッチ・バッファPB1を代表例として述べたが、相互相関計算が終る時点t10において、丁度都合よく消失フレームが発生するとは限らない。そのために、ピッチ・バッファPBを5個用意して、いつ消失フレームが発生しても、いずれかのピッチ・バッファPBが図3に示した状態となっているようにしたので、ただちに対処できる。
【0058】
図4には、図1に示した回路構成の構成要素であるピッチ・バッファのフレームに対する動作内容を説明するためのタイムチャートが示されている。同図(a)には、時点t0〜t18までのフレームが示されている。同図(b)〜(f)には、それぞれピッチ・バッファPB1〜5の動作が示されている。ここで、Sは自己相関計算、SDは自己相関差分計算、Mは相互相関計算を表している。
【0059】
フレーム消失の有無にかかわらず、入力される音声データ80sa(サンプル)を1フレームとするフレーム毎に対して、常時、自己相関計算と相互相関計算を実行するように対処しなければならない。ピッチ検出および補間のためには390sa(サンプル)のデータを格納するピッチ・バッファPBがフレーム毎に必要である。
【0060】
フレーム毎に時間的にずらして、5個のピッチ・バッファPB1〜5で対応できるようにする。1つのピッチ・バッファPBは、1フレームの消失に対してだけ対応することができるのみである。そこでたとえば、フレーム周期が10ms(80サンプル)の場合は、フレーム消失直前の390サンプルを記憶するとして、390/80=4.9 となるから、5個のピッチ・バッファPB1〜5を用意する。
【0061】
ピッチ・バッファPB1〜5には、順次入力されるフレーム毎の音声データをピッチ・バッファPB1から順次に記憶する。すなわち、5個のピッチ・バッファPB1〜5により、1フレームずつずらし、それぞれ5フレーム分の音声データが記憶されている。5フレーム期間が経過すると、最も古い音声データを記憶している、たとえば、ピッチ・バッファPB1の記憶内容は、時点t10から10sa(サンプル)の時点で更新されて、最新の音声データを記憶することになる。1個のピッチ・バッファPBについて見ると、5フレーム期間の経過ごとに記憶されている音声データが更新されることになる。
【0062】
ピッチ・バッファPB1〜5に記憶しているサンプル(音声データ)から自己相関計算S,自己相関差分計算SDおよび相互相関計算Mをして、音声データのピッチ検出をし、補間データを作成しておく作業を常時実行している。たとえば、時点t10でフレームの消失が発生すると、ピッチ・バッファPB1のデータから演算して求めた補間データが使用される。同じく、時点t12,14,16,18でフレームの消失が発生すると、それぞれ、ピッチ・バッファPB2,3,4,5のデータによる補間データが使用される。
【0063】
自己相関および相互相関を求めるために、相関バッファ6と相関計算部5が設けられ、相関バッファ制御部12による制御がなされている。CPU構成の相関計算部5における演算は、常時分散して実行されているために、その計算速度は遅いものでも、十分に対応できる。
【0064】
フレーム消失が発生すると、ピッチ・バッファにおける音声データの更新は止められ、すでに検出された最新の音声データのピッチにより、消失したフレームを補間する。フレーム消失という異常な事態が発生した時点では、消失したフレームを補間するのに必要な補間データがすでに作成済みであるから、フレーム消失の発生時における演算量は、極めて小さく、消失フレームの補間処理が遅延して音声信号に不都合を生じてしまうこともない。
【0065】
図5には、ピッチ・バッファPB1〜5のデータがフレームに割当てられる様子を説明するためのタイムチャートが示されている。同図(a)には、時点t0〜t24までのフレームの番号が示されている。同図(b)〜(f)には、それぞれピッチ・バッファPB1〜5のフレーム対応動作が示されている。たとえば、(b)のピッチ・バッファPB1のt0〜t10のデータは、フレーム6(t10〜)でフレーム消失が発生したときに使用される。同じくピッチ・バッファPB2のt2〜t12のデータは、フレーム7(t12〜)でフレーム消失が発生したときに使用される。以下、ピッチ・バッファPB3〜5も同様である。
【0066】
図6には、図5の時点t10〜t12のフレーム6でフレーム消失が発生したときのその後のピッチ・バッファPB1〜5のデータがフレームに割当てられる様子を説明するためのタイムチャートが示されている。(b)のピッチ・バッファPB1のt0〜t10のデータは、フレーム6(t10〜)でフレーム消失が発生したときには、そのデータは、(b)のピッチ・バッファPB1においては、t10で更新されずに、消失フレームを補間する補間動作がt12で終了してから更新される。
【0067】
そのかわりに、時点t10から蓄積が開始されなければならないフレーム11の消失に備えるデータは、(c)のピッチ・バッファPB2にt10以後において蓄積される。そのために、ピッチ・バッファPB1のt12〜t22のデータは、フレーム12(t22〜)が消失した場合のために、使用される。
【0068】
フレーム6の消失に続いてフレーム7も消失した場合は、(b)のピッチ・バッファPB1においてフレーム6の消失に備えたデータ(t0〜t12)で補間する。そこで、フレーム7の消失に備えてt10まで蓄積した(c)のピッチ・バッファPB2のデータは不要になるので、PB2にはt10〜t20においてフレーム11が消失した場合に備えて、データ蓄積がなされる。
【0069】
図7には、ピッチ・バッファ制御部11に含まれた5個のレジスタからなるピッチ・バッファ・カウンタPBC1〜5の動作のタイムチャートが示されている。5個のピッチ・バッファ・カウンタPBC1〜5は、5個のピッチ・バッファPB1〜5へのフレームの割り当てを制御するためのものである。各ピッチ・バッファ・カウンタPBCは、390進(0〜389)のカウンタである。
【0070】
同図(b),(c),(d),(e),(f)のピッチ・バッファ・カウンタPBC1〜5のそれぞれは、ピッチ・バッファPB1〜5へのフレームの割当てを制御している。(g)の現フレーム用ピッチ・バッファ番号PFPBNoは、たとえば、時点t0現在のフレームに割当てたピッチ・バッファPBの番号が1(PB1)であることを示している。(h)の次フレーム用ピッチ・バッファ番号NFPBNoは、たとえば、時点t0現在のフレームの次に割当てるピッチ・バッファPBの番号が2(PB2)であることを示している。以下も同様である。
【0071】
図7のフレーム割当ての手順を具体的に説明する。たとえば、ピッチ・バッファ・カウンタPBC1が、時点t8で309(=389−80)を示したとき、そのピッチ・バッファPB1の番号1を(h)の次フレーム用ピッチ・バッファ番号NFPBNoの1として記録する。ピッチ・バッファ・カウンタPBC1が、時点t10で389を示したとき、そのピッチ・バッファPB1の番号1を(g)の現フレーム用ピッチ・バッファ番号NFPBNoの1として記録する。
【0072】
現フレームが正常フレームであれば、現フレーム用のピッチ・バッファPBのデータは不要となるので、これを5フレーム後の新フレームに割当てる。現フレームが消失フレームであれば、現フレーム用のピッチ・バッファPBのデータとしてすでに用意してある補間データにより、消失データを補間し、消失フレームが連続している間は、これを使用する。そのときには、次フレーム用ピッチ・バッファは不要となるので、これを新たなフレームに割当てる。
【0073】
相関計算部5では、ピッチ・バッファPB毎にピッチ・バッファ・カウンタPBCのカウント値に応じて、相関計算を行っている。たとえば、ピッチ・バッファ・カウンタPBC1のカウント値が110〜269のときは(図3を参照)、)自己相関計算を行い、カウント値が269のときに自己相関結果の平方根を求める。
【0074】
さらに、カウント値が270〜349のときには、自己相関差分計算を行い、それぞれ差分計算結果の平方根を求める。カウント値が230〜389のときには、相互相関計算を行う。その計算結果は、相関バッファ制御部12が示す、相関バッファ6に含まれた相互相関バッファMCB1,2に格納する。
【0075】
相関バッファ6は、ピッチ・バッファPB毎に自己相関計算の途中経過を格納する5個の経過バッファPAB1〜5と、1フレームにつき81個の自己相関計算結果を2フレーム分格納する自己相関バッファSCB1,2と、1フレームにつき81個の相互相関計算結果を2フレーム分格納する相互相関バッファMCB1,2とで構成されている。
【0076】
相関バッファ制御部12は、相関計算結果を格納する相関バッファ6を制御している。経過バッファPAB1〜5は、それぞれピッチ・バッファPB1〜5に対応して割当てられる。自己相関バッファSCB1,2は、それぞれ1フレーム分づつを格納できるから、1フレーム毎に交互に割当てられる。同様に、相互相関バッファMCB1,2も、それぞれ1フレーム分づつを格納できるから、1フレーム毎に交互に割当てられる。
【0077】
図8には、相関バッファ6に含まれた経過バッファPAB1〜5の動作を説明するためのタイムチャートが示されている。同図(a)には、時点t0〜t24のフレームの番号が示されている。同図(b),(c),(d),(e),(f)の経過バッファPAB1〜5のそれぞれは、ピッチ・バッファPB1〜5のいずれかと対応している。
【0078】
たとえば、同図(c)の経過バッファPAB2はt3〜t9において、自己相関計算Sと自己相関差分計算SDの間(図4のt3〜t9)、1つのピッチ・バッファPB1に割当てられ、6番目のフレーム(t10〜)の消失に備えていることを表している。同様に、同図(d)の経過バッファPAB3はt5〜t11において、自己相関計算Sと自己相関差分計算SDの間(図4のt5〜t11)、1つのピッチ・バッファPB2に割当てられ、7番目のフレーム(t12〜)の消失に備えていることを表している。以下、同様である。
【0079】
図9には、相関バッファ6に含まれた自己相関バッファSCB1,2と相互相関バッファMCB1,2の動作を図8と対応して説明するためのタイムチャートが示されている。同図(a)には、時点t0〜t24のフレームの番号が示されている。同図(b),(c),(d),(e)の自己相関バッファSCB1,2と相互相関バッファMCB1,2の動作について、説明する。
【0080】
同図(b)の自己相関バッファSCB1は、時点t1〜t5(S)の間に求めた式(12)のS(0)と、時点t5〜t7(SD)の間に求めた式(14)のi=1〜80としたS(i)とを相互相関計算Mの終了する時点t8まで格納できればよい。同じく、(b)の自己相関バッファSCB1は、時点t5〜t9(S)の間に求めた式(12)のS(0)と、時点t9〜t11(SD)の間に求めた式(14)のi=1〜80としたS(i)とを相互相関計算Mの終了する時点t12まで格納できればよい。
【0081】
(c)の相互相関バッファMCB1は、時点t4〜t8(M)の相互相関計算Mの式(16)のi=40〜120としたM(i)を格納して、時点t8〜のフレーム番号5の消失に備える。同じく、(c)の相互相関バッファMCB1は、時点t8〜t12(M)の相互相関計算Mの式(16)のi=40〜120としたM(i)を格納して、時点t12〜のフレーム番号7の消失に備える。
【0082】
同図(d)の自己相関バッファSCB2は、時点t3〜t7(S)の間に求めた式(12)のS(0)と、時点t7〜t9(SD)の間に求めた式(14)のi=1〜80としたS(i)とを相互相関計算Mの終了する時点t10まで格納できればよい。同じく、(d)の自己相関バッファSCB2は、時点t7〜t11(S)の間に求めた式(12)のS(0)と、時点t11〜t13(SD)の間に求めた式(14)のi=1〜80としたS(i)とを相互相関計算Mの終了する時点t14まで格納できればよい。
【0083】
(e)の相互相関バッファMCB2は、時点t6〜t10(M)の相互相関計算Mの式(16)のi=40〜120としたM(i)を格納して、時点t10〜のフレーム番号6の消失に備える。同じく、(e)の相互相関バッファMCB2は、時点t10〜t14(M)の相互相関計算Mの式(16)のi=40〜120としたM(i)を格納して、時点t14のフレーム番号8の消失に備える。
【0084】
かくして、S(i)、M(i)のそれぞれ81個分の格納容量をもつ自己相関バッファSCB1と相互相関バッファMCB1のペア、および、S(i)、M(i)のそれぞれ81個分の格納容量をもつ自己相関バッファSCB2と相互相関バッファMCB2のペアとで重複せずに、常時、計算結果を格納して、フレーム消失の事態に備えている。
【0085】
図9(a)において、時点t10のフレーム6が消失したと仮定する。すると、フレーム消失検出部9はフレーム消失を検出して、フレーム消失信号15を出力する。これを受けたピッチ検出部7は、直前のデータ、すなわち、同図(d),(e)の自己相関バッファSCB2と相互相関バッファMCB2のペアから、t10における格納データである相関計算結果(S(i),M(i))を読み出して、式(8)の正規化相互相関 pitch(i)を計算し、そのピーク値を示すiを検出して、音声のピッチ周期を抽出する。
【0086】
補間処理部8では、消失したフレーム番号6の消失に備えていたピッチ・バッファPB1(図6(b))のデータをピッチ・バッファ出力21により読み出し、ピッチ検出部7で求めた音声のピッチ(周期)を用いて、補間データ26を作成し、出力する。ピッチ検出および消失したフレームの補間方法は、ITU−T勧告に従って実行される。
【0087】
図9を用いて、演算量(サイクル数)を説明する。たとえば、時点t7において入力された1sa(サンプル)のデータx(n)に対して式(12)によるS(0)の計算を2回(=2×1=2サイクル)、式(14)によるS(i)の計算を1回(=2サイクル)、式(16)によるi=40〜120とした81個のx(n−i)によるM(i)の計算を2回(=2×81=162サイクル)、平方根計算を1回(=10サイクル)の合計2+2+162+10=176サイクルとなる。
【0088】
以上の説明では、フレーム周期が10ms(80sa)として例示したが、フレーム周期が10msの整数倍である場合には、消失フレームに対して、10ms周期のフレームが連続して発生したとみなすことにより、同様に処理できる。フレーム周期が10ms以下の場合には、複数のフレームをまとめて10msフレームとみなすことにより、同様に処理できる。このとき、まとめられた複数のフレームのうちの1つが消失した場合には、その1まとめのフレーム全体を消失フレームとみなして同様に処理する。
【0089】
以上において説明した本発明では、常時、正規化相互相関計算を行うので、1つの入力されたデータに対して、176サイクルの演算量である。また、消失フレームの発生時の最初に行う正規化相互相関計算は42回の除算(1回の除算は10サイクル)の420サイクルである。すなわち、消失フレーム発生時には、最大でも176+420=596サイクルの演算量でよい。このように演算処理は平均化されて、CPU負荷が軽減されている。
【0090】
【発明の効果】
ITU−T勧告に従って消失フレームを処理する場合には、消失区間の最初の1サンプル(125μs)の間にピッチ検出をしなければならないので、正規化相互相関計算のために、4,964サイクルの演算量が必要となる。相関計算部などを構成するCPUの負荷は、その1サンプル(125μs)の間に集中してしまうために、極めて重いものとなっていた。
【0091】
以上の説明から明らかなように、本発明では、フレーム消失発生の有無に関わらず、常時、正規化相互相関計算を分散して実行してフレーム消失発生に備えているために、相関計算部などを構成するCPUの負荷は、極めて軽い。従来例においては、フレーム消失発生時直後において、1サンプル(125μs)の間に集中する演算量は、4,964サイクルであったのが、本発明によれば596サイクルとなり、性能の低い安価なCPUを用いても十分処理できるから、本発明の効果は極めて大きい。
【図面の簡単な説明】
【図1】本発明の実施の形態を示す回路構成図である。
【図2】図1に示した回路構成の動作を従来例と対比して説明するためのタイムチャートである。
【図3】図1に示した回路構成の動作原理を説明するためのタイムチャートである。
【図4】図1に示した回路構成の構成要素であるピッチ・バッファの動作を説明するためのタイムチャートである。
【図5】図1に示した回路構成の構成要素であるピッチ・バッファのさらに詳細な動作を説明するためのタイムチャートである。
【図6】図4に示したタイムチャートにおいて、フレーム消失が発生した場合の動作を説明するためのタイムチャートである。
【図7】図1に示した回路構成の構成要素であるピッチ・バッファ制御部の動作を説明するためのタイムチャートである。
【図8】図1に示した回路構成の構成要素である相関バッファに含まれた経過バッファの動作を説明するためのタイムチャートである。
【図9】図1に示した回路構成の構成要素である相関バッファに含まれた自己相関バッファおよび相互相関バッファの動作を説明するためのタイムチャートである。
【図10】従来例における補間処理動作を説明するためのタイムチャートである。
【符号の説明】
1 入力データ
2 出力データ
3 遅延データ
5 相関計算部
6 相関バッファ
7 ピッチ検出部
8 補間処理部
9 フレーム消失検出部
10 出力バッファ
11 ピッチ・バッファ制御部
12 相関バッファ制御部
15 フレーム消失信号
21 ピッチ・バッファ出力
22 相関入出力
23 自己相関バッファ出力
24 相互相関バッファ出力
25 ピッチデータ
26 補間データ
30 スイッチ
31 スイッチ信号
32 ピッチ入力データ
a,b 端子
DL 遅延器
F フレーム
i,k サンプル番号
M 相互相関計算
MCB1,2 相互相関バッファ
n サンプル番号
NFPBNo 次フレーム用ピッチ・バッファ番号
PAB1〜5 経過バッファ
PB1〜5 ピッチ・バッファ
PBC1〜5 ピッチ・バッファ・カウンタ
PFPBNo 現フレーム用ピッチ・バッファ番号
S 自己相関計算
sa サンプル
SCB1,2 自己相関バッファ
SD 自己相関差分計算
SW 切替スイッチ
t1〜24,31〜35 時点
ts 記憶開始時点
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a pitch detection method and apparatus for voice communication using packets. More specifically, the present invention relates to a voice pitch detection method and apparatus for compensating for packet loss when a frame is lost. Recommendation G. of the Telecommunication Standardization Sector of the International Telecommunication Union (ITU-T). 711 In the recommendation "packet loss compensation method" shown in APPENDIX I (hereinafter simply referred to as ITU-T recommendation), an improved method and apparatus for reducing the load on the CPU by averaging arithmetic processing is provided. Is what you do.
[Prior art]
[0002]
In the "packet loss compensation method" of the ITU-T recommendation, in voice communication, voice pitch detection is performed between the first frames of a frame lost section when a frame is lost. In this pitch detection, a normalized cross-correlation calculation is performed between the speech of 20 ms (160 samples) immediately before the lost frame and the speech in the past. This accounts for a large part of the calculation amount in the CPU.
[0003]
According to the ITU-T recommendation, at the beginning of a frame lost section, audio data immediately before the lost frame is copied (stored) in a pitch buffer having a length of 48.75 ms (390 samples). This stored (stored) voice data is used to calculate the pitch of the current voice (the period of the fundamental wave), and to extract and reproduce the voice waveform that is presumed to have existed during the period of the lost frame. Used to
[0004]
The pitch of the audio data ranges from 5 ms (40 samples) to 15 ms (120 samples), and includes the most recent (latest) 20 ms (160 samples) audio stored in the pitch buffer and the past audio. It is estimated by finding the peak of the normalized cross-correlation.
[0005]
The normalized cross-correlation pitch (i) can be obtained by dividing the cross-correlation M (i) by the square root of the autocorrelation S (i). Let x (n) be the audio data input immediately before the lost section, which is the period of the lost frame, and let i, k, and n be the sample numbers.
M (i) = Σx (nk) x (nik) (1)
S (i) = Σx (n−ik)2                        (2)
Here, Σ represents a cumulative sum from k = 0 to k. x (nk) represents audio data k samples before x (n), and x (nik) represents audio data i samples before x (nk).
[0006]
When the normalized cross-correlation pitch (i) is obtained using the equations (1) and (2),
pitch (i) = M (i) / {S (i)}1/2                    (3)
Becomes In the pitch detection, the value of i at which the value of the value of the parameter pitch (i) is maximum is detected in the range of i = 40 to 120 for 160 samples of k = 0 to 159.
[0007]
In Expression (3), in order to obtain one normalized cross-correlation pitch (i), the product-sum operation of Expression (1) is performed 160 times (k = 0 to 159), and the product-sum operation of Expression (2) is performed 160 times. Times (k = 0 to 159) and square root ({{1/2) Is performed once, and the division of the equation (3) needs to be performed once. Assuming that the product-sum operation of equations (1) and (2) requires 1 cycle, the square root of equation (2) requires 10 cycles, and the division of equation (3) requires 10 cycles, the normalization is performed once. The calculation for determining the cross-correlation pitch (i) requires 160 × 2 + 10 + 10 = 340 cycles, and this is calculated 81 times for i = 40 to 120, so that the calculation amount of 27,540 cycles is required.
[0008]
In other words, in order to obtain the normalized cross-correlation pitch (i) of the equation (3), a calculation amount of 27,540 cycles is required. It is possible to detect the value of i at which the normalized cross-correlation pitch (i) of Expression (3) has the maximum value for the first time by executing such an amount of calculation.
[0009]
In order to avoid the execution of such a large calculation amount, the ITU-T recommends a low calculation amount by the following method.
[0010]
Estimation of pitch is calculated in two stages. In the first stage, a rough search is performed on the audio data signal thinned out two-to-one to detect a peak value. In the second stage, a detailed search is performed near the peak value detected in the coarse search.
[0011]
In the coarse search of the first stage, in the autocorrelation calculation of Expression (2), when i = 120,
S (i) = Σx (ni−2k)2                        (4)
That is,
S (120) = Σx (n−120−2k)2
Here, in the first stage, as a result of thinning out to 2: 1, in Expression (4), Σ represents a sum from k = 0 to 79, and since it was thinned out to 2: 1, instead of k in Expression (2), 2k is used.
[0012]
The difference calculation is
S (i + 1) -S (i) = x (n-120-i)2  -X (ni)2  (5)
Is represented by
S (i) = S (i + 1) -x (n-120-i)2  + X (ni)2  (6)
Becomes In the equation (6), the calculation is performed only when i is an even number, i.e., 40 times, since i = 1119 to 40 is thinned out to 2: 1.
[0013]
Similar to the autocorrelation calculation, in the cross-correlation calculation of Expression (1), i = 120,
M (i) = Σx (n−2k) · x (ni−2k) (7)
Becomes Here, as a result of thinning out 2: 1 in the first stage, in Expression (7), Σ represents a cumulative sum from k = 0 to 79, and 2k is used instead of k in Expression (1). In the equation (7), the calculation is performed only when i is an even number out of i = 119 to 40, that is, 41 times.
[0014]
From the cross-correlation M (i) obtained from the equation (7) and the autocorrelation S (i) obtained from the equation (6), a rough normalized cross-correlation (when i out of i = 119 to 40 is an even number) Find pitch (i).
pitch (i) = M (i) / {S (i)}1/2                    (8)
[0015]
Therefore, the amount of computation required to search for the coarse normalized cross-correlation pitch (i) in equation (8) is 80 cycles for the autocorrelation calculation, 2 × 40 = 80 cycles for the difference calculation, and 80 × for the cross-correlation calculation. The first stage of 41 cycles, 10 × 41 cycles for square root calculation, and 10 × 41 cycles for division calculation requires a total of 4,260 cycles.
[0016]
In the second stage, the peak value i detected in the search for the coarse normalized cross-correlation pitch (i) of Expression (8) obtained by the calculation of 4,260 cycles in the first stage and the three values before and after (i-1) , I, i + 1) performs a search for a detailed normalized cross-correlation pitch (i) without thinning out samples.
[0017]
That is, in equation (3), k = 0 to 159, and
pitch (i + 1) = M (i + 1) / {S (i + 1)}1/2      (9)
pitch (i) = M (i) / {S (i)}1/2                  (10)
pitch (i-1) = M (i-1) / {S (i-1)}1/2      (11)
Becomes
[0018]
The operation amount of the second stage is 160 cycles for autocorrelation calculation, 2 × 2 = 4 cycles for difference calculation, 160 × 3 cycles for cross-correlation calculation, 10 × 3 cycles for square root calculation, and 10 × 3 cycles for division calculation. This is a total of 704 cycles in the second stage. The total of the first stage and the second stage is 4,964 cycles.
[0019]
Since the total of the first stage and the second stage is 4,964 cycles, the amount of calculation of 27,540 cycles required when the ITU-T recommendation is directly executed is reduced to about 20%. You. However, the amount of computation that occurs when the ITU-T recommendation for reducing the computation amount is executed is 4,964 cycles. If this is processed within a period of 125 μs (8 kHz), the processing amount (IPS: the number of instructions per second) in the CPU becomes 4964 / 0.000125 = 39.712 MIPS (M: mega), and It is a heavy load for.
[0020]
FIG. 10 is a time chart showing the operation of the interpolation processing in the conventional device. In the audio input data 1 shown in FIG. 9A, data of data samples 0 to 79 = 80 samples (sa) are included in one frame (t8 to t10). Here, 1sa is 125 μs. It is assumed that the frame at time points t10 to t12 has disappeared. FIG. 7C shows delay data 3 obtained by delaying the input data 1 of FIG. Here, (b) is omitted for convenience of explanation.
[0021]
The frame erasure signal 15 in (d) remains “L” until time t10, but becomes “H” when a frame is detected at time t10, and becomes “L” again when a frame is detected at time t12. ". According to the ITU-T recommendation, in order to smoothly connect the interpolation data and the input data 1 immediately before the disappearance, the delay data 3 (c) for 30 samples (sa) immediately before the disappearance and the interpolation data are forwardly (in the direction from t32 to t34). ) Is performed during time t32 to t34. Also, in order to smoothly connect the interpolation data and the input data immediately after the disappearance, the superimposed addition of the delay data 3 (c) for 30 sa immediately after the lost frame and the data obtained by extending the interpolation data backward is performed at times t35 to t36. Have gone between
[0022]
In the superimposition addition, when the data number 50 of t10 is added to the interpolation data in the delay data 3 (c) at the time points t10 to t33, the ratio of the delay data is increased and the ratio of the interpolation data is reduced, and thereafter, the time approaches t33. Accordingly, the ratio of the delay data is reduced and the ratio of the interpolation data is increased. During the period from time t32 to time t34 of the output data 2 (e) delayed by 1 sa, the ratio of the delay data is gradually reduced and the ratio of the interpolation data is gradually increased. After t34, only the interpolation data remains until t35.
[0023]
Further, in the case of adding the data number 0 at t37 to the interpolation data in the delay data 3 (c) from the time point t37 to t38, the ratio of the delay data is reduced and the ratio of the interpolation data is increased, and then the interpolation is performed as the time approaches t38. The ratio of data is reduced and the ratio of delayed data is increased. During the period from time t35 to time t36 of the output data 2 (e) delayed by 1 sa, the ratio of the interpolation data is gradually increased, and after t36, only the delayed data is included.
[0024]
The output data 2 in (e) is output with a delay of 1 sa from the delay data 3 in (c). When the disappearance of the frame is detected at the time point t10, the first-stage and second-stage arithmetic processes are performed within a period of 125 μs for 1 sa, and the interpolation data is output. The output data 2 is interpolated data that has been superimposed and added between time t32 and time t34 (30 samples: 3.75 ms) 125 μs later than time t10, and is interpolated data that has not been superimposed and added between time t34 and t35. The interpolation data is superimposed and added between t35 and t36.
[0025]
If the arithmetic processing of the first and second steps is not completed within 125 μs from time t10 to time t32 when the frame erasure signal (d) occurs, the sound data is interrupted due to the occurrence of the erasure frame. Since such a situation must be avoided, it imposes a heavy load on the CPU which must complete the arithmetic processing within this 125 μs.
[0026]
[Problems to be solved by the invention]
Even if the ITU-T recommendation for reducing the amount of computation is adopted in order to avoid the execution of a large computation amount of 27,540 cycles required when the ITU-T recommendation is executed as it is, the load on the CPU still remains. heavy. In addition, increasing the processing time in the CPU is not permissible because the interpolation processing of the lost frame is delayed, causing inconvenience in the audio signal, and has been a problem to be solved.
[0027]
Although it is technically possible to avoid the delay of the interpolation process by increasing the operation speed of the CPU and its peripheral circuit elements, it is a serious problem that it cannot be implemented because of a significant increase in cost. was there.
[0028]
[Means for Solving the Problems]
According to the present invention, in voice communication using packets, arithmetic processing is averaged in order to reduce a large load on the CPU that occurs when compensating for packet loss when a frame is lost.
[0029]
In preparation for the loss of a frame containing audio data, regardless of whether or not a frame has been lost, a normalized cross-correlation calculation is always performed from a series of normal frame sequences to detect the pitch of the audio, and a series of normal When the next frame input immediately after the frame sequence is a lost frame, interpolation data obtained based on the detected voice pitch is interpolated into the lost frame. In this interpolation operation, data for 30 samples just before the disappearance of a frame is superimposed and added.
[0030]
When the frame period is 10 ms (80 samples), 390/80 = 4.9 is assumed as storing (storing) 390 samples immediately before the frame disappearance. Therefore, five pitch buffers are prepared. ing.
[0031]
The operation of calculating the autocorrelation and the cross-correlation, detecting the pitch of audio data, and creating interpolation data is always performed regardless of whether or not frame loss occurs. Since the calculation is always executed in a distributed manner, even if the calculation speed is slow, it can sufficiently cope with it.
[0032]
When a frame loss occurs, the updating of the audio data in the pitch buffer is stopped, and the lost frame is interpolated by interpolation data obtained from the pitch of the latest audio data already detected. When the abnormal situation of frame loss occurs, the pitch and interpolation data necessary to interpolate the lost frame have already been created, so the processing amount at the time of frame loss is extremely small, There is no possibility that the interpolation process is delayed and the audio signal is not inconvenient.
[0033]
BEST MODE FOR CARRYING OUT THE INVENTION
1 and 2 are a circuit configuration diagram showing an embodiment of the present invention and a time chart for explaining the operation of the circuit configuration in comparison with a conventional example (FIG. 10). Here, the same symbols are used for the same elements as those in FIG. 10 showing the conventional example. 2 differs from FIG. 10 in that the functions of the switch 30 in FIG. 2B and the switch SW in FIG. 2F are added.
[0034]
That is, the switch 30 in (b) is on during the period from the time point t31 to t10 (for 30 sa: 3.75 ms), and is off at other times. The switch SW of (f) is connected to the terminal a during the period from time t32 to time t36, and is connected to the terminal b at other times. The correlation calculation has been completed by time t10.
[0035]
Voice data is applied as input data 1 (a). The input data 1 is delayed by 30 sa (between t31 and t10) by the delay unit DL, connected to the terminal b of the changeover switch SW, and delayed by 1 sa (sample: 125 μs for one sample) in the output buffer 10, and It is output as output data 2 as in the example. The input data 1 has a frame configuration and includes data for 80 samples obtained by sampling from an audio signal in one frame.
[0036]
If the frame is lost for any reason, the voice of the lost frame cannot be reproduced.Therefore, the data of the lost frame is correlated with the voice data before the loss, and the pitch of the voice is detected and estimated. The lost data is interpolated with the lost data. When a frame loss occurs in the input data 1, the frame loss detecting unit 9 detects this, outputs a frame loss signal 15 (t10), and switches the switch SW to the terminal a side with a delay of 1sa (t32). The interpolation data 26 for interpolating the lost frame is output as the output data 2 via the output buffer 10. The configurations of the frame erasure detector 9, the delay unit DL and the output buffer 10 are the same as those of the conventional example and are well known.
[0037]
When the interpolation processing is completed and the frame erasure detection unit 9 confirms the input of a normal frame at time t12, after the frame erasure signal 15 ends, 60 sa minutes (t12 to t38) elapse, and the changeover switch is switched in the next sample. SW is switched to the terminal b side (t36). While the frame erasure detection unit 9 confirms the input of a normal frame, the changeover switch SW is on the terminal b side, the output data 2 is output, and is simultaneously applied to the pitch buffers PB1 to PB5. Is temporarily stored (stored). The lost frame start time point t33 in the delay data 3 (c) is delayed by 30 sa by the delay unit DL.
[0038]
The switch 30 (b) is turned off for the last 30 sa of one frame of the input data 1 (a) (t31 to t10: 3.75 ms: data numbers 50 to 79), and the next switch which may disappear. 30sa immediately before the start of the frame is stored in the pitch buffer PB1. This 30 sa corresponds to time points t10 to t33 (data numbers 50 to 79) in the delay data 3 (c), and time points t32 to t34 (data numbers 50 to 79) in the pitch detection and output data 2 (e). Is used in the superposition addition of.
[0039]
The pitch buffer output 21 is sent to the interpolation processing unit 8 and the correlation calculation unit 5. The correlation buffer 6 includes five progress buffers PAB1 to PAB5, two autocorrelation buffers SCB1 and SCB2, and two cross correlation buffers MCB1 and MCB2. Between the correlation calculator 5 and the correlation buffer 6, data is being exchanged during the correlation calculation by the correlation input / output 22.
[0040]
The autocorrelation buffer output 23 of the autocorrelation buffers SCB1 and SCB2 and the crosscorrelation buffer output 24 of the crosscorrelation buffers MCB1 and MCB2 are sent to the pitch detection unit 7. Here, the pitch of the voice is detected, the pitch data 25 is sent to the interpolation processing unit 8, and the created interpolation data 26 is applied to the terminal a of the switch SW. When the frame detection unit 9 detects the disappearance of the frame, the changeover switch SW is switched to the terminal a by the frame disappearance signal 15, and the frame interpolated by the interpolation data 26 is output as the output data 2 via the output buffer 10. Is done.
[0041]
FIG. 3 shows a time chart for explaining the operation principle of the circuit configuration shown in FIG. One pitch buffer PB1 among the five pitch buffers PB1 to PB5 is described as a representative example.
[0042]
The frame (F) in FIG. 3A starts at time t0 and includes data of 80 samples (sa) from 0 to 79 by time t2. Similarly, t4, t6,... T10 follow. The pitch buffer PB1 in FIG. 3B starts temporary storage of data from the storage start time ts. The storage capacity of the pitch buffer PB1 is 390 sa (0 to 389). At time t10, the pitch buffer PB1 becomes full.
[0043]
280 sa of data is required for voice pitch calculation. Therefore, it is assumed that the operation of the correlation calculation unit 5 in FIG. The autocorrelation calculation is performed between time points t3 and t7 (for 160 sa). The autocorrelation difference calculation is performed between time points t7 and t9 (for 80 sa). The operation of the correlation calculation unit 5 is performed between time points t6 and t10 (for 160 sa).
[0044]
In the figure, if the frame after the time point t10 disappears, the pitch detection unit 7 and the interpolation processing unit 8 detect the pitch for 1 sa (125 μs) from the time point t10 and obtain the interpolation data 26. ing. The pitch buffers PB1 to PB5, the correlation calculation unit 5 having the CPU configuration, and the correlation buffer 6 are under the control of the pitch buffer control unit 11 and the correlation buffer control unit 12. Assuming that a frame to be present at time points t10 to t12 has disappeared, the interpolation data 26 obtained during 1 sa (125 μs) from time point t10 is output in order to interpolate the lost frame.
[0045]
The correlation calculation and pitch detection performed in FIG. 3 will be described in detail. In the pitch buffer PB1 shown in FIG. 3B, in order to estimate the pitch of the voice and extract and estimate the voice waveform of the lost frame section (t10 to t12), the pitch buffer PB1 of ts to t10 before the disappearance time t10 is used. 390sa (0 to 389 samples) are stored. In order to distribute the arithmetic processing, the auto-correlation calculation (t3 to t7) and the cross-correlation calculation (t6 to t10) are sequentially performed when data is input and calculation becomes possible.
[0046]
The autocorrelation S (0) from the time point t3 when the pitch buffer PB1 stores (stores) 110 sa to the time point t7 when the pitch buffer PB1 stores 160 sa is obtained. Assuming that input data of sample number n is x (n), when n = 110 to 269 (in FIG. 3B, sample numbers 0, 110, 230, 270, 349, and 389 are displayed).
S (0) = S (0) + x (n)2                            (12)
Is calculated.
[0047]
When the sample number n = 269, the autocorrelation S (0) is obtained.
Next, an autocorrelation S (1) of 160 sa starting with n = 111 is obtained. This is because when n = 270 using S (0),
S (1) = S (0) -x (n-160)2+ X (n)2          (13)
Is required.
[0048]
Thereafter, 80 (= 349-269) autocorrelations S (i) can be obtained between t7 and t9 using 160sa from n = 190 to n = 349 at the beginning of n = 190. The autocorrelation S (i) is obtained when n = 270-349.
Assuming that i = n-269,
S (i) = S (i-1) -x (n-160)2+ X (n)2      (14)
[0049]
The cross-correlation M (i) is obtained by sequentially multiplying 160 sa (t 6 to t 10) immediately before the frame disappears, that is, 160 sa with n = 230 at the top and data before i samples (sa). Add and find. That is, for the data of n = 230 to 389 from t6 to t10, for example, when i = 120, n = 110 to 269 (nik shown in FIG. The data of t3 to t7) are multiplied and added.
[0050]
With respect to the data of n = 230 to 389 (t6 to t10) indicated by the one-dot chain line in nk of FIG. 9D, for example, when i = 40, ni of FIG. −k is multiplied by data of n = 190 to 349 (t5 to t9) indicated by a dashed-dotted line frame and added.
[0051]
When n = 389, for i = 40 to 120, the cross-correlation M (i) is
M (i) = Σx (nk) × x (nik) (15)
It can be expressed as. Here, Σ represents a cumulative sum when k = 0 to 159.
[0052]
When n = 230-389, the cross-correlation M (i) is, for i = 40-120, respectively:
M (i) = M (i−1) + x (n) · x (ni) (16)
Is calculated, when n = 389 (t10), all 81 cross correlations M (i) are obtained.
[0053]
The number of product-sum operations at the time of data input according to equations (12), (14), and (16) is as follows. In the autocorrelation calculation of equation (12), x (n) is added to S (0).2  Is calculated once (= 1 cycle). In the autocorrelation difference calculation of Expression (14), x (n-160) is obtained from S (i-1).2  Subtraction and x (n)2  Is executed twice (= 2 cycles). In the cross-correlation calculation of equation (16), x (n) · x (ni) is added to M (i−1) for 81 i (= 40 to 120), so calculation is performed 81 times (= 81 cycles). I do.
[0054]
Since a part of the autocorrelation calculation (t6 to t7) and the autocorrelation difference calculation (t7 to t9) are performed simultaneously in parallel between the time points t6 and t10 in the cross-correlation calculation of FIG. Performs 83 times (= 83 cycles) product-sum calculation. Further, {S (i)} in equation (8)1/2  Since it takes 10 cycles to calculate the square root of the result of the equation (14) to obtain, the amount of calculation is 83 + 10 = 93 cycles.
[0055]
When the frame erasure occurs at time t10, the square root {S (i)} of the cross-correlation M (i) and the auto-correlation already determined.1/2  Then, the lost frame is interpolated by calculating the normalized cross-correlation pitch (i) of Expression (8). At time t10 when frame erasure occurs, the required calculation performs a coarse search with a signal thinned out two-to-one to reduce the amount of computation.
[0056]
Thereafter, if a detailed search is performed in the vicinity of the peak obtained by the coarse search, only 41 + 2 = 43 divisions are required, and each division requires 10 cycles. Therefore, 43 × 10 cycles = This is 430 cycles. This is 10% or less of 4,964 cycles when the proposal for reducing the amount of operation of the ITU-T recommendation is executed as it is, so that the load on the CPU including the correlation calculation unit 5 and the like is extremely small.
[0057]
In the above description, the pitch buffer PB1 has been described as a representative example. However, at the time t10 when the cross-correlation calculation ends, a lost frame is not always generated just conveniently. For this purpose, five pitch buffers PB are prepared, and even when a lost frame occurs, any one of the pitch buffers PB is in the state shown in FIG. 3 so that it can be dealt with immediately.
[0058]
FIG. 4 is a time chart for explaining the operation of the pitch buffer, which is a component of the circuit configuration shown in FIG. 1, with respect to a frame. FIG. 7A shows frames from time t0 to time t18. FIGS. 8B to 8F show the operations of the pitch buffers PB1 to PB5, respectively. Here, S indicates autocorrelation calculation, SD indicates autocorrelation difference calculation, and M indicates cross-correlation calculation.
[0059]
Regardless of the presence or absence of frame erasure, it is necessary to always perform autocorrelation calculation and cross-correlation calculation for each frame in which the input audio data 80sa (sample) is one frame. For pitch detection and interpolation, a pitch buffer PB storing 390 sa (samples) of data is required for each frame.
[0060]
The five pitch buffers PB1 to PB5 can cope with each frame by shifting the time. One pitch buffer PB can only respond to the loss of one frame. Therefore, for example, when the frame period is 10 ms (80 samples), 390/80 = 4.9 is assumed as storing 390 samples immediately before erasure of the frame. Therefore, five pitch buffers PB1 to PB5 are prepared.
[0061]
In the pitch buffers PB1 to PB5, sequentially input audio data for each frame are sequentially stored from the pitch buffer PB1. That is, five frames of voice data are stored by shifting one frame at a time by the five pitch buffers PB1 to PB5. After the lapse of five frame periods, the oldest audio data is stored. For example, the storage content of the pitch buffer PB1 is updated from time t10 to 10sa (sample) to store the latest audio data. become. Looking at one pitch buffer PB, the stored audio data is updated every five frame periods.
[0062]
An autocorrelation calculation S, an autocorrelation difference calculation SD, and a cross-correlation calculation M are performed from the samples (audio data) stored in the pitch buffers PB1 to PB5 to detect the pitch of the audio data and create interpolation data. Is always running. For example, when a frame disappears at time t10, the interpolation data calculated from the data in the pitch buffer PB1 is used. Similarly, when a frame disappears at times t12, 14, 16, and 18, interpolation data based on the data of the pitch buffers PB2, 3, 4, and 5 is used, respectively.
[0063]
A correlation buffer 6 and a correlation calculator 5 are provided for obtaining the autocorrelation and the cross-correlation, and are controlled by a correlation buffer controller 12. The calculations in the correlation calculation unit 5 having the CPU configuration are always executed in a distributed manner, so that even if the calculation speed is slow, it can sufficiently cope with them.
[0064]
When a frame loss occurs, the update of the audio data in the pitch buffer is stopped, and the lost frame is interpolated with the latest detected voice data pitch. When the abnormal situation of frame loss occurs, the interpolation data necessary to interpolate the lost frame has already been created, so the amount of calculation when the frame loss occurs is extremely small, and the interpolation processing of the lost frame is performed. Is not delayed, thereby causing no inconvenience in the audio signal.
[0065]
FIG. 5 shows a time chart for explaining how data in pitch buffers PB1 to PB5 are allocated to frames. FIG. 7A shows frame numbers from time t0 to time t24. FIGS. 8B to 8F show the frame-corresponding operations of the pitch buffers PB1 to PB5, respectively. For example, the data at t0 to t10 of the pitch buffer PB1 in (b) is used when a frame loss occurs in the frame 6 (t10). Similarly, data of t2 to t12 of the pitch buffer PB2 is used when a frame disappears in the frame 7 (t12 to). Hereinafter, the same applies to the pitch buffers PB3 to PB5.
[0066]
FIG. 6 is a time chart for explaining the manner in which data in the subsequent pitch buffers PB1 to PB5 are allocated to frames when a frame loss occurs in frame 6 at times t10 to t12 in FIG. I have. The data at t0 to t10 in the pitch buffer PB1 in (b) is not updated at t10 in the pitch buffer PB1 in (b) when a frame loss occurs in the frame 6 (t10). The update is performed after the interpolation operation for interpolating the lost frame is completed at t12.
[0067]
Instead, the data in preparation for the loss of the frame 11 whose accumulation has to be started from the time t10 is accumulated in the pitch buffer PB2 of (c) after the time t10. Therefore, the data from t12 to t22 of the pitch buffer PB1 is used for the case where the frame 12 (t22 to) has disappeared.
[0068]
When the frame 7 also disappears following the disappearance of the frame 6, interpolation is performed with the data (t0 to t12) prepared for the disappearance of the frame 6 in the pitch buffer PB1 in (b). Therefore, the data of the pitch buffer PB2 (c) accumulated until t10 in preparation for the loss of the frame 7 becomes unnecessary, so that the data is stored in the PB2 in case the frame 11 is lost at t10 to t20. You.
[0069]
FIG. 7 shows a time chart of the operation of the pitch buffer counters PBC1 to PBC5 composed of five registers included in the pitch buffer control unit 11. The five pitch buffer counters PBC1-5 control the allocation of frames to the five pitch buffers PB1-5. Each pitch buffer counter PBC is a counter of 390 (0 to 389).
[0070]
Each of the pitch buffer counters PBC1 to PBC5 in (b), (c), (d), (e), and (f) controls the allocation of frames to the pitch buffers PB1 to PB5. . The pitch buffer number PFPBNo for the current frame in (g) indicates that, for example, the number of the pitch buffer PB assigned to the frame at the time point t0 is 1 (PB1). The next frame pitch buffer number NFPBNo in (h) indicates that, for example, the number of the pitch buffer PB allocated next to the frame at the time point t0 is 2 (PB2). The same applies to the following.
[0071]
The procedure of the frame allocation in FIG. 7 will be specifically described. For example, when the pitch buffer counter PBC1 indicates 309 (= 389-80) at time t8, the number 1 of the pitch buffer PB1 is recorded as 1 of the pitch buffer number NFPBNo for the next frame of (h). I do. When the pitch buffer counter PBC1 indicates 389 at time t10, the pitch buffer PB1 number 1 is recorded as the current frame pitch buffer number NFPBNo of (g).
[0072]
If the current frame is a normal frame, data in the pitch buffer PB for the current frame becomes unnecessary, and is allocated to a new frame five frames later. If the current frame is a lost frame, the lost data is interpolated by interpolation data already prepared as data in the pitch buffer PB for the current frame, and is used while the lost frames are continuous. At that time, the pitch buffer for the next frame becomes unnecessary, and is allocated to a new frame.
[0073]
The correlation calculation unit 5 performs a correlation calculation for each pitch buffer PB according to the count value of the pitch buffer counter PBC. For example, when the count value of the pitch buffer counter PBC1 is 110 to 269 (see FIG. 3), the autocorrelation calculation is performed, and when the count value is 269, the square root of the autocorrelation result is obtained.
[0074]
Further, when the count value is 270 to 349, autocorrelation difference calculation is performed, and the square root of the difference calculation result is obtained. When the count value is 230 to 389, a cross-correlation calculation is performed. The calculation result is stored in the cross-correlation buffers MCB1 and MCB2 included in the correlation buffer 6 and indicated by the correlation buffer control unit 12.
[0075]
The correlation buffer 6 includes five progress buffers PAB1 to PAB5 for storing the progress of the autocorrelation calculation for each pitch buffer PB and an autocorrelation buffer SCB1 for storing 81 autocorrelation calculation results for two frames per frame. , 2 and cross-correlation buffers MCB1 and MCB2 which store 81 cross-correlation calculation results per frame for two frames.
[0076]
The correlation buffer control unit 12 controls the correlation buffer 6 that stores a correlation calculation result. The elapsed buffers PAB1 to PAB5 are assigned corresponding to the pitch buffers PB1 to PB5, respectively. The autocorrelation buffers SCB1 and SCB2 can store one frame at a time, and are assigned alternately for each frame. Similarly, since the cross-correlation buffers MCB1 and MCB2 can store one frame each, they are allocated alternately for each frame.
[0077]
FIG. 8 is a time chart for explaining the operation of the progress buffers PAB1 to PAB5 included in the correlation buffer 6. FIG. 6A shows the frame numbers at time points t0 to t24. Each of the elapse buffers PAB1 to PAB5 in FIGS. 8B, 8C, 8D, 8E, and 8F corresponds to one of the pitch buffers PB1 to PB5.
[0078]
For example, the elapsed buffer PAB2 in FIG. 9C is allocated to one pitch buffer PB1 between the autocorrelation calculation S and the autocorrelation difference calculation SD from t3 to t9 (t3 to t9 in FIG. 4). Of the frame (t10). Similarly, the elapsed buffer PAB3 of FIG. 7D is allocated to one pitch buffer PB2 between the autocorrelation calculation S and the autocorrelation difference calculation SD from t5 to t11 (t5 to t11 in FIG. 4). This indicates that the second frame (t12-) is prepared. Hereinafter, the same applies.
[0079]
FIG. 9 is a time chart for explaining the operation of the autocorrelation buffers SCB1 and SCB2 and the cross-correlation buffers MCB1 and MCB2 included in the correlation buffer 6 in correspondence with FIG. FIG. 6A shows the frame numbers at time points t0 to t24. The operation of the auto-correlation buffers SCB1, SCB2 and the cross-correlation buffers MCB1, MCB1 and MCB2 of (b), (c), (d) and (e) of FIG.
[0080]
The autocorrelation buffer SCB1 shown in FIG. 11B is obtained by calculating S (0) of the equation (12) obtained between the time points t1 and t5 (S) and the equation (14) obtained between the time points t5 and t7 (SD). ) In which i = 1 to 80 and S (i) may be stored until the time point t8 when the cross-correlation calculation M ends. Similarly, the autocorrelation buffer SCB1 in (b) is obtained by calculating S (0) in the equation (12) obtained between the time points t5 and t9 (S) and using the equation (14) obtained between the time points t9 and t11 (SD). ) In which i = 1 to 80 and S (i) may be stored until the time point t12 when the cross-correlation calculation M ends.
[0081]
The cross-correlation buffer MCB1 of (c) stores M (i) where i = 40 to 120 in the equation (16) of the cross-correlation calculation M from time t4 to t8 (M), and stores the frame number from time t8. Prepare for the disappearance of 5. Similarly, the cross-correlation buffer MCB1 in (c) stores M (i) where i = 40 to 120 in Equation (16) of the cross-correlation calculation M from time t8 to t12 (M), and Prepare for loss of frame number 7.
[0082]
The autocorrelation buffer SCB2 in FIG. 11D is obtained by calculating S (0) of the equation (12) obtained between the time points t3 and t7 (S) and the equation (14) obtained between the time points t7 and t9 (SD). ) In which i = 1 to 80 and S (i) may be stored until the time t10 when the cross-correlation calculation M ends. Similarly, the autocorrelation buffer SCB2 of (d) is obtained by calculating S (0) of the equation (12) obtained between the time points t7 and t11 (S) and the equation (14) obtained between the time points t11 and t13 (SD). ) In which i = 1 to 80 and S (i) may be stored until the time point t14 when the cross-correlation calculation M ends.
[0083]
The cross-correlation buffer MCB2 of (e) stores M (i) where i = 40 to 120 in the equation (16) of the cross-correlation calculation M at time t6 to t10 (M), and stores the frame number at time t10. Prepare for the disappearance of 6. Similarly, the cross-correlation buffer MCB2 of (e) stores M (i) where i = 40 to 120 in Expression (16) of the cross-correlation calculation M at time t10 to t14 (M), and stores the frame at time t14. Prepare for the disappearance of number 8.
[0084]
Thus, a pair of the auto-correlation buffer SCB1 and the cross-correlation buffer MCB1 each having a storage capacity of 81 S (i) and M (i), and 81 pairs of S (i) and M (i), respectively. The calculation result is always stored without overlapping the autocorrelation buffer SCB2 having a storage capacity and the pair of the cross-correlation buffer MCB2 to prepare for a frame loss situation.
[0085]
In FIG. 9A, it is assumed that frame 6 at time t10 has disappeared. Then, the frame erasure detecting section 9 detects the frame erasure and outputs the frame erasure signal 15. Receiving this, the pitch detection unit 7 calculates the correlation calculation result (S) as the storage data at t10 from the immediately preceding data, that is, the pair of the auto-correlation buffer SCB2 and the cross-correlation buffer MCB2 in FIGS. (I), M (i)) is read out, the normalized cross-correlation pitch (i) of equation (8) is calculated, i indicating the peak value is detected, and the pitch period of the voice is extracted.
[0086]
The interpolation processing unit 8 reads out the data of the pitch buffer PB1 (FIG. 6B) prepared for the disappearance of the lost frame number 6 by using the pitch buffer output 21, and reads the voice pitch ( The interpolation data 26 is created using the (cycle) and output. The method of pitch detection and interpolation of lost frames is performed according to ITU-T recommendations.
[0087]
The operation amount (the number of cycles) will be described with reference to FIG. For example, the calculation of S (0) by the equation (12) is performed twice (= 2 × 1 = 2 cycles) for the data x (n) of 1sa (sample) input at the time point t7 according to the equation (14). The calculation of S (i) is performed once (= 2 cycles), and the calculation of M (i) is performed twice (= 2 × 2) using 81 x (ni) with i = 40 to 120 according to equation (16). 81 = 162 cycles), and one square root calculation (= 10 cycles) gives a total of 2 + 2 + 162 + 10 = 176 cycles.
[0088]
In the above description, the frame period is exemplified as 10 ms (80 sa). However, when the frame period is an integral multiple of 10 ms, it is considered that a frame having a period of 10 ms is continuously generated with respect to the lost frame. Can be processed similarly. When the frame period is 10 ms or less, the same processing can be performed by regarding a plurality of frames collectively as a 10 ms frame. At this time, if one of the combined frames is lost, the entirety of the combined frame is regarded as a lost frame and the same processing is performed.
[0089]
In the present invention described above, since the normalized cross-correlation calculation is always performed, the operation amount is 176 cycles for one input data. In addition, the first normalized cross-correlation calculation performed when an erased frame occurs is 420 cycles of 42 divisions (one division is 10 cycles). That is, at the time of occurrence of a lost frame, the calculation amount may be 176 + 420 = 596 cycles at the maximum. In this way, the arithmetic processing is averaged, and the CPU load is reduced.
[0090]
【The invention's effect】
When processing a lost frame according to the ITU-T recommendation, pitch detection must be performed during the first sample (125 μs) of the lost section, so that 4,964 cycles of normalized cross-correlation calculations are required. The amount of calculation is required. The load on the CPU constituting the correlation calculation unit and the like is extremely heavy because it is concentrated during one sample (125 μs).
[0091]
As is apparent from the above description, in the present invention, regardless of the presence or absence of occurrence of frame loss, the normalization cross-correlation calculation is always executed in a distributed manner to prepare for the occurrence of frame loss. Is very light. In the conventional example, immediately after the occurrence of a frame erasure, the amount of computation concentrated in one sample (125 μs) was 4,964 cycles. Since the processing can be sufficiently performed even by using a CPU, the effect of the present invention is extremely large.
[Brief description of the drawings]
FIG. 1 is a circuit configuration diagram showing an embodiment of the present invention.
FIG. 2 is a time chart for explaining the operation of the circuit configuration shown in FIG. 1 in comparison with a conventional example.
FIG. 3 is a time chart for explaining the operation principle of the circuit configuration shown in FIG. 1;
4 is a time chart for explaining an operation of a pitch buffer which is a component of the circuit configuration shown in FIG. 1;
FIG. 5 is a time chart for explaining a more detailed operation of a pitch buffer which is a component of the circuit configuration shown in FIG. 1;
FIG. 6 is a time chart for explaining an operation when a frame loss occurs in the time chart shown in FIG. 4;
FIG. 7 is a time chart for explaining an operation of a pitch buffer control unit which is a component of the circuit configuration shown in FIG. 1;
FIG. 8 is a time chart for explaining an operation of a progress buffer included in a correlation buffer which is a component of the circuit configuration shown in FIG. 1;
FIG. 9 is a time chart for explaining operations of an autocorrelation buffer and a cross-correlation buffer included in a correlation buffer, which are components of the circuit configuration shown in FIG.
FIG. 10 is a time chart for explaining an interpolation processing operation in a conventional example.
[Explanation of symbols]
1 Input data
2 Output data
3 Delayed data
5 Correlation calculator
6 Correlation buffer
7 Pitch detection unit
8 Interpolation processing unit
9 Frame loss detector
10 Output buffer
11 Pitch buffer controller
12 Correlation buffer control unit
15 frame lost signal
21 Pitch buffer output
22 Correlation input / output
23 Autocorrelation buffer output
24 Cross-correlation buffer output
25 Pitch data
26 Interpolation data
30 switches
31 Switch signal
32 pitch input data
a, b terminals
DL delay unit
F frame
i, k sample number
M Cross-correlation calculation
MCB1,2 Cross-correlation buffer
n sample number
NFPBNo Pitch buffer number for next frame
PAB1-5 Elapse buffer
PB1-5 Pitch buffer
PBC1-5 Pitch buffer counter
PFPBNo Pitch buffer number for current frame
S Autocorrelation calculation
sa sample
SCB1,2 Autocorrelation buffer
SD Autocorrelation difference calculation
SW changeover switch
t1-24, 31-35
ts memory start time

Claims (5)

音声データを含むフレームが消失する消失フレームの発生に備えて、常時、一連の正常なフレーム列から正規化相互相関計算をして音声のピッチを検出することにより、検出された音声のピッチを得て、前記一連の正常なフレーム列の直後に入力される次フレームが前記消失フレームであった場合に、前記消失フレームに、前記検出された音声のピッチに基づいて得た補間データを補間するようにした、
パケット損失補償におけるピッチ検出方法。
In preparation for the occurrence of a lost frame in which a frame including voice data is lost, a normalized cross-correlation calculation is always performed from a series of normal frame sequences to detect the voice pitch, thereby obtaining the detected voice pitch. When the next frame input immediately after the series of normal frame strings is the lost frame, interpolation data obtained based on the detected voice pitch is interpolated to the lost frame. ,
Pitch detection method in packet loss compensation.
前記正規化相互相関計算をして音声のピッチを検出する場合に、前記フレームの1個である1フレームが80サンプルの音声データを含んでおり、前記消失フレームの直前の2フレームの音声データと、それより以前のフレーム列の音声データとの間で正規化相互相関計算をするようにした、
請求項1のパケット損失補償におけるピッチ検出方法。
When detecting the pitch of the voice by performing the normalized cross-correlation calculation, one frame as one of the frames includes voice data of 80 samples, and two frames of voice data immediately before the lost frame are included. , To calculate the normalized cross-correlation with the audio data of the previous frame sequence,
A pitch detection method in packet loss compensation according to claim 1.
音声データを含むフレームが消失する消失フレームの発生に備えて、常時、一連の正常なフレーム列から正規化相互相関計算をするための正規化相互相関計算手段(5,6,9,11,12,30,PB1〜5)と、
前記正規化相互相関計算の結果から音声のピッチを検出することにより、検出された音声のピッチを得るためのピッチ検出手段(7)と、
前記一連の正常なフレーム列の直後に入力される次フレームが前記消失フレームであった場合に、前記消失フレームに、前記検出された音声のピッチに基づいて得た補間データを補間し出力するための補間処理手段(8,DL,SW)とを含む、
パケット損失補償におけるピッチ検出装置。
In preparation for the occurrence of a lost frame in which a frame including audio data is lost, a normalized cross-correlation calculating means (5, 6, 9, 11, 12, 12) for constantly calculating a normalized cross-correlation from a series of normal frame sequences. , 30, PB1-5);
Pitch detection means (7) for detecting the pitch of the voice from the result of the normalized cross-correlation calculation to obtain the pitch of the detected voice;
To interpolate and output interpolation data obtained based on the detected voice pitch to the lost frame when the next frame input immediately after the series of normal frame sequences is the lost frame. Interpolation processing means (8, DL, SW)
Pitch detection device in packet loss compensation.
前記正規化相互相関計算手段(5,6,9,11,12,30,PB1〜5)が、
前記フレームの1個である1フレームが80サンプルの音声データを含んでいる場合に、それぞれ1フレームづつずらしながらそれぞれが390サンプル分の音声データを格納するための5個のピッチ・バッファ手段(PB1〜5)と、
前記正規化相互相関計算をして音声のピッチを検出する場合に、前記消失フレームの直前の2フレームの音声データと、それより以前のフレーム列の音声データとの間で自己相関および相互相関計算をするための相関計算手段(5)と、
前記自己相関および相互相関計算をする計算経過において発生する計算データを格納するための5個の経過バッファ(PAB1〜5)と、前記計算経過において発生する前記自己相関計算の結果を格納するための2個の自己相関バッファ(SCB1,2)と、前記計算経過において発生する前記相互相関計算の結果を格納する2個の相互相関バッファ(MCB1,2)とを含む、相関バッファ手段(6)と、を含む、
請求項3のパケット損失補償におけるピッチ検出装置。
The normalized cross-correlation calculation means (5, 6, 9, 11, 12, 30, PB1-5)
When one frame, which is one of the frames, contains audio data of 80 samples, five pitch buffer means (PB1) for storing audio data of 390 samples while shifting one frame at a time. ~ 5),
When detecting the pitch of the voice by performing the normalized cross-correlation calculation, the auto-correlation and the cross-correlation calculation are performed between the voice data of the two frames immediately before the lost frame and the voice data of the previous frame sequence. Correlation calculation means (5) for performing
Five progress buffers (PAB1 to 5) for storing calculation data generated in a calculation process for performing the autocorrelation and cross-correlation calculations, and for storing a result of the autocorrelation calculation generated in the calculation process. A correlation buffer means (6) including two autocorrelation buffers (SCB1, 2) and two crosscorrelation buffers (MCB1, 2) for storing the result of the cross-correlation calculation occurring in the calculation process; ,including,
A pitch detecting device according to claim 3, wherein the pitch detecting device is used for packet loss compensation.
前記正規化相互相関計算手段(5,6,9,11,12,30,PB1〜5)が、
前記5個のピッチ・バッファ手段(PB1〜5)にそれぞれ格納されたデータのサンプル数をカウントする5個のピッチ・バッファ・カウンタ(PBC1〜5)と、前記ピッチ・バッファ・カウンタ(PBC1〜5)のカウント値が所定の値になったときにそのピッチ・バッファ手段を特定するために割当てられたピッチ・バッファ番号を、現フレームあるいは次フレームに割当てるピッチ・バッファ番号(PFPBNo,NFPBNo)として記録するレジスタで構成され、前記現フレームの消失時には前記現フレームに割当て、前記ピッチ・バッファ手段のうちの更新されるべき1個の代わりに、次フレームに割当てられた他の1個のピッチ・バッファの番号を更新するように制御するためのピッチ・バッファ制御手段(11,30)と、
前記5個のピッチ・バッファ・カウンタ(PBC1〜5)のカウント値に応じて、前記相互相関計算の結果から判断して、前記自己相関計算の途中であれば前記5個のピッチ・バッファ手段(PB1〜5)にそれぞれ対応した前記5個の経過バッファ(PAB1〜5)を選択し、前記自己相関差分計算の途中であれば、割当てられたフレームに対応した前記2個の自己相関バッファ(SCB1,2)のうちの1個を選択し、前記相互相関計算の途中であれば割当てられたフレームに対応した前記2個の相互相関バッファ(MCB1,2)のうちの1個を選択するように制御する相関バッファ制御手段(12)とを含んだ、
請求項4のパケット損失補償におけるピッチ検出装置。
The normalized cross-correlation calculation means (5, 6, 9, 11, 12, 30, PB1-5)
Five pitch buffer counters (PBC1-5) for counting the number of data samples respectively stored in the five pitch buffer means (PB1-5), and the pitch buffer counters (PBC1-5) ) Is recorded as a pitch buffer number (PFPBNo, NFPBNo) to be assigned to the current frame or the next frame when the count value of ()) reaches a predetermined value. Another pitch buffer assigned to the next frame instead of one of the pitch buffer means to be updated when the current frame is lost. Pitch buffer control means (11, 30) for controlling so as to update the number of
Judgment is made from the result of the cross-correlation calculation according to the count values of the five pitch buffer counters (PBC1 to PBC5). PB1 to PB5) are selected, and during the calculation of the autocorrelation difference, the two autocorrelation buffers (SCB1) corresponding to the assigned frame are selected. , 2), and during the cross-correlation calculation, one of the two cross-correlation buffers (MCB1, 2) corresponding to the assigned frame is selected. Controlling correlation buffer control means (12).
A pitch detecting apparatus for packet loss compensation according to claim 4.
JP2003025727A 2003-02-03 2003-02-03 Method and system for detecting pitch in packet loss compensation Pending JP2004239930A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003025727A JP2004239930A (en) 2003-02-03 2003-02-03 Method and system for detecting pitch in packet loss compensation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003025727A JP2004239930A (en) 2003-02-03 2003-02-03 Method and system for detecting pitch in packet loss compensation

Publications (1)

Publication Number Publication Date
JP2004239930A true JP2004239930A (en) 2004-08-26

Family

ID=32953938

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003025727A Pending JP2004239930A (en) 2003-02-03 2003-02-03 Method and system for detecting pitch in packet loss compensation

Country Status (1)

Country Link
JP (1) JP2004239930A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007193294A (en) * 2005-12-20 2007-08-02 Nippon Telegr & Teleph Corp <Ntt> Prediction delay search method, device using the same, program and recording medium
JP2010539550A (en) * 2007-09-21 2010-12-16 フランス・テレコム Transmission error spoofing of digital signals by complexity distribution
JP2013519920A (en) * 2010-02-11 2013-05-30 クゥアルコム・インコーポレイテッド Concealment of lost packets in subband coded decoder
WO2019000178A1 (en) * 2017-06-26 2019-01-03 华为技术有限公司 Frame loss compensation method and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007193294A (en) * 2005-12-20 2007-08-02 Nippon Telegr & Teleph Corp <Ntt> Prediction delay search method, device using the same, program and recording medium
JP4738260B2 (en) * 2005-12-20 2011-08-03 日本電信電話株式会社 Prediction delay search method, apparatus using the method, program, and recording medium
JP2010539550A (en) * 2007-09-21 2010-12-16 フランス・テレコム Transmission error spoofing of digital signals by complexity distribution
JP2013250582A (en) * 2007-09-21 2013-12-12 Orange Transfer error camouflage for digital signal by complexity dispersal
JP2013519920A (en) * 2010-02-11 2013-05-30 クゥアルコム・インコーポレイテッド Concealment of lost packets in subband coded decoder
WO2019000178A1 (en) * 2017-06-26 2019-01-03 华为技术有限公司 Frame loss compensation method and device
CN109496333A (en) * 2017-06-26 2019-03-19 华为技术有限公司 A kind of frame losing compensation method and equipment

Similar Documents

Publication Publication Date Title
US8233636B2 (en) Method, apparatus, and computer program for suppressing noise
JP6511897B2 (en) Noise reduction device, noise reduction method and program
CN110827852B (en) Method, device and equipment for detecting effective voice signal
CN113870885A (en) Bluetooth audio squeal detection and suppression method, device, medium, and apparatus
KR19980014906A (en) Accumulator
JP2004239930A (en) Method and system for detecting pitch in packet loss compensation
JP4818955B2 (en) Noise removal device
JP2007163318A (en) Apparatus for processing radar signal and method for detecting its constant false alarm probability
US20100305944A1 (en) Pitch Or Periodicity Estimation
CN106170113B (en) Method and device for eliminating noise and electronic equipment
CN112398912B (en) Voice signal acceleration method and device, computer equipment and storage medium
JP2004004274A (en) Voice signal processing switching equipment
CN110265048B (en) Echo cancellation method, device, equipment and storage medium
CN112067927A (en) Medium-high frequency oscillation detection method and device
CN108848435B (en) Audio signal processing method and related device
JP5091290B2 (en) Click sound removal in audio data stream
JP3986457B2 (en) Input signal estimation method and apparatus, input signal estimation program, and recording medium therefor
US5388221A (en) Adaptive digital audio interpolation system
US20220139416A1 (en) Digital audio processing device, digital audio processing method, and digital audio processing program
JP2019161626A (en) Failure diagnosis apparatus and method
JPS6225298B2 (en)
JPS5876891A (en) Voice pitch extraction
JP5179297B2 (en) RMS measurement device
JP2009505265A (en) Method and apparatus for suppressing noise in a digital signal sequence, corresponding computer program, and corresponding computer-readable storage medium
JP2772598B2 (en) Audio coding device