JP3880807B2 - Digital filter and processing method thereof - Google Patents

Digital filter and processing method thereof Download PDF

Info

Publication number
JP3880807B2
JP3880807B2 JP2001124747A JP2001124747A JP3880807B2 JP 3880807 B2 JP3880807 B2 JP 3880807B2 JP 2001124747 A JP2001124747 A JP 2001124747A JP 2001124747 A JP2001124747 A JP 2001124747A JP 3880807 B2 JP3880807 B2 JP 3880807B2
Authority
JP
Japan
Prior art keywords
data
pointer
filter
coefficient
input data
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
JP2001124747A
Other languages
Japanese (ja)
Other versions
JP2002319844A (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.)
NEC Electronics Corp
Original Assignee
NEC Electronics 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 NEC Electronics Corp filed Critical NEC Electronics Corp
Priority to JP2001124747A priority Critical patent/JP3880807B2/en
Publication of JP2002319844A publication Critical patent/JP2002319844A/en
Application granted granted Critical
Publication of JP3880807B2 publication Critical patent/JP3880807B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Complex Calculations (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、デジタルフィルタおよびその処理方法に関し、特に、汎用マイコンまたはDSPとそのソフトウエアにて実行されるデジタルフィルタおよびその処理方法に関する。
【0002】
【従来の技術】
近年、汎用マイコンやDSP(デジタル・シグナル・プロセッサ)の動作周波数が高速化し、また、積和演算命令等のマルチメディア命令を内蔵した汎用マイコンが出始めている。これに伴い、従来は専用ハードウェアで行なってきたフィルタ処理が、汎用マイコンやDSPとソフトウェアで実現される様になってきた。なお、汎用マイコンやDSPにおいては、一般的にデジタルフィルタ処理はリングバッファ形式のFIR(有限インパルス応答型デジタルフィルタ)によって実現されている。
【0003】
最近では上述のように音声や画像、音楽コーデックなどのマルチメディア処理を汎用マイコンやDSPを用いてソフトウェアにより行うようになってきているが、マルチメディア処理ではリアルタイム性が要求されるとともに、複数のアプリケーションを実行するために、ソフトウェア処理を更に高速化することが必要となってきた。また、マイコンやDSPの動作周波数が高速化するとともに低消費電力化しており、携帯機器にもマルチメディア処理が搭載されるようになってきており、使用メモリのサイズとともに消費電力の更なる低減も要求されるようになってきている。
【0004】
ここで、汎用マイコンによる一般的なデジタルフィルタの処理方式について説明する。
【0005】
図7は、遅延数pのFIR形デジタルフィルタの構成図である。a0 〜apはフィルタ係数(タップ係数)、Z−1 は単位遅延素子を示す。このデジタルフィルタの入力Dnに対する出力ynは、次の演算式で表わすことができる。
yn = a0*Dn+a1*Dn-1+a2*Dn-2+・・・ +ap-1*Dn-(p-1)+ap*Dn-p
図8は、従来のデジタルフィルタのブロック図である。図8に示す従来例のデジタルフィルタは、図7に示すフィルタ係数a0〜apを格納する係数メモリ12と、入力データを格納するとともに単位遅延素子による遅延データを保持するデータRAM(遅延器)11と、データRAM11への入力データの書き込みアドレスを指定する書き込みポインタP1と、タップごとの積和演算を行う際に読み出す入力データまたは遅延データのアドレスを指定する読み出しポインタP2と、読み出した入力データまたは遅延データを保持する乗数レジスタ15と、タップごとの積和演算を行う際に係数メモリ12から読み出すフィルタ係数のアドレスを指定する係数ポインタP3と、読み出したフィルタ係数を保持する被乗数レジスタ16と、積和演算器(乗算器13、加算器14、結果レジスタ17)により構成されている。
【0006】
なお、ほぼ同様な構成で、フィルタ係数に対称性があり、積和演算機能が無い場合に、乗算処理の回数を削減して処理時間を短縮するデジタルフィルタの例が、特開平3−277009号公報に示されている。
【0007】
図9は、従来の汎用マイコンにおけるデジタルフィルタにて一般的に用いられる、データRAM11をリングバッファ形式で構成した場合の、リングバッファとポインタおよび対応する係数メモリ12の構成を示すものである。
【0008】
ここで、リングバッファは、遅延数pの遅延バッファと入力データバッファを合わせた(p+1)のバッファで構成され、また係数メモリ12はリングバッファと同数(タップ数(p+1))で構成される。
【0009】
P1は、リングバッファに入力データを書き込む際のアドレスを示す書き込みポインタである。P2は、各タップ毎の積和演算を行う際に読み出す遅延データのアドレスを示す読み出しポインタである。また、P3は各タップ毎の積和演算の際に読み出すフィルタ係数を示す係数ポインタである。
【0010】
読み出しポインタP2は積和演算の初期時には、書き込みポインタP1と同一のバッファ位置を指定し、その初期位置から出発して、積和演算のためにタップ係数と乗算されるデータが格納されているバッファ位置を指示する。
【0011】
時系列入力データ D1, D2, D3, D4, ....Dp, Dp+1, Dp+2,Dp+3, Dp+4 ....は、このデジタルフィルタに次のように格納される。まず、データD1は、データRAMの一端X2側の最端にあるバッファに格納される。データD2, D3, D4, ....... Dp, Dp+1は、データD1が格納されているX2側の端のバッファから順次にY2方向に書き込まれる。したがって、データDp+1は、バッファのX1側の最端バッファに格納される。これで、データの書き込み位置が一巡する。次のデータDp+2はデータD1上に上書きされる。以降、データDp+3,Dp+4.... はデータ D2, D3に上書きされる。図9の(D1),(D2),(D3) ...(Dp+1)は上書き前にその位置に書き込まれていたデータである。
【0012】
上記のデータ格納の際に、データの格納位置は書き込みポインタP1によって指定される。すなわち、書き込みポインタP1は、まず、データRAM11のX2側の最端のバッファを指定する。次に、書き込みポインタP1はデータRAM11のX2側最端のバッファのX1方向隣のバッファを指定する。以降、書き込みポインタP1は順次にX1方向に向かってシフトして順次にバッファを指定する。そうして、X1方向最端のバッファを指定した後には、次に、X2方向最端のバッファを指定し、以後、X1方向にシフトする。図9において、書き込みポインタP1は、現在、X2側の端から3番目のバッファを指定している。それによって、データ Dnが、前に格納されたデータD3上に上書きされている。
【0013】
積和演算において、データとタップ係数との乗算は、通常書き込みポインタP1が指定しているデータから開始して、データの格納順序に対して逆方向に行われる。すなわち、読み出しポインタP2は、積和演算の初期時には、書き込みポインタP1と同一の値を持ち、以降、X2方向にシフトする。読み出しポインタP2がX2側最端のバッファを指示すると、次に、読み出しポインタP2はX1側最端のバッファを指示する。図4において、次のデータDn+1がデータDn-p上に上書きされるまでに、読み出しポインタP2は順次に、データ Dn, Dn-1,Dn-2, Dn-3, Dn-4, Dn-5,....., Dn-p を指定する。その結果、積和 a0Dn+a1Dn-1+a2Dn-2 +a3Dn-3+ ...+apDn-pが演算される。
【0014】
前記のデータRAMをリングバッファ形式で構成した場合のデジタルフィルタにおいては、p+1個の遅延素子(バッファ)にデータがリング状に配列されている。例えば、図9に示されている現在のデータ配置においては、最先に入力したデータDn-pと最後に入力したデータDnとが隣り合わせに配列し、両端X1、X2を繋ぐとDn-pからDnまでのデータがDn-p, ...,Dn-3,Dn-2,Dn-1,Dnの順序にリング状に配列している。このリング状の配列によって少数のバッファで大量のデータを順次にフィルタ処理することができるけれども、ポインタ管理が複雑で、ポインタをシフトするときには、その度に、ポインタがバッファの終端にきているか、否かをチェックする必要がある。
【0015】
データRAMをリングバッファ形式で構成した場合の、従来例のフィルタ処理フローを図10に示す。なお、図10に示す処理は、入力データが入力される度に開始から終了までの処理が実行されるものである。
【0016】
図10のフローに示すように、入力データが1つ入力される毎にタップ数(遅延数p+1)回分の積和演算ループが実行されるが、ループ内で読み出しポインタP2を更新する度に、読み出しポインタP2がリングバッファの終端に達したかどうかをチェックする必要がある。(ステップS309)
前記従来のリングバッファ形式でデータRAM(データバッファおよび遅延バッファ)を構成するデジタルフィルタの場合、データが入力される毎に書き込みポインタP1を更新して最新の入力データの書き込み位置を移動し、書き込みポインタP1の更新に合せて、積和演算時に遅延データを読み出すための読み出しポインタP2のスタート位置も移動させるため、読み出しポインタP2がリングバッファの途中からスタートする場合がある。読み出しポインタP2は1回の積和演算毎に更新されるため、読み出しポインタP2がリングバッファの途中からスタートした場合、タップ数(p+1)回の積和演算を繰り返す間に、読み出しポインタP2がリングバッファの最端を越えるため、読み出しポインタP2の更新ごとにポインタがバッファ終端に達したかどうかチェックする必要がある。
【0017】
積和演算命令等のマルチメディア命令を内蔵したマイコンやDSPでは、積和演算処理ループにおける積和演算処理およびポインタ更新処理の実行時間に対し、ポインタがバッファ終端に達したかチェックするための条件判断の処理時間は大きな割合を占める。これがフィルタ処理の高速化の妨げとなっていた。
【0018】
上記の問題を解決するために、特許第3071765号ではポインタ更新時のポインタ終端チェックを不要とすることで処理速度を高速化する方法が提案されている。
【0019】
具体的には、入力データ数が有限値nである場合に、データRAMとして、リングバッファの代わりに入力データ数nと遅延数pとを合計した数(p+n)の配列を用意することにより、ポインタを更新してもポインタが終端を越えないように考慮し、前記データRAMをリングバッファ形式で構成した場合のポインタ終端チェックを回避したものである。
【0020】
上述した前記第2の従来のデジタルフィルタをより詳細に説明すべく、図面を参照して説明する。
【0021】
図11は前記従来例2のデジタルフィルタにおけるデータRAMとポインタおよび対応する係数メモリの構成を示した図である。
【0022】
データRAMは入力されるデータ数nと遅延数pを合わせた(n+p)個のバッファで構成される。バッファの先頭(X2)からp個のバッファにはあらかじめ0を格納しておく。また書き込みポインタP1は、バッファ先頭(X2)から(p+1)番目(図4のD1)の位置からスタートする。
【0023】
次に前記従来のデジタルフィルタの動作についてフローを用いて説明する。
【0024】
従来例2のフィルタ処理フローを図12に示す。図12のフローに示すように、積和演算ループ内にポインタ更新時の終端チェック処理は必要ない。
【0025】
上記の通り、前記従来例2のデジタルフィルタでは、ポインタを更新してもポインタがバッファ配列の終端を越えないように考慮し、前記データRAMをリングバッファ形式で構成した場合のポインタ終端チェックを回避することによりフィルタ処理の実行速度を向上させている。
【0026】
【発明が解決しようとする課題】
しかしながら、上記の従来のデジタルフィルタにおけるフィルタ処理には、次のような問題点があった。
【0027】
第1の問題点は、従来のリングバッファ形式でデータバッファおよび遅延バッファを構成したデジタルフィルタの場合は、ポインタの管理が複雑であるため、処理ステップが多くかかり、フィルタ処理の高速化の妨げとなる点である。
【0028】
その理由は、リングバッファ形式でデータバッファおよび遅延バッファを構成する場合、データが入力される毎に書き込みポインタ(P1)を更新して最新の入力データ書き込むため、積和演算時に遅延データを読み出すための読み出しポインタ(P2)のスタート位置も移動し、リングバッファの途中からスタートすることになる。
【0029】
1回の積和演算毎に読み出しポインタ(P2)を更新するため、タップ数(p+1)回の積和演算を繰り返す間に、読み出しポインタ(P2)はリングバッファの境界を越えるため、読み出しポインタ(P2)の更新ごとにポインタがバッファ終端に達したかどうかチェックする必要があるためである。
【0030】
積和演算命令等のマルチメディア命令を内蔵したマイコンやDSPでは、積和演算処理ループにおける積和演算処理およびポインタ更新処理の実行時間に対し、ポインタがバッファ終端に達したかチェックするための条件判断の処理時間は大きな割合を占める。
【0031】
第2の問題点は、上記第1の問題点を回避する従来例2のデジタルフィルタでは、ポインタの終端チェックを回避するために、データRAMとして入力データ数nと遅延数pとを合計した数(p+n)のバッファ(遅延素子)配列を用意する必要があるため、入力データ数が多い場合にバッファ(遅延素子)を多く用意する必要がある。このため回路規模が大きくなりシステムのコストが高くなる点である。
【0032】
その理由は、積和演算ループにおけるポインタのチェックを不要とするために、入力データ数が有限値nの場合にデータ数nと遅延数pを合計した(n+p)個の遅延素子配列(データバッファ)を使用して、ポインタを更新してもポインタがバッファの終端を越えることがないようにする必要があり、このため入力データ数の有限値nが大きい場合でも(n+p)個の遅延素子配列を用意する必要があるためである。
【0033】
第3の問題点は、前記従来例2のデジタルフィルタは、携帯機器など搭載メモリが少ないシステムでは実現できない場合がある点である。
【0034】
その理由は、前記従来例2のデジタルフィルタでは、データRAMとして入力データ数n+遅延数pを合計した(n+p)個の遅延素子(データバッファ)を用意する必要があるが、携帯機器などでは限られたメモリしか搭載していないため必要なデータバッファのサイズを確保できないためである。
【0035】
また、入力されるデータ数が不定(または無限)であるデジタルフィルタ処理の場合には、従来例2によるデジタルフィルタでは実現できないという問題がある。
【0036】
本発明の目的は、上述の問題点を解決するため、データRAMは従来と同様にリングバッファ形式を採用することによりバッファサイズは最小限に抑え、フィルタ係数メモリを拡張するとともにデータ読み出しポインタを常にリングバッファの最端からスタートすることにより、ポインタ更新時のポインタの終端チェックを不要とし、処理ステップを削減することにある。
【0037】
【課題を解決するための手段】
本発明のデジタルフィルタは、積和演算器を有し、入力データおよび既に入力データとして受け取ったn(n>0)個の遅延データと、前記入力データおよび前記n個の遅延データにそれぞれ対応するn+1個のフィルタ係数との乗算を行い前記乗算した結果の和をとる積和演算を実行することによってフィルタ動作をするデジタルフィルタであって、前記n+1個のフィルタ係数を2回繰り返したものから所定のフィルタ係数を削除した2n+1個のフィルタ係数が格納される2n+1個のバッファからなる第1の配列を有する係数メモリと、前記繰り返し格納されたn+1個のフィルタ係数の順序にて、前記繰り返したn+1個のフィルタ係数にそれぞれ対応する前記入力データおよび前記n個の遅延データが格納されるn+1個のバッファからなる第2の配列を有するデータRAMと、前記データRAMへの前記入力データの書き込みアドレスを、前記第2の配列を構成する所定のバッファに指定し、前記入力データの書き込みに応じて更新する書き込みポインタと、前記積和演算を実行する際の前記データRAMから読み出す前記入力データまたは前記遅延データのアドレスを、前記フィルタ動作を開始するときの初期値として前記第2の配列の一端を構成するバッファに指定し、前記積和演算の実行毎に行う前記入力データまたは前記遅延データの読み出しに応じて更新する読み出しポインタと、前記積和演算を実行する際の前記係数メモリから読み出す前記フィルタ係数のアドレスを、前記フィルタ動作を開始するときの初期値として前記書き込みポインタが指定する前記第2の配列の一端を構成するバッファからの位置に基づいて設定し、前記積和演算の実行毎に行う前記フィルタ係数の読み出しに応じて更新する係数ポインタと、を備える構成である。
【0038】
また、本発明のデジタルフィルタの前記積和演算器は、乗算器および加算器を備える構成であり、前記積和演算器は、前記加算器の結果を保持する結果レジスタを備える構成である。
【0039】
さらに、本発明のデジタルフィルタの処理方法は、入力データおよび既に入力データとして受け取ったn(n>0)個の遅延データと、前記入力データおよび前記n個の遅延データにそれぞれ対応するn+1個のフィルタ係数との乗算を行い前記乗算した結果の和をとる積和演算を実行することによってフィルタ動作をするデジタルフィルタの処理方法であって、n+1個のバッファへの前記入力データの書き込み位置を指定する書き込みポインタを所定の位置に設定する工程と、前記書き込みポインタが指定するバッファに対して、前記入力データの書き込みを行う工程と、前記フィルタ動作を開始する際に、前記n+1個のバッファから前記入力データおよび前記遅延データを読み出す際の読み出し位置を指定する読み出しポインタの初期値を前記n+1個のバッファの一端に設定する工程と、前記フィルタ動作を開始するときに、前記n+1個のバッファに格納された前記入力データおよび前記n個の遅延データの格納順序にて前記入力データおよび前記n個の遅延データに対応する前記n+1個のフィルタ係数を2回繰り返したものから所定のフィルタ係数を削除した2n+1個のフィルタ係数が格納された2n+1個のバッファから前記フィルタ係数を読み出す際の読み出し位置を指定する係数ポインタの初期値を前記書き込みポインタが指定する前記n+1個のバッファの一端からの位置に基づいて設定する工程と、前記読み出しポインタの指定に基づいて前記入力データまたは前記遅延データを読み出す工程と、前記係数ポインタの指定に基づいて前記フィルタ係数を読み出す工程と、前記入力データまたは前記遅延データを読み出す工程によって読み出した前記入力データまたは前記遅延データと、前記フィルタ係数を読み出す工程によって読み出した前記フィルタ係数とに基づいて前記積和演算を実行する工程と、を有することを特徴とする。
【0042】
【発明の実施の形態】
本発明によるデジタルフィルタおよびその処理方法は、汎用マイコンまたはDSPとそのソフトウエアにて実行されるデジタルフィルタに関し、特にフィルタ係数(タップ係数)を拡張することにより、積和演算ループ処理におけるポインタ管理を不要として、従来のデジタルフィルタに対してメモリの増加を最小限に抑えた上で、処理ステップ数を削減してフィルタ処理時間(実行時間)を短縮し、システムの処理速度を高速化または消費電力を削減できる構成を提供する。
【0043】
図2において、本発明におけるデジタルフィルタでは、入力されるデータを格納するとともに遅延数分保持するデータRAM1は、従来と同様に遅延数p+1のバッファからなるリングバッファ形式のメモリ領域であるのに対し、フィルタ係数を保持する係数メモリ2は、タップ数(遅延数+1)分のタップ係数の配列を、1つのタップ係数を除いて2回繰り返した配列として構成されている。さらに、データが入力される毎に実行されるデジタルフィルタ処理の積和演算ループの開始時に、データRAMの読み出しポインタP2を常にリングバッファの最端からスタートして他端側に更新するとともに、対応するタップ係数を示す係数ポインタP3を、現在の書き込みポインタP1の位置に対応する位置からスタートして終端側に更新することにより、タップ数回繰り返される積和演算ループ内に読み出しポインタP2および係数ポインタP3の終端チェックが不要となり、積和演算ループの実行ステップ数が削減される。
【0044】
このようにして、本発明のデジタルフィルタはフィルタ係数(タップ係数)を拡張することにより、データの読み出しポインタ更新時のポインタの終端チェックを不要とすることによりフィルタ処理ステップ数の削減を可能にする。
【0045】
本発明は、汎用マイコンやDSPによるデジタルフィルタ処理に関するものであり、ソフトウエアにてフィルタ処理を行うマルチメディア・システムなどに適用される。
【0046】
以下に図面を参照して、本発明に係る実施の形態のデジタルフィルタを説明する。
【0047】
図1は、本発明の第1の実施の形態のデジタルフィルタおよびその処理方法の構成を示すブロック図である。図1に示すデジタルフィルタは、タップ数分のフィルタ係数の配列を拡張して格納する係数メモリ2と、単位時間毎の入力データを格納するとともに遅延数分の単位遅延素子による遅延データを保持するデータRAM(遅延器)1と、データRAM1への入力データの書き込みアドレスを指定する書き込みポインタP1と、タップごとの積和演算を行う際に読み出す入力データまたは遅延データのアドレスを指定する読み出しポインタP2と、読み出した入力データまたは遅延データを保持する乗数レジスタ5と、タップごとの積和演算を行う際に係数メモリ2から読み出すフィルタ係数のアドレスを指定する係数ポインタP3と、読み出したフィルタ係数を保持する被乗数レジスタ6と、積和演算器(乗算器3、加算器4、結果レジスタ7)により構成されている。なお、係数ポインタP3の初期値は入力データの書き込みポインタP1の値をもとに設定する構成となっている。
【0048】
次に、本発明の第1の実施の形態のデジタルフィルタにおける、データRAM1の構成と係数メモリ2の構成とを、各ポインタの対応について、図2を参照して説明する。
【0049】
図2は、本発明の第1の実施の形態のデジタルフィルタにおけるリングバッファ形式のデータRAM1と係数メモリ2の構成を示す図である。ここで、データRAM1は、従来と同様に遅延数p分の遅延バッファと入力データバッファを合わせた(p+1)のバッファで構成され、また係数メモリ2はデータRAMと同数(タップ数(p+1))のタップ係数配列a0,a1,a2, ...ap-1,ap を2回繰り返し、先頭のa0のみ除いた配列で構成される。
【0050】
ここでP1は、リングバッファに入力データを書き込む際のアドレスを示す書き込みポインタP1の示す位置である。同様にP2は、各タップ毎の積和演算を行う際に読み出す遅延データのアドレスを示す読み出しポインタP2の示す位置である。また、P3は各タップ毎の積和演算の際に読み出すフィルタ係数を示す係数ポインタP3の示す位置である。書き込みポインタP1は入力データを書き込む毎にX1側へ更新される。読み出しポインタP2は積和演算の開始時には常にX1側最端のバッファ位置からスタートし積和演算毎にX2側へ更新され乗算されるデータが格納されているバッファ位置を示し、全タップの積和演算終了時にX2側最端位置を示している。
【0051】
係数ポインタP3は、現在の書き込みポインタP1のデータRAM先頭X2からのインデックス値に対応する係数メモリ先頭Y1からのインデックス位置からスタート(図2では、P1がX2から3番目であるためP3はY1から3番目の位置からスタート)し、積和演算毎にY2側へ更新されタップ毎の積和演算に使用されるタップ係数の位置を示すものである。
【0052】
次に、図2および図3のフローチャートを参照して本発明の第1の実施の形態のデジタルフィルタの動作について詳細に説明する。
【0053】
本発明の第1の実施の形態のデジタルフィルタのデジタルフィルタにデータが入力されると、まず、累算レジスタ(結果レジスタ7)を0クリアする(図3のステップS101)。
【0054】
次に、書き込みポインタP1が示す位置に入力データD1を書き込む(ステップS102)。
【0055】
さらに、読み出しポインタP2をデータRAMの終端位置(X1側最端バッファ)を示す値に初期化する(ステップS103)。次に、係数ポインタP3をY1側最端位置から、現在の書き込みポインタP1のX2側からのインデックス値分ずらした位置に設定する(ステップS104)。
【0056】
次に、読み出しポインタP2の位置からデータを読み出し乗数レジスタ5に設定する(ステップS105)。さらに係数ポインタP3の位置からフィルタ係数を読み出し被乗数レジスタに設定する(ステップS106)。
【0057】
次に、乗数レジスタ5のデータと被乗数レジスタ6の係数を乗算し結果レジスタの内容を加算した結果を累算レジスタ(結果レジスタ7)に格納する(ステップS107)。
【0058】
読み出しポインタP2はX2側隣りのバッファ位置を示すよう更新(ステップS108)し、同様に係数ポインタP3もY2側隣りの係数位置を示すように更新する(ステップS109)。
【0059】
上記ステップS105からステップS109の処理をタップ数回繰り返し(ステップS110)、全タップ分の積和演算が終了したのち、フィルタ処理結果である結果レジスタ7の内容を出力する(ステップS111)。
【0060】
次に、書き込みポインタP1をX1側に更新(ステップS112)したのち、更新した書き込みポインタP1を確認(ステップS113)して、更新した書き込みポインタP1がリングバッファの終端X1を越えた場合は、書き込みポインタP1をリングバッファ先頭位置に再設定する(ステップS114)。次のデータが入力された時点で再びステップS101からフィルタ処理を行う。
【0061】
次に、具体例を参照して説明する。
【0062】
タップ数が6(遅延数5)のフィルタを例として説明する。図4は、本発明の第1の実施の形態のデジタルフィルタへの時系列入力データのうち、先頭データ、3番目のデータ、6番目のデータ、および9番目のデータの入力に伴なうフィルタ処理の積和演算ループ開始時点でのデータRAMの内容、書き込みポインタP1の位置、読み出しポインタP2のスタート位置、および係数ポインタP3のスタート位置を示す説明図である。
【0063】
なお、初期状態としてデータRAM1のすべてのバッファは0クリアされており、書き込みポインタP1はデータRAMの先頭であるX2側最端のバッファを示している。
【0064】
まず、時系列入力データの最初のデータD1が入力されると、累算レジスタ(結果レジスタ7)を0クリアし(ステップS101)、次に書き込みポインタP1が示す位置(図4(1)のP1の位置)に入力データD1を書き込む(ステップS102)。
【0065】
次に、読み出しポインタP2をデータRAMの終端位置(X1側最端バッファ)を示す値に初期化する(ステップS103)。次に係数ポインタP3をY1側最端位置から、現在の書き込みポインタP1のX2側からのインデックス値分ずらした位置に設定する(ステップS104)。ここでは、書き込みポインタP1がX2側から1番目であるため、係数ポインタP3の初期値はY1側から1番目の位置となる。この時点でのデータRAMの内容、書き込みポインタP1の位置、読み出しポインタP2のスタート位置、および係数ポインタP3のスタート位置を図4の(1)に示す。
【0066】
次に、読み出しポインタP2の位置からデータを読み出し乗数レジスタ5に設定する(ステップS105)。さらに係数ポインタP3の位置からフィルタ係数を読み出し被乗数レジスタに設定する(ステップS106)。
【0067】
次に、乗数レジスタ5のデータと被乗数レジスタ6の係数を乗算し結果レジスタの内容を加算した結果を累算レジスタ(結果レジスタ7)に格納する(ステップS107)。読み出しポインタP2はX2側隣りのバッファ位置を示すよう更新(ステップS108)し、同様に係数ポインタP3もY2側隣りの係数位置を示すように更新する(ステップS109)。
【0068】
上記ステップS105からステップS109の処理をタップ数6回繰り返し(ステップS110)、全タップ分の積和演算が終了したのち、フィルタ処理結果である結果レジスタ7の内容を出力する(ステップS111)。次に書き込みポインタP1をX1側に更新(ステップS112)し書き込みポインタはX2側から2番目のバッファを示す。次に更新した書き込みポインタP1を確認(ステップS113)し、リングバッファの終端X1を越えていないため、これで先頭データD1の入力にともなうフィルタ処理を終了する。次のデータが入力された時点で再びステップS101からフィルタ処理を行う。
【0069】
同様に、3番目の入力データD3の入力に伴なうフィルタ処理でステップS104の終了時点でのデータRAMの内容、書き込みポインタP1の位置、読み出しポインタP2のスタート位置、および係数ポインタP3のスタート位置を図4の(2)に示す。係数ポインタP3のスタート位置は、書き込みポインタP1がX2側から3番目のバッファを示しているため、Y1側から3番目の係数を示す位置となる。
【0070】
同様に、6番目の入力データD6の入力に伴なうフィルタ処理でステップS104の終了時点でのデータRAMの内容、書き込みポインタP1の位置、読み出しポインタP2のスタート位置、および係数ポインタP3のスタート位置を図4の(3)に、9番目の入力データD9の入力に伴なうフィルタ処理でステップS104の終了時点でのデータRAMの内容、書き込みポインタP1の位置、読み出しポインタP2のスタート位置、および係数ポインタP3のスタート位置を図4の(4)に示す。
【0071】
前記に示すように、データ格納の際に、データの格納位置は書き込みポインタP1によって指定される。すなわち、書き込みポインタP1は、まず、データRAM1のX2側の最端のバッファを指定する。次に、書き込みポインタP1はデータRAM11のX2側最端のバッファのX1方向隣のバッファを指定する。以降、書き込みポインタP1は順次にX1方向に向かってシフトして順次にバッファを指定する。そうして、X1方向最端のバッファを指定した後には、次に、X2方向最端のバッファを指定し、以後、X1方向にシフトする。図2において、書き込みポインタP1は、現在、X2側の端から3番目のバッファを指定している。それによって、データ DnがX2側から3番目のバッファに格納されている。
【0072】
これに対し、積和演算ループにおけるデータの読み出しは、リングバッファの終端位置から開始し、タップ数分の積和演算を終了した時点で読み出しポインタP2は常にリングバッファの先頭位置を示しリングバッファの境界を越えることはない。
【0073】
また、フィルタ係数の読み出しポインタP3も、P1に対応する位置からスタートしタップ数分の積和演算が終了した時点で係数メモリの終端を越えることはない。
【0074】
上記に示すように、本発明のデジタルフィルタによれば、データの読み出しポインタP2および係数ポインタP3がバッファ境界を越えることが無いため、積和演算ループ内にポインタの終端チェック処理が不要であり、従来のリングバッファ形式のデジタルフィルタ処理に対して実行ステップ数を削減し、処理速度を向上することが可能である。この結果、動作クロック周波数を小さくして消費電力を低減することができるようになる。
【0075】
次に、本発明の他の実施の形態について図面を参照して詳細に説明する。
【0076】
タップ数が6(遅延数5)のフィルタを例に、本発明の第2の実施の形態のデジタルフィルタによるデータRAMおよび係数メモリの構成を図5に示す。
【0077】
本発明の第2の実施の形態のデジタルフィルタは、係数メモリの構成およびこれに伴なう係数ポインタP3のスタート位置以外は、図1から図4に示した本発明の第1の実施の形態のデジタルフィルタと同一である。同一構成要素には、同一の参照符号を付してある。
【0078】
本発明の第2の実施の形態のデジタルフィルタへの時系列入力データのうち、先頭データ、5番目のデータ、6番目のデータ、および9番目のデータの入力に伴なうフィルタ処理の積和演算ループ開始時点でのデータRAMの内容、書き込みポインタP1の位置、読み出しポインタP2のスタート位置、および係数ポインタP3のスタート位置を図5に示す。
【0079】
本発明の第1の実施の形態のデジタルフィルタの係数メモリは、タップ係数配列a0,a1,a2, ...ap-1,ap を2回繰り返して先頭のa0を除いた配列で構成されるのに対し、本発明の第2の実施の形態のデジタルフィルタの係数メモリは、タップ係数配列a0,a1,a2, ...ap-1,ap を2回繰り返して最終のapのみを除いた配列で構成されるものである。
【0080】
また、本発明の第2の実施の形態のデジタルフィルタにおける積和演算ループ開始時の係数ポインタP3のスタート位置は、本発明の第1の実施の形態のデジタルフィルタでは、Y1の先頭位置から現在の書き込みポインタP1のX2側からのインデックス値分ずらした位置に設定したのに対し、本発明の第2の実施の形態のデジタルフィルタでは、Y1の先頭位置から現在の書き込みポインタP1のX2側からのインデックス値をプラス1だけずらした位置に設定する。
【0081】
なお、図5(c)に示すように、書き込みポインタP1がリングバッファの終端位置である場合には、積和演算ループ開始時の係数ポインタP3のスタート位置は、Y1の先頭位置から現在の書き込みポインタP1のX2側からのインデックス値をプラス1だけずらした位置ではなく、係数メモリの先頭位置に設定する。
【0082】
本発明の第2の実施の形態のデジタルフィルタに示すように、係数メモリをタップ係数配列a0,a1,a2, ...ap-1,ap を2回繰り返して最終のapのみを除いた配列で構成しても、本発明の第1の実施の形態のデジタルフィルタの効果と同様である。
【0083】
次に、本発明の第3の実施の形態のデジタルフィルタについて図面を参照して詳細に説明する。
【0084】
図6は、本発明の第3の実施の形態のデジタルフィルタ係るデジタルフィルタの係数メモリ拡張処理のフローチャートである。本発明の第3の実施の形態のデジタルフィルタでは、システムの初期状態での係数メモリは、従来と同様にタップ数分のタップ係数配列a0,a1,a2, ...ap-1,apのみで構成し、実際のフィルタ処理を開始する際に、事前に図6に示す手順にて係数メモリを拡張することにより、本発明の第1の実施の形態のデジタルフィルタと同様にフィルタ処理を行うことができ、フィルタ処理を行わない場合は、係数メモリの拡張によって増加する遅延数分の係数メモリ領域を、他のアプリケーション用のメモリ領域としても使用することができる。これにより、メモリ容量の少ないシステムでも本発明のデジタルフィルタを実現することが可能となる。
【0085】
【発明の効果】
以上説明したように、本発明の第1の効果は、従来のリングバッファ形式のデジタルフィルタ処理に対して、本発明のデジタルフィルタ処理は積和演算ループ処理におけるポインタ管理(チェック)が不要であるため、フィルタ処理時間を短縮してシステムを高速にすることができることにある。これにより、動作クロック数を低下させて消費電力を削減することが可能である。
【0086】
その理由は、従来のリングバッファ形式のデジタルフィルタに対しフィルタ係数RAMを拡張し、積和演算処理をリングバッファの先頭(または終端)から開始してタップ数分で終了することにより、ポインタがバッファの終端を越えないようにしたためである。
【0087】
具体的には、例えば汎用マイコンにて、従来のリングバッファ形式のデジタルフィルタで1つのデータ入力に対する処理には、およそ(10×p+9)ステップを必要とするのに対して、本発明によると(7×p+10)ステップで済む。これを割合に直すと、処理時間を従来の約70%まで短縮することができる。
【0088】
フィルタ処理では、入力データは等しい時間間隔で処理される。従ってフィルタ処理時間が短縮できたことによって、フィルタ処理以外のアプリケーションの実行時間を増やすことができる。また、フィルタ処理時間を短縮することによって、動作クロックを遅くしても単位時間間隔でのフィルタ処理が間に合うため、動作クロック数を低下させて消費電力を削減することが可能である。
【0089】
第2の効果は、従来のデータRAMのとして有限入力データ数nと遅延数pを合計した数(n+p)のバッファ(遅延素子)配列を使用することによりポインタ管理(チェック)を不要としたデジタルフィルタ処理に対し、本発明では、デジタルフィルタ処理の高速化のために増加するメモリの数を遅延数pに抑えることにより必要となるメモリサイズを削減し、回路規模を削減することができることにある。
【0090】
その理由は、一般的にFIR型のデジタルフィルタのタップ数は入力データ数に対し十分に小さい数であるためである。
【0091】
例えば、オーディオコーデック技術であるMP3デコーダで使用するフィルタのタップ数は、22〜512程度である。これに対しデータ数は、22KHzのサンプリング周波数で10秒分のステレオ・データの場合、約45万個である。これを従来の入力データ数nと遅延数pを合計した数(n+p)のバッファ(遅延素子)配列を使用するデジタルフィルタで処理するためには、約440Kワードのメモリが必要であるのに対し、本発明のデジタルフィルタでは、約1.5Kワードのメモリに削減できる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態のデジタルフィルタのブロック図である。
【図2】図1に記載されたデータRAMおよび係数メモリの構成図である。
【図3】本発明の第1の実施の形態のデジタルフィルタ処理フローである。
【図4】本発明の第1の実施の形態のデジタルフィルタにおけるポインタ位置説明図である。
【図5】本発明の第2の実施の形態のデジタルフィルタのブロック図である。
【図6】本発明の第3の実施の形態のデジタルフィルタにおける係数メモリの拡張処理フローである。
【図7】FIR型デジタルフィルタの概念図である。
【図8】第1の従来のデジタルフィルタのブロック図である。
【図9】第1の従来のデジタルフィルタにおけるデータRAMおよび係数メモリの構成図である。
【図10】第1の従来のデジタルフィルタにおけるデジタルフィルタの処理フローである。
【図11】第2の従来のデジタルフィルタにおけるデータRAMおよび係数メモリの構成図である。
【図12】第2の従来のデジタルフィルタにおけるデジタルフィルタの処理フローである。
【符号の説明】
1,11,21 データRAM(遅延器)
2,12,22 係数メモリ
3,13 乗算器
4,14 加算器
5,15 乗数レジスタ
6,16 被乗数レジスタ
7,17 結果レジスタ
P1 書き込みポインタ
P2 読み出しポインタ
P3 係数メモリポインタ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a digital filter and a processing method thereof, and more particularly to a digital filter executed by a general-purpose microcomputer or DSP and software thereof and a processing method thereof.
[0002]
[Prior art]
In recent years, the operating frequency of general-purpose microcomputers and DSPs (digital signal processors) has increased, and general-purpose microcomputers incorporating multimedia instructions such as product-sum operation instructions have begun to appear. Along with this, the filter processing that has been conventionally performed by dedicated hardware has been realized by a general-purpose microcomputer, DSP, and software. In general-purpose microcomputers and DSPs, digital filter processing is generally realized by a ring buffer type FIR (finite impulse response type digital filter).
[0003]
Recently, as described above, multimedia processing such as audio, image, and music codec has been performed by software using a general-purpose microcomputer or DSP. In order to execute applications, it has become necessary to further speed up software processing. In addition, the operating frequency of microcomputers and DSPs has been increased and the power consumption has been reduced, and multimedia processing has also been installed in portable devices, and the power consumption has been further reduced along with the size of the memory used. It is becoming required.
[0004]
Here, a general digital filter processing method using a general-purpose microcomputer will be described.
[0005]
FIG. 7 is a configuration diagram of an FIR type digital filter having a delay number p. a0 to ap are filter coefficients (tap coefficients), and Z-1 is a unit delay element. The output yn with respect to the input Dn of this digital filter can be expressed by the following arithmetic expression.
yn = a0 * Dn + a1 * Dn-1 + a2 * Dn-2 +... + ap-1 * Dn- (p-1) + ap * Dn-p
FIG. 8 is a block diagram of a conventional digital filter. A digital filter of the conventional example shown in FIG. 8 includes a coefficient memory 12 for storing the filter coefficients a0 to ap shown in FIG. 7, and a data RAM (delayer) 11 for storing input data and holding delay data by unit delay elements. A write pointer P1 for designating the write address of the input data to the data RAM 11, a read pointer P2 for designating the address of the input data or delay data to be read when performing the product-sum operation for each tap, and the read input data or A multiplier register 15 for holding delay data, a coefficient pointer P3 for designating an address of a filter coefficient to be read from the coefficient memory 12 when performing a product-sum operation for each tap, a multiplicand register 16 for holding the read filter coefficient, To the sum calculator (multiplier 13, adder 14, result register 17) It is configured Ri.
[0006]
Note that an example of a digital filter that has a similar configuration, has symmetrical filter coefficients, and does not have a product-sum operation function, reduces the number of multiplications to shorten the processing time. It is shown in the publication.
[0007]
FIG. 9 shows a configuration of a ring buffer, a pointer, and a corresponding coefficient memory 12 when the data RAM 11 is generally used in a digital filter in a conventional general-purpose microcomputer and is configured in a ring buffer format.
[0008]
Here, the ring buffer is configured by (p + 1) buffers, which are a combination of a delay buffer having a delay number p and an input data buffer, and the coefficient memory 12 is configured by the same number as the ring buffer (number of taps (p + 1)).
[0009]
P1 is a write pointer indicating an address when writing input data to the ring buffer. P2 is a read pointer indicating the address of the delay data read when performing the product-sum operation for each tap. P3 is a coefficient pointer indicating a filter coefficient to be read out in the product-sum operation for each tap.
[0010]
The read pointer P2 designates the same buffer position as that of the write pointer P1 at the initial stage of the product-sum operation, and stores data to be multiplied by the tap coefficient for the product-sum operation starting from the initial position. Indicates the position.
[0011]
Time series input data D1, D2, D3, D4,. . . . Dp, Dp + 1, Dp + 2, Dp + 3, Dp + 4. . . . Is stored in this digital filter as follows. First, the data D1 is stored in a buffer located at the extreme end on the one end X2 side of the data RAM. Data D2, D3, D4,. . . . . . . Dp and Dp + 1 are sequentially written in the Y2 direction from the buffer at the end on the X2 side where the data D1 is stored. Therefore, the data Dp + 1 is stored in the outermost buffer on the X1 side of the buffer. This completes the data writing position. The next data Dp + 2 is overwritten on the data D1. Thereafter, data Dp + 3, Dp + 4. . . . Is overwritten on the data D2 and D3. (D1), (D2), (D3). . . (Dp + 1) is data written at that position before overwriting.
[0012]
In the above data storage, the data storage position is designated by the write pointer P1. That is, the write pointer P1 first designates the endmost buffer on the X2 side of the data RAM 11. Next, the write pointer P1 designates a buffer adjacent to the X2 side end buffer of the data RAM 11 in the X1 direction. Thereafter, the write pointer P1 is sequentially shifted in the X1 direction to sequentially specify the buffers. Then, after designating the buffer at the extreme end in the X1 direction, the buffer at the extreme end in the X2 direction is designated, and then the shift in the X1 direction is performed. In FIG. 9, the write pointer P1 currently designates the third buffer from the end on the X2 side. Thereby, the data Dn is overwritten on the previously stored data D3.
[0013]
In the product-sum operation, the multiplication of the data and the tap coefficient starts from the data designated by the normal write pointer P1, and is performed in the reverse direction with respect to the data storage order. That is, the read pointer P2 has the same value as the write pointer P1 at the initial stage of the product-sum operation, and thereafter shifts in the X2 direction. When the read pointer P2 points to the X2 side endmost buffer, the read pointer P2 next points to the X1 side endmost buffer. In FIG. 4, until the next data Dn + 1 is overwritten on the data Dn-p, the read pointer P2 is sequentially transferred to the data Dn, Dn-1, Dn-2, Dn-3, Dn-4, Dn. -Five,.. . . . , Dn-p is specified. As a result, the product sum a0Dn + a1Dn-1 + a2Dn-2 + a3Dn-3 +. . . + apDn-p is calculated.
[0014]
In the digital filter in the case where the data RAM is configured in a ring buffer format, data is arranged in a ring shape in p + 1 delay elements (buffers). For example, in the current data arrangement shown in FIG. 9, when the first input data Dn-p and the last input data Dn are arranged side by side and both ends X1 and X2 are connected, Dn-p Data up to Dn is Dn-p,. . . , Dn-3, Dn-2, Dn-1, Dn are arranged in a ring. Although this ring-like array can filter large amounts of data sequentially with a small number of buffers, pointer management is complex and each time the pointer is shifted, the pointer is at the end of the buffer, It is necessary to check whether or not.
[0015]
FIG. 10 shows a conventional filter processing flow when the data RAM is configured in a ring buffer format. Note that the processing shown in FIG. 10 is performed from the start to the end each time input data is input.
[0016]
As shown in the flow of FIG. 10, a product-sum operation loop for the number of taps (delay number p + 1) is executed every time one piece of input data is input. Every time the read pointer P2 is updated in the loop, It is necessary to check whether the read pointer P2 has reached the end of the ring buffer. (Step S309)
In the case of a digital filter that constitutes a data RAM (data buffer and delay buffer) in the conventional ring buffer format, the write pointer P1 is updated each time data is input, and the write position of the latest input data is moved and written. As the pointer P1 is updated, the start position of the read pointer P2 for reading delay data during the product-sum operation is also moved, so the read pointer P2 may start from the middle of the ring buffer. Since the read pointer P2 is updated for each product-sum operation, when the read pointer P2 starts from the middle of the ring buffer, the read pointer P2 is ringed while repeating the product-sum operation of the number of taps (p + 1). Since the end of the buffer is exceeded, it is necessary to check whether the pointer has reached the end of the buffer every time the read pointer P2 is updated.
[0017]
For microcomputers and DSPs with built-in multimedia instructions such as multiply-accumulate instructions, a condition for checking whether the pointer has reached the end of the buffer with respect to the execution time of the multiply-accumulate process and the pointer update process in the multiply-add process loop Judgment processing time accounts for a large percentage. This hinders the speeding up of the filtering process.
[0018]
In order to solve the above problem, Japanese Patent No. 3071765 proposes a method for increasing the processing speed by eliminating the need to check the end of the pointer when updating the pointer.
[0019]
Specifically, when the number of input data is a finite value n, as a data RAM, instead of a ring buffer, an array of the total number of input data n and delay number p (p + n) is prepared. Considering that the pointer does not exceed the end even when the pointer is updated, the pointer end check is avoided when the data RAM is configured in a ring buffer format.
[0020]
In order to describe the second conventional digital filter described above in more detail, it will be described with reference to the drawings.
[0021]
FIG. 11 is a diagram showing a configuration of a data RAM, pointers, and corresponding coefficient memories in the digital filter of Conventional Example 2.
[0022]
The data RAM is composed of (n + p) buffers in which the number of input data n and the delay number p are combined. 0 is stored in advance in p buffers from the top (X2) of the buffer. The write pointer P1 starts from the position (p + 1) th (D1 in FIG. 4) from the buffer head (X2).
[0023]
Next, the operation of the conventional digital filter will be described using a flow.
[0024]
FIG. 12 shows a filter processing flow of Conventional Example 2. As shown in the flow of FIG. 12, the end check process at the time of updating the pointer is not required in the product-sum operation loop.
[0025]
As described above, in the digital filter of Conventional Example 2, it is considered that the pointer does not exceed the end of the buffer array even if the pointer is updated, and the pointer end check is avoided when the data RAM is configured in a ring buffer format. By doing so, the execution speed of the filter processing is improved.
[0026]
[Problems to be solved by the invention]
However, the filter processing in the above-described conventional digital filter has the following problems.
[0027]
The first problem is that in the case of a digital filter in which a data buffer and a delay buffer are configured in a conventional ring buffer format, management of pointers is complicated, so that it takes many processing steps and hinders speeding up of filter processing. It is a point.
[0028]
The reason is that when the data buffer and the delay buffer are configured in a ring buffer format, the write pointer (P1) is updated every time data is input and the latest input data is written, so that the delay data is read out during the product-sum operation. The start position of the read pointer (P2) also moves and starts from the middle of the ring buffer.
[0029]
Since the read pointer (P2) is updated for each product-sum operation, the read pointer (P2) crosses the ring buffer boundary while repeating the product-sum operation of the number of taps (p + 1). This is because it is necessary to check whether the pointer has reached the end of the buffer every time P2) is updated.
[0030]
For microcomputers and DSPs with built-in multimedia instructions such as multiply-accumulate instructions, a condition for checking whether the pointer has reached the end of the buffer with respect to the execution time of the multiply-accumulate process and the pointer update process in the multiply-add process loop Judgment processing time accounts for a large percentage.
[0031]
The second problem is that in the digital filter of Conventional Example 2 that avoids the first problem, the total number of input data n and delay number p is used as a data RAM in order to avoid a pointer end check. Since it is necessary to prepare a (p + n) buffer (delay element) array, it is necessary to prepare a large number of buffers (delay elements) when the number of input data is large. This increases the circuit scale and increases the system cost.
[0032]
The reason is that, in order to eliminate the need for pointer check in the product-sum operation loop, when the number of input data is a finite value n, a total of (n + p) delay element arrays (data buffer) (data buffer) ) To update the pointer so that the pointer does not exceed the end of the buffer. Therefore, even when the finite value n of the number of input data is large, (n + p) delay element arrays This is because it is necessary to prepare.
[0033]
A third problem is that the digital filter of the above-described conventional example 2 may not be realized in a system with a small amount of installed memory such as a portable device.
[0034]
The reason is that in the digital filter of the above-described conventional example 2, it is necessary to prepare (n + p) delay elements (data buffers), which is the sum of the number of input data n + the number of delays p, as a data RAM. This is because the required data buffer size cannot be secured because only the specified memory is mounted.
[0035]
Further, in the case of digital filter processing in which the number of input data is indefinite (or infinite), there is a problem that the digital filter according to Conventional Example 2 cannot be realized.
[0036]
The object of the present invention is to solve the above-mentioned problems, and the data RAM adopts a ring buffer format as in the prior art, thereby minimizing the buffer size, extending the filter coefficient memory, and always setting the data read pointer. By starting from the end of the ring buffer, it is not necessary to check the end of the pointer when updating the pointer, and the processing steps are reduced.
[0037]
[Means for Solving the Problems]
    The digital filter of the present invention isA sum-of-products calculator, and input data and n (n> 0) delay data already received as input data, and n + 1 filter coefficients respectively corresponding to the input data and the n delay data A digital filter that performs a multiplication operation by multiplying and performing a sum-of-products operation that takes the sum of the multiplication results, wherein 2n + 1 is obtained by deleting a predetermined filter coefficient from a repetition of the n + 1 filter coefficients twice A coefficient memory having a first array of 2n + 1 buffers in which a number of filter coefficients are stored, and corresponding to the repeated n + 1 filter coefficients in the order of the n + 1 filter coefficients stored repeatedly. A second array of n + 1 buffers in which the input data and the n delay data are stored. A data RAM, a write pointer for designating the write address of the input data to the data RAM in a predetermined buffer constituting the second array, and updating according to the write of the input data, and the multiply-accumulate operation The address of the input data or the delay data read from the data RAM when executing is specified as a buffer constituting one end of the second array as an initial value when starting the filter operation, and the product sum The filter operation is started with a read pointer that is updated in response to the reading of the input data or the delay data that is performed each time an operation is performed, and the address of the filter coefficient that is read from the coefficient memory when the product-sum operation is performed. Configure one end of the second array specified by the write pointer as an initial value when A coefficient pointer set based on the position from the buffer and updated according to the reading of the filter coefficient performed for each execution of the sum-of-products operation,It is the structure provided with.
[0038]
In the digital filter of the present invention, the product-sum calculator includes a multiplier and an adder, and the product-sum calculator includes a result register that holds the result of the adder.
[0039]
Furthermore, the processing method of the digital filter of the present invention includes:The input data and n (n> 0) delay data already received as input data are multiplied by n + 1 filter coefficients corresponding to the input data and the n delay data, respectively. A digital filter processing method for performing a filter operation by executing a product-sum operation for calculating a sum, wherein a write pointer for designating a write position of the input data to n + 1 buffers is set to a predetermined position; A step of writing the input data to the buffer designated by the write pointer, and a read position for reading the input data and the delayed data from the n + 1 buffers when starting the filtering operation. A process for setting an initial value of a read pointer for designating one end of the n + 1 buffers When the filter operation is started, the n + 1 corresponding to the input data and the n delay data in the storage order of the input data and the n delay data stored in the n + 1 buffers. An initial value of a coefficient pointer that specifies a reading position when reading the filter coefficient from 2n + 1 buffers in which 2n + 1 filter coefficients are stored by deleting predetermined filter coefficients from a repetition of the filter coefficients twice. The step of setting based on the position from one end of the n + 1 buffers designated by the write pointer, the step of reading the input data or the delay data based on the designation of the read pointer, and the designation of the coefficient pointer Reading the filter coefficients based on the input data or the delay A step of executing the product-sum operation based on the input data or the delay data read out in the step of reading out the data and the filter coefficient read out in the step of reading out the filter coefficient. .
[0042]
DETAILED DESCRIPTION OF THE INVENTION
The digital filter and its processing method according to the present invention relates to a digital filter executed by a general-purpose microcomputer or DSP and its software, and in particular, by managing a pointer in a product-sum operation loop process by expanding a filter coefficient (tap coefficient). Unnecessary to minimize the increase in memory compared to conventional digital filters, reduce the number of processing steps to shorten the filter processing time (execution time), increase the system processing speed or power consumption Provide a configuration that can reduce
[0043]
In FIG. 2, in the digital filter according to the present invention, the data RAM 1 that stores input data and holds it for the number of delays is a ring buffer type memory area composed of buffers with a number of delays p + 1 as in the prior art. The coefficient memory 2 that holds the filter coefficients is configured as an array in which an array of tap coefficients for the number of taps (delay number + 1) is repeated twice except for one tap coefficient. Furthermore, at the start of the product-sum operation loop of the digital filter processing executed every time data is input, the data RAM read pointer P2 always starts from the extreme end of the ring buffer and is updated to the other end. The coefficient pointer P3 indicating the tap coefficient to be started is updated from the position corresponding to the current position of the write pointer P1 to the end side, so that the read pointer P2 and the coefficient pointer are repeated in the product-sum operation loop repeated several times. The end check of P3 becomes unnecessary, and the number of execution steps of the product-sum operation loop is reduced.
[0044]
In this way, the digital filter of the present invention extends the filter coefficient (tap coefficient), thereby making it possible to reduce the number of filter processing steps by making it unnecessary to check the end of the pointer when updating the data read pointer. .
[0045]
The present invention relates to digital filter processing by a general-purpose microcomputer or DSP, and is applied to a multimedia system that performs filter processing by software.
[0046]
Hereinafter, a digital filter according to an embodiment of the present invention will be described with reference to the drawings.
[0047]
FIG. 1 is a block diagram showing a configuration of a digital filter and a processing method thereof according to the first embodiment of the present invention. The digital filter shown in FIG. 1 stores a coefficient memory 2 that expands and stores an array of filter coefficients for the number of taps, stores input data for each unit time, and holds delay data by unit delay elements for the number of delays. A data RAM (delay unit) 1, a write pointer P 1 for designating a write address of input data to the data RAM 1, and a read pointer P 2 for designating an address of input data or delay data to be read when performing a product-sum operation for each tap A multiplier register 5 that holds the read input data or delay data, a coefficient pointer P3 that specifies the address of the filter coefficient to be read from the coefficient memory 2 when performing a product-sum operation for each tap, and holds the read filter coefficient Multiplicand register 6 and product-sum calculator (multiplier 3, adder 4, result register 7) And it is made of. The initial value of the coefficient pointer P3 is set based on the value of the write pointer P1 of the input data.
[0048]
Next, the correspondence of each pointer in the configuration of the data RAM 1 and the configuration of the coefficient memory 2 in the digital filter according to the first embodiment of the present invention will be described with reference to FIG.
[0049]
FIG. 2 is a diagram showing a configuration of a ring buffer type data RAM 1 and a coefficient memory 2 in the digital filter according to the first embodiment of the present invention. Here, the data RAM 1 is composed of (p + 1) buffers in which the delay buffer corresponding to the delay number p and the input data buffer are combined as in the prior art, and the coefficient memory 2 is the same number as the data RAM (number of taps (p + 1)). Tap coefficient arrays a0, a1, a2,. . . It is composed of an array in which ap-1 and ap are repeated twice and only the leading a0 is removed.
[0050]
Here, P1 is a position indicated by a write pointer P1 indicating an address when input data is written to the ring buffer. Similarly, P2 is the position indicated by the read pointer P2 indicating the address of the delay data read when performing the product-sum operation for each tap. P3 is a position indicated by a coefficient pointer P3 indicating a filter coefficient to be read in the product-sum operation for each tap. The write pointer P1 is updated to the X1 side every time input data is written. The read pointer P2 always starts from the buffer position at the extreme end of the X1 side at the start of the product-sum operation, and indicates the buffer position where the data to be multiplied and updated to the X2 side is stored every product-sum operation. The X2 side end position is shown at the end of the calculation.
[0051]
The coefficient pointer P3 starts from the index position from the coefficient memory head Y1 corresponding to the index value from the data RAM head X2 of the current write pointer P1 (in FIG. 2, since P1 is third from X2, P3 starts from Y1. The position of the tap coefficient used for the product-sum operation for each tap is updated to the Y2 side every product-sum operation.
[0052]
Next, the operation of the digital filter according to the first embodiment of the present invention will be described in detail with reference to the flowcharts of FIGS.
[0053]
When data is input to the digital filter of the digital filter according to the first embodiment of the present invention, first, the accumulation register (result register 7) is cleared to 0 (step S101 in FIG. 3).
[0054]
Next, the input data D1 is written at the position indicated by the write pointer P1 (step S102).
[0055]
Further, the read pointer P2 is initialized to a value indicating the end position (X1 side end buffer) of the data RAM (step S103). Next, the coefficient pointer P3 is set to a position shifted from the end position on the Y1 side by the index value from the X2 side of the current write pointer P1 (step S104).
[0056]
Next, data is read from the position of the read pointer P2 and set in the multiplier register 5 (step S105). Further, the filter coefficient is read from the position of the coefficient pointer P3 and set in the multiplicand register (step S106).
[0057]
Next, the result of multiplying the data of the multiplier register 5 by the coefficient of the multiplicand register 6 and adding the contents of the result register is stored in the accumulation register (result register 7) (step S107).
[0058]
The read pointer P2 is updated to indicate the buffer position adjacent to the X2 side (step S108), and similarly, the coefficient pointer P3 is also updated to indicate the coefficient position adjacent to the Y2 side (step S109).
[0059]
The processing from step S105 to step S109 is repeated several taps (step S110). After the product-sum operation for all taps is completed, the contents of the result register 7 as the filter processing result are output (step S111).
[0060]
Next, after updating the write pointer P1 to the X1 side (step S112), the updated write pointer P1 is confirmed (step S113). If the updated write pointer P1 exceeds the end X1 of the ring buffer, the The pointer P1 is reset to the ring buffer head position (step S114). When the next data is input, the filtering process is performed again from step S101.
[0061]
Next, a description will be given with reference to specific examples.
[0062]
A filter having 6 taps (5 delays) will be described as an example. FIG. 4 shows a filter associated with the input of the first data, the third data, the sixth data, and the ninth data among the time-series input data to the digital filter according to the first embodiment of the present invention. It is explanatory drawing which shows the content of the data RAM at the time of the product-sum operation loop start of a process, the position of the write pointer P1, the start position of the read pointer P2, and the start position of the coefficient pointer P3.
[0063]
As an initial state, all the buffers of the data RAM 1 are cleared to 0, and the write pointer P1 indicates the X2 side endmost buffer that is the head of the data RAM.
[0064]
First, when the first data D1 of time series input data is input, the accumulation register (result register 7) is cleared to 0 (step S101), and then the position indicated by the write pointer P1 (P1 in FIG. 4 (1)). The input data D1 is written at the position (step S102).
[0065]
Next, the read pointer P2 is initialized to a value indicating the end position (X1-side end buffer) of the data RAM (step S103). Next, the coefficient pointer P3 is set to a position shifted from the end position on the Y1 side by the index value from the X2 side of the current write pointer P1 (step S104). Here, since the write pointer P1 is first from the X2 side, the initial value of the coefficient pointer P3 is the first position from the Y1 side. The contents of the data RAM, the position of the write pointer P1, the start position of the read pointer P2, and the start position of the coefficient pointer P3 at this time are shown in FIG.
[0066]
Next, data is read from the position of the read pointer P2 and set in the multiplier register 5 (step S105). Further, the filter coefficient is read from the position of the coefficient pointer P3 and set in the multiplicand register (step S106).
[0067]
Next, the result of multiplying the data of the multiplier register 5 by the coefficient of the multiplicand register 6 and adding the contents of the result register is stored in the accumulation register (result register 7) (step S107). The read pointer P2 is updated to indicate the buffer position adjacent to the X2 side (step S108), and similarly, the coefficient pointer P3 is also updated to indicate the coefficient position adjacent to the Y2 side (step S109).
[0068]
The processing from step S105 to step S109 is repeated 6 times (step S110), and after the product-sum operation for all the taps is completed, the contents of the result register 7 as the filter processing result are output (step S111). Next, the write pointer P1 is updated to the X1 side (step S112), and the write pointer indicates the second buffer from the X2 side. Next, the updated write pointer P1 is confirmed (step S113), and since it does not exceed the end X1 of the ring buffer, the filtering process associated with the input of the head data D1 is completed. When the next data is input, the filtering process is performed again from step S101.
[0069]
Similarly, the contents of the data RAM, the position of the write pointer P1, the start position of the read pointer P2, and the start position of the coefficient pointer P3 at the end of step S104 in the filtering process accompanying the input of the third input data D3. Is shown in (2) of FIG. The start position of the coefficient pointer P3 is a position indicating the third coefficient from the Y1 side because the write pointer P1 indicates the third buffer from the X2 side.
[0070]
Similarly, the contents of the data RAM, the position of the write pointer P1, the start position of the read pointer P2, and the start position of the coefficient pointer P3 in the filtering process accompanying the input of the sixth input data D6 at the end of step S104. (3) of FIG. 4 shows the contents of the data RAM, the position of the write pointer P1, the start position of the read pointer P2 at the end of step S104 in the filtering process accompanying the input of the ninth input data D9, and The start position of the coefficient pointer P3 is shown in (4) of FIG.
[0071]
As described above, at the time of data storage, the data storage position is designated by the write pointer P1. That is, the write pointer P1 first designates the endmost buffer on the X2 side of the data RAM1. Next, the write pointer P1 designates a buffer adjacent to the X2 side end buffer of the data RAM 11 in the X1 direction. Thereafter, the write pointer P1 is sequentially shifted in the X1 direction to sequentially specify the buffers. Then, after designating the buffer at the extreme end in the X1 direction, the buffer at the extreme end in the X2 direction is designated, and then the shift in the X1 direction is performed. In FIG. 2, the write pointer P1 currently designates the third buffer from the end on the X2 side. Thereby, the data Dn is stored in the third buffer from the X2 side.
[0072]
On the other hand, data reading in the product-sum operation loop starts from the end position of the ring buffer, and when the product-sum operation for the number of taps is finished, the read pointer P2 always indicates the head position of the ring buffer. There is no crossing.
[0073]
Further, the filter coefficient read pointer P3 does not exceed the end of the coefficient memory when the product-sum operation for the number of taps is started from the position corresponding to P1.
[0074]
As described above, according to the digital filter of the present invention, since the data read pointer P2 and the coefficient pointer P3 do not cross the buffer boundary, it is not necessary to check the end of the pointer in the product-sum operation loop. It is possible to reduce the number of execution steps and improve the processing speed with respect to the conventional digital filter processing of the ring buffer format. As a result, the power consumption can be reduced by reducing the operation clock frequency.
[0075]
Next, another embodiment of the present invention will be described in detail with reference to the drawings.
[0076]
FIG. 5 shows the configuration of a data RAM and a coefficient memory using a digital filter according to the second embodiment of the present invention, taking a filter with 6 taps (5 delays) as an example.
[0077]
The digital filter according to the second embodiment of the present invention is the same as the first embodiment of the present invention shown in FIGS. 1 to 4 except for the configuration of the coefficient memory and the start position of the coefficient pointer P3 associated therewith. This is the same as the digital filter. The same reference numerals are assigned to the same components.
[0078]
Of the time-series input data to the digital filter according to the second embodiment of the present invention, the product sum of the filter processing accompanying the input of the first data, the fifth data, the sixth data, and the ninth data FIG. 5 shows the contents of the data RAM, the position of the write pointer P1, the start position of the read pointer P2, and the start position of the coefficient pointer P3 at the start of the calculation loop.
[0079]
The coefficient memory of the digital filter according to the first embodiment of the present invention includes tap coefficient arrays a0, a1, a2,. . . Whereas ap-1 and ap are repeated twice to remove the leading a0, the digital filter coefficient memory according to the second embodiment of the present invention has tap coefficient arrays a0, a1, a2 ,. . . Ap-1 and ap are repeated twice and consist of a sequence excluding only the final ap.
[0080]
Also, the start position of the coefficient pointer P3 at the start of the product-sum operation loop in the digital filter of the second embodiment of the present invention is the current position from the start position of Y1 in the digital filter of the first embodiment of the present invention. In contrast, in the digital filter according to the second embodiment of the present invention, the write pointer P1 is shifted from the X2 side of the current write pointer P1. Is set to a position shifted by plus one.
[0081]
As shown in FIG. 5C, when the write pointer P1 is the end position of the ring buffer, the start position of the coefficient pointer P3 at the start of the product-sum operation loop is the current write from the start position of Y1. The index value from the X2 side of the pointer P1 is set not at the position shifted by plus 1, but at the head position of the coefficient memory.
[0082]
As shown in the digital filter of the second embodiment of the present invention, the coefficient memory is divided into tap coefficient arrays a0, a1, a2,. . . Even when ap-1 and ap are repeated twice and only the final ap is removed, the effect is the same as that of the digital filter of the first embodiment of the present invention.
[0083]
Next, a digital filter according to a third embodiment of the present invention will be described in detail with reference to the drawings.
[0084]
FIG. 6 is a flowchart of the coefficient memory expansion process of the digital filter according to the digital filter of the third embodiment of the present invention. In the digital filter according to the third embodiment of the present invention, the coefficient memory in the initial state of the system has tap coefficient arrays a0, a1, a2,. . . When the actual filter processing is started only by ap-1 and ap, the coefficient memory is expanded in advance by the procedure shown in FIG. 6, and the digital filter of the first embodiment of the present invention Similarly, the filtering process can be performed. When the filtering process is not performed, the coefficient memory area corresponding to the number of delays increased by the expansion of the coefficient memory can be used as a memory area for other applications. Thereby, the digital filter of the present invention can be realized even in a system with a small memory capacity.
[0085]
【The invention's effect】
As described above, the first effect of the present invention is that the digital filter processing of the present invention does not require pointer management (check) in the product-sum operation loop processing, compared to the conventional digital filter processing of the ring buffer format. Therefore, it is possible to shorten the filter processing time and speed up the system. Thereby, it is possible to reduce power consumption by reducing the number of operating clocks.
[0086]
The reason is that the filter coefficient RAM is expanded compared to the conventional digital filter of the ring buffer format, and the sum-of-products calculation process starts from the beginning (or end) of the ring buffer and ends in the number of taps. This is because the end of the line is not exceeded.
[0087]
Specifically, for example, in a general-purpose microcomputer, the processing for one data input with a conventional ring buffer digital filter requires approximately (10 × p + 9) steps, whereas according to the present invention ( 7 × p + 10) steps are sufficient. If this is converted to a ratio, the processing time can be reduced to about 70% of the conventional time.
[0088]
In the filtering process, input data is processed at equal time intervals. Therefore, since the filter processing time can be shortened, the execution time of applications other than the filter processing can be increased. Also, by shortening the filter processing time, even if the operation clock is slowed down, the filter processing at the unit time interval is in time, so that the number of operation clocks can be reduced and power consumption can be reduced.
[0089]
The second effect is that the digital data in which pointer management (checking) is not required by using a buffer (delay element) array of a total number (n + p) of a finite input data number n and a delay number p as a conventional data RAM. In contrast to the filter processing, the present invention is to reduce the memory size required by reducing the number of memories that are increased for speeding up the digital filter processing to the number of delays p, thereby reducing the circuit scale. .
[0090]
The reason is that the number of taps of the FIR type digital filter is generally sufficiently smaller than the number of input data.
[0091]
For example, the number of filter taps used in an MP3 decoder, which is an audio codec technique, is about 22 to 512. On the other hand, the number of data is about 450,000 in the case of stereo data for 10 seconds at a sampling frequency of 22 KHz. In order to process this with a digital filter using a conventional (n + p) buffer (delay element) array of the total number of input data n and delay number p, a memory of about 440K words is required. In the digital filter of the present invention, the memory can be reduced to about 1.5K words.
[Brief description of the drawings]
FIG. 1 is a block diagram of a digital filter according to a first embodiment of this invention.
FIG. 2 is a configuration diagram of a data RAM and a coefficient memory described in FIG. 1;
FIG. 3 is a digital filter processing flow according to the first embodiment of this invention;
FIG. 4 is an explanatory diagram of pointer positions in the digital filter according to the first embodiment of this invention.
FIG. 5 is a block diagram of a digital filter according to a second embodiment of this invention.
FIG. 6 is a flow of coefficient memory expansion processing in the digital filter according to the third embodiment of the present invention.
FIG. 7 is a conceptual diagram of an FIR type digital filter.
FIG. 8 is a block diagram of a first conventional digital filter.
FIG. 9 is a configuration diagram of a data RAM and a coefficient memory in the first conventional digital filter.
FIG. 10 is a processing flow of a digital filter in the first conventional digital filter.
FIG. 11 is a configuration diagram of a data RAM and a coefficient memory in a second conventional digital filter.
FIG. 12 is a processing flow of a digital filter in a second conventional digital filter.
[Explanation of symbols]
1,11,21 Data RAM (delay device)
2,12,22 Coefficient memory
3,13 multiplier
4,14 Adder
5,15 multiplier register
6,16 Multiplicand register
7,17 Result register
P1 write pointer
P2 read pointer
P3 coefficient memory pointer

Claims (10)

積和演算器を有し、入力データおよび既に入力データとして受け取ったn(n>0)個の遅延データと、前記入力データおよび前記n個の遅延データにそれぞれ対応するn+1個のフィルタ係数との乗算を行い前記乗算した結果の和をとる積和演算を実行することによってフィルタ動作をするデジタルフィルタであって、
前記n+1個のフィルタ係数を2回繰り返したものから、先頭のフィルタ係数または最終のフィルタ係数を削除した2n+1個のフィルタ係数が格納される2n+1個のバッファからなる第1の配列を有する係数メモリと、
前記繰り返し格納されたn+1個のフィルタ係数の順序にて、前記繰り返したn+1個のフィルタ係数にそれぞれ対応する前記入力データおよび前記n個の遅延データが格納されるn+1個のバッファからなる第2の配列を有するデータRAMと、
前記データRAMへの前記入力データの書き込みアドレスを、前記第2の配列を構成する所定のバッファに指定し、前記入力データの書き込みに応じて更新する書き込みポインタと、
前記積和演算を実行する際の前記データRAMから読み出す前記入力データまたは前記遅延データのアドレスを、前記フィルタ動作を開始するときの初期値として前記第2の配列の一端を構成するバッファに指定し、前記積和演算の実行毎に行う前記入力データまたは前記遅延データの読み出しに応じて更新する読み出しポインタと、
前記積和演算を実行する際の前記係数メモリから読み出す前記フィルタ係数のアドレスを、前記フィルタ動作を開始するときの初期値として前記書き込みポインタが指定する前記第2の配列の他端を構成するバッファからの位置に基づいて設定し、前記積和演算の実行毎に行う前記フィルタ係数の読み出しに応じて更新する係数ポインタと、
を備えるデジタルフィルタ。
A sum-of-products calculator, and input data and n (n> 0) delay data already received as input data, and n + 1 filter coefficients respectively corresponding to the input data and the n delay data A digital filter that performs a filter operation by performing a multiply-accumulate operation that performs multiplication and takes the sum of the multiplication results,
A coefficient memory having a first array of 2n + 1 buffers for storing 2n + 1 filter coefficients obtained by deleting the first filter coefficient or the last filter coefficient from the n + 1 filter coefficients repeated twice; ,
A second sequence comprising n + 1 buffers in which the input data and n delay data respectively corresponding to the repeated n + 1 filter coefficients are stored in the order of the repeatedly stored n + 1 filter coefficients. A data RAM having an array;
A write pointer that designates a write address of the input data to the data RAM in a predetermined buffer that constitutes the second array, and is updated in accordance with the write of the input data;
The address of the input data or the delayed data read out from the data RAM when executing the multiply-accumulate operation is designated as a buffer constituting one end of the second array as an initial value when the filter operation is started. A read pointer that is updated in response to the reading of the input data or the delayed data performed each time the multiply-accumulate operation is performed;
A buffer constituting the other end of the second array in which the address of the filter coefficient to be read from the coefficient memory at the time of executing the product-sum operation is designated by the write pointer as an initial value when starting the filter operation A coefficient pointer that is set based on the position from and updated in response to the reading of the filter coefficient performed each time the product-sum operation is performed
Digital filter with
前記積和演算器は、乗算器および加算器を備える請求項1記載のデジタルフィルタ。    The digital filter according to claim 1, wherein the product-sum calculator includes a multiplier and an adder. 前記積和演算器は、前記加算器の結果を保持する結果レジスタを備える請求項2記載のデジタルフィルタ。    The digital filter according to claim 2, wherein the product-sum calculator includes a result register that holds a result of the adder. 読み出した前記入力データまたは前記遅延データを保持する乗数レジスタを備える請求項1記載のデジタルフィルタ。    The digital filter according to claim 1, further comprising a multiplier register that holds the read input data or delay data. 読み出した前記フィルタ係数を保持する被乗数レジスタを備える請求項1記載のデジタルフィルタ。    The digital filter according to claim 1, further comprising a multiplicand register that holds the read filter coefficient. 前記係数メモリは、前記n+1個のフィルタ係数を2回繰り返したものから、前記先頭のフィルタ係数を削除した2n+1個のフィルタ係数が格納される2n+1個のバッファからなる第1の配列を有し、前記係数ポインタの前記フィルタ動作を開始するときの初期値である前記第1の配列の一端を構成するバッファからの位置は、前記書き込みポインタが指定する前記第2の配列の前記他端を構成するバッファからの位置と、同じである請求項1に記載のデジタルフィルタ。 The coefficient memory has a first array composed of 2n + 1 buffers in which 2n + 1 filter coefficients obtained by deleting the head filter coefficient are stored from a repetition of the n + 1 filter coefficients twice. The position from the buffer constituting one end of the first array, which is an initial value when the filter operation of the coefficient pointer is started, constitutes the other end of the second array designated by the write pointer. The digital filter according to claim 1, wherein the position is the same as the position from the buffer. 前記第2の配列を有するデータRAMは、リングバッファ形式である請求項1に記載のデジタルフィルタ。    The digital filter according to claim 1, wherein the data RAM having the second array is in a ring buffer format. 前記デジタルフィルタは、FIR型である請求項1記載のデジタルフィルタ。    The digital filter according to claim 1, wherein the digital filter is an FIR type. 入力データおよび既に入力データとして受け取ったn(n>0)個の遅延データと、前記入力データおよび前記n個の遅延データにそれぞれ対応するn+1個のフィルタ係数との乗算を行い前記乗算した結果の和をとる積和演算を実行することによってフィルタ動作をするデジタルフィルタの処理方法であって、
n+1個のバッファへの前記入力データの書き込み位置を指定する書き込みポインタを所定の位置に設定する工程と、
前記書き込みポインタが指定するバッファに対して、前記入力データの書き込みを行う工程と、
前記フィルタ動作を開始する際に、前記n+1個のバッファから前記入力
データおよび前記遅延データを読み出す際の読み出し位置を指定する読み出しポインタの初期値を前記n+1個のバッファの一端に設定する工程と、
前記フィルタ動作を開始するときに、前記n+1個のバッファに格納された前記入力データおよび前記n個の遅延データの格納順序にて前記入力データおよび前記n個の遅延データに対応する前記n+1個のフィルタ係数を2回繰り返したものから先頭のフィルタ係数または最終のフィルタ係数を削除した2n+1個のフィルタ係数が格納された2n+1個のバッファから前記フィルタ係数を読み出す際の読み出し位置を指定する係数ポインタの初期値を前記書き込みポインタが指定する前記n+1個のバッファの他端からの位置に基づいて設定する工程と、
前記読み出しポインタの指定に基づいて前記入力データまたは前記遅延データを読み出す工程と、
前記係数ポインタの指定に基づいて前記フィルタ係数を読み出す工程と、
前記入力データまたは前記遅延データを読み出す工程によって読み出した前記入力データまたは前記遅延データと、前記フィルタ係数を読み出す工程によって読み出した前記フィルタ係数とに基づいて前記積和演算を実行する工程と、
を有することを特徴とするデジタルフィルタの処理方法。
The input data and n (n> 0) delay data already received as input data are multiplied by n + 1 filter coefficients corresponding to the input data and the n delay data, respectively. A digital filter processing method that performs a filter operation by executing a multiply-accumulate operation that takes a sum,
setting a write pointer for designating a write position of the input data to n + 1 buffers to a predetermined position;
Writing the input data to the buffer specified by the write pointer;
When starting the filtering operation, setting an initial value of a read pointer for designating a read position when reading the input data and the delayed data from the n + 1 buffers at one end of the n + 1 buffers;
When starting the filtering operation, the input data stored in the n + 1 buffers and the n + 1 delay data corresponding to the n delay data are stored in the storage order of the n delay data. A coefficient pointer for designating a reading position when reading the filter coefficient from 2n + 1 buffers storing 2n + 1 filter coefficients obtained by deleting the first filter coefficient or the last filter coefficient from the one obtained by repeating the filter coefficient twice Setting an initial value based on a position from the other end of the n + 1 buffers designated by the write pointer;
Reading the input data or the delay data based on the designation of the read pointer;
Reading the filter coefficient based on the specification of the coefficient pointer;
Executing the product-sum operation based on the input data or the delay data read by the step of reading the input data or the delay data, and the filter coefficient read by the step of reading the filter coefficient;
A method for processing a digital filter, comprising:
前記積和演算を実行する工程後に、前記読み出しポインタが現在指定しているバッファの隣のバッファに前記読み出しポインタの指定先を更新する工程と、
前記係数ポインタが現在指定しているバッファの隣のバッファに前記係数ポインタの指定先を更新する工程と、
前記n+1個のフィルタ係数の全てについて前記積和演算を実行したか否かを判定する工程と、
をさらに有し
記積和演算を実行したか否かを判定する工程において、前記n+1個のフィルタ係数の全てについて前記積和演算を実行した場合には、前記書き込みポインタが現在指定しているバッファの隣のバッファに前記書き込みポインタの指定先を更新する工程と、
前記前記積和演算を実行したか否かを判定する工程において、前記n+1個のフィルタ係数の全てについて前記積和演算を実行していない場合には、前記入力データまたは前記遅延データを読み出す工程と、
前記フィルタ係数を読み出す工程と、
前記積和演算を実行する工程と、
前記読み出しポインタの指定先を更新する工程と、
前記係数ポインタの指定先を更新する工程と、
前記積和演算を実行したか否かを判定する工程と、
を再度実行すること特徴とする請求項記載のデジタルフィルタの処理方法。
After the step of performing the multiply-accumulate operation, updating the designation destination of the read pointer in a buffer adjacent to the buffer currently designated by the read pointer;
Updating the designated destination of the coefficient pointer in a buffer next to the buffer currently designated by the coefficient pointer;
Determining whether the sum-of-products operation has been performed for all of the n + 1 filter coefficients;
Further comprising a,
In determining whether to perform a pre Kisekiwa operation, when performing the product-sum operation for all the (n + 1) filter coefficients, next to the buffer in which the write pointer is currently designated Updating a designated destination of the write pointer in a buffer;
In the step of determining whether or not the product-sum operation has been executed, when the product-sum operation has not been executed for all of the n + 1 filter coefficients, the step of reading the input data or the delay data; ,
Reading the filter coefficients;
Performing the product-sum operation;
Updating the designation of the read pointer;
Updating the designated destination of the coefficient pointer;
Determining whether the product-sum operation has been performed;
10. The digital filter processing method according to claim 9, wherein the processing is executed again.
JP2001124747A 2001-04-23 2001-04-23 Digital filter and processing method thereof Expired - Fee Related JP3880807B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001124747A JP3880807B2 (en) 2001-04-23 2001-04-23 Digital filter and processing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001124747A JP3880807B2 (en) 2001-04-23 2001-04-23 Digital filter and processing method thereof

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2006251268A Division JP4464380B2 (en) 2006-09-15 2006-09-15 Digital filter

Publications (2)

Publication Number Publication Date
JP2002319844A JP2002319844A (en) 2002-10-31
JP3880807B2 true JP3880807B2 (en) 2007-02-14

Family

ID=18974082

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001124747A Expired - Fee Related JP3880807B2 (en) 2001-04-23 2001-04-23 Digital filter and processing method thereof

Country Status (1)

Country Link
JP (1) JP3880807B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004214827A (en) * 2002-12-27 2004-07-29 Sony Corp Sampling rate conversion apparatus and method thereof, and audio apparatus
JP2007267204A (en) * 2006-03-29 2007-10-11 Sanyo Electric Co Ltd Filter device
JP6249029B2 (en) * 2016-03-08 2017-12-20 Nttエレクトロニクス株式会社 Data phase tracking device, data phase tracking method, and communication device

Also Published As

Publication number Publication date
JP2002319844A (en) 2002-10-31

Similar Documents

Publication Publication Date Title
US6279021B1 (en) Digital filters
US6510445B2 (en) Digital filters
US7587577B2 (en) Pipelined access by FFT and filter units in co-processor and system bus slave to memory blocks via switch coupling based on control register content
CN110492867B (en) Interpolation filter system realized by digital circuit
JP2009507423A (en) Programmable digital filter configuration of shared memory and shared multiplier
JPH10187438A (en) Method for reducing transition to input of multiplier
AU2013223996B2 (en) Low delay real-to-complex conversion in overlapping filter banks for partially complex processing
KR100907961B1 (en) Digital filter
JP4464380B2 (en) Digital filter
JP3880807B2 (en) Digital filter and processing method thereof
EP1039635B1 (en) Multi channel filtering device and method
JP2733403B2 (en) Digital filter for decimation
WO2013183096A1 (en) Multi-stage filter processing device and method
JP3071765B2 (en) Digital filter and digital filter processing method for filtering finite number of input data
JPH0127463B2 (en)
US6314132B1 (en) Microprocessor structure and method for implementing digital filter operations
JPH06216715A (en) Digital filter
JP3428334B2 (en) Digital signal processor
Gay-Bellile et al. Architecture of a programmable FIR filter co-processor
JP2000293357A (en) Microprocessor
JPH06216716A (en) Digital filter
JP2012085177A (en) Decimator circuit, and operation method for decimator circuit
JPH11220358A (en) Digital filter
JP2005149517A (en) Product-sum computing element
JP2010011493A (en) Digital filter

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041201

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050524

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050725

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20060308

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060718

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060915

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061108

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20091117

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20101117

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20101117

Year of fee payment: 4

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

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

Free format text: PAYMENT UNTIL: 20101117

Year of fee payment: 4

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

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20111117

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20121117

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20121117

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20131117

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees