JP4385893B2 - Coefficient interpolation circuit in data processing circuit - Google Patents
Coefficient interpolation circuit in data processing circuit Download PDFInfo
- Publication number
- JP4385893B2 JP4385893B2 JP2004240707A JP2004240707A JP4385893B2 JP 4385893 B2 JP4385893 B2 JP 4385893B2 JP 2004240707 A JP2004240707 A JP 2004240707A JP 2004240707 A JP2004240707 A JP 2004240707A JP 4385893 B2 JP4385893 B2 JP 4385893B2
- Authority
- JP
- Japan
- Prior art keywords
- coefficient
- output
- program
- new
- circuit
- 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
Links
Images
Description
本発明は、ディジタル楽音信号の生成等に用いて好適なデータ処理回路における係数補間回路に関する。 The present invention relates to a coefficient interpolation circuit in a data processing circuit suitable for use in generating a digital musical tone signal.
楽音信号をディジタル技術によって生成する場合、音源回路によって生成したディジタル楽音信号(PCM(Pulse Code Moduration)データ)や、外部から受けたPCMデータを効果付与回路へ入力し、この効果付与回路においてエフェクト(効果)や立体音響効果を付与することが行われる。この効果付与回路は、FIRフィルタやIIRフィルタ等の複数のディジタルフィルタを有して構成され、通常、各フィルタはDSP(ディジタルシグナルプロセッサ)によって構成される。 When a musical sound signal is generated by digital technology, a digital musical sound signal (PCM (Pulse Code Moduration) data) generated by a tone generator circuit or PCM data received from the outside is input to an effect applying circuit, and an effect ( Effect) and a stereophonic effect. This effect applying circuit is configured to include a plurality of digital filters such as an FIR filter and an IIR filter, and each filter is generally configured by a DSP (digital signal processor).
DSPは、周知のように、内部にプログラムRAM(ランダムアクセスメモリ)、係数RAM、楽音データが一時記憶されるデータRAM、演算回路等を有し、プログラムRAM内のプログラムに基づいてデータRAMから楽音データが読み出され、その楽音データに対し演算回路において、プログラムRAMから読み出されたプログラムおよび係数RAMから読み出された係数に基づいてフィルタ演算が行われる。そして、その演算結果が次段のDAC(ディジタル/アナログコンバータ)によってアナログ信号に変換され、スピーカへ出力される。 As is well known, the DSP has a program RAM (random access memory), a coefficient RAM, a data RAM in which musical tone data is temporarily stored, an arithmetic circuit, and the like, and from the data RAM based on a program in the program RAM. Data is read out, and a filter operation is performed on the musical tone data based on the program read from the program RAM and the coefficient read from the coefficient RAM in the arithmetic circuit. Then, the calculation result is converted into an analog signal by a next-stage DAC (digital / analog converter) and output to a speaker.
なお、本願に関わる従来の技術文献として特許文献1〜3が知られている。
ところで、DSPにおけるPCMデータの処理においては、多彩な楽音を生成するため、上述した演算回路の係数をしばしば変化させる。この処理は、外部のCPU(中央処理装置)から出力される係数によって上記の係数RAMを書き換えることによって行われる。しかし、係数RAMをいきなり書き換えると、PCMデータにノイズが乗ってしまう場合がある。そこで、係数RAMを2個設け、書き換えるべき係数を第2の係数RAMに書き込み、現在使用されている第1の係数RAMの係数から第2の係数RAMの係数へ徐々に係数を変化させる係数補間回路が設けられる。しかし、係数変更においては、係数補間回路によって徐々に係数を変化させることが好ましくなく、係数変更を即座に演算に反映させたい場合もある。
また、従来使用されていた乗算器を用いた係数補間回路は回路規模が大きくなる問題があった。
By the way, in the processing of PCM data in the DSP, in order to generate a variety of musical sounds, the coefficient of the arithmetic circuit described above is often changed. This process is performed by rewriting the coefficient RAM with coefficients output from an external CPU (central processing unit). However, if the coefficient RAM is rewritten suddenly, noise may be added to the PCM data. Therefore, two coefficient RAMs are provided, the coefficient to be rewritten is written in the second coefficient RAM, and coefficient interpolation is performed to gradually change the coefficient from the coefficient of the first coefficient RAM currently used to the coefficient of the second coefficient RAM. A circuit is provided. However, in the coefficient change, it is not preferable to gradually change the coefficient by the coefficient interpolation circuit, and there are cases where it is desired to immediately reflect the coefficient change in the calculation.
In addition, the coefficient interpolation circuit using a multiplier conventionally used has a problem that the circuit scale becomes large.
本発明は上記事情を考慮してなされたもので、その目的は、構成が簡単で、しかも係数補間を行う/行わないを選択することができるデータ処理回路における係数補間回路を提供することにある。 The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a coefficient interpolation circuit in a data processing circuit that has a simple configuration and can select whether or not to perform coefficient interpolation. .
この発明は上記の課題を解決するためになされたもので、本発明は、外部の制御装置から出力されたプログラムが記憶されたプログラムメモリと、外部の制御装置から出力された係数が記憶された係数メモリと、プログラムカウンタから出力されるアドレスデータに従って、前記プログラムメモリ内のプログラムおよび前記係数メモリ内の係数を順次読み出し、前記プログラムおよび前記係数に従って動作する演算回路とを具備するデータ処理回路において、外部の制御装置から前記係数の変更を指示されると、変更後の新係数が記憶される新係数メモリと、外部の制御装置から前記係数の変更を指示されると、変更前の旧係数が記憶される中間係数メモリと、前記中間係数メモリ内の旧係数から前記新係数メモリ内の新係数に向かって順次変化する係数を生成する係数生成手段と、前記プログラムには係数補間を指示するか否かを示す補間制御情報が含まれており、前記プログラムメモリから読み出されたプログラムに含まれる補間制御情報が係数補間を指示している時は前記係数生成手段の出力を前記演算回路へ出力し、前記補間制御情報が係数補間を指示していない時は前記新係数メモリから読み出される係数を前記演算回路へ出力する選択手段と、を具備し、前記係数生成手段は、前記新係数メモリから読み出された新係数を所定ビット下位方向へシフトしたデータから、前記中間係数メモリから読み出された変更前の旧係数を前記所定ビット下位方向へシフトしたデータを減算する減算手段と、前記減算手段の出力と前記中間係数メモリの出力を加算する加算手段と、前記加算手段の出力を前記中間係数メモリへ書き込む書込手段と、前記減算手段の出力の大きさに対応してビット数N(Nは正の整数)を決定する決定手段を有しており、前記新係数メモリの出力の上位Nビットのデータと前記加算手段の出力の上位Nビットのデータが一致した時、補間終了と判定する終了判定手段と、を具備し、前記選択手段は、前記終了判定手段にて補間終了と判定した時、前記新係数メモリから読み出される係数を前記演算回路へ出力することを特徴とするデータ処理回路における係数補間回路である。 The present invention has been made to solve the above problems, and the present invention stores a program memory storing a program output from an external control device and a coefficient output from the external control device. In a data processing circuit comprising a coefficient memory and an arithmetic circuit that sequentially reads out a program in the program memory and a coefficient in the coefficient memory in accordance with address data output from a program counter, and operates according to the program and the coefficient. When an external control device is instructed to change the coefficient, a new coefficient memory in which the new coefficient after the change is stored, and when an external control device is instructed to change the coefficient, the old coefficient before the change is The stored intermediate coefficient memory, and sequentially from the old coefficient in the intermediate coefficient memory to the new coefficient in the new coefficient memory Coefficient generating means for generating a coefficient to be converted and interpolation control information indicating whether or not to instruct coefficient interpolation is included in the program, and the interpolation control information included in the program read from the program memory is When coefficient interpolation is instructed, the output of the coefficient generation means is output to the arithmetic circuit, and when the interpolation control information does not instruct coefficient interpolation, the coefficient read from the new coefficient memory is output to the arithmetic circuit. Selecting means for outputting, the coefficient generating means from the data obtained by shifting the new coefficient read from the new coefficient memory in a predetermined bit lower direction before the change read from the intermediate coefficient memory A subtracting means for subtracting data obtained by shifting the old coefficient in the lower direction of the predetermined bit; an adding means for adding the output of the subtracting means and the output of the intermediate coefficient memory; Writing means for writing the output of the adding means into the intermediate coefficient memory; and determining means for determining the number of bits N (N is a positive integer) corresponding to the magnitude of the output of the subtracting means, And an end determination means for determining that the interpolation is completed when the upper N bits of the output of the new coefficient memory coincide with the upper N bits of the output of the addition means, and the selection means includes the end determination The coefficient interpolation circuit in the data processing circuit outputs the coefficient read from the new coefficient memory to the arithmetic circuit when it is determined by the means that the interpolation is completed .
請求項2に記載の発明は、上記係数補間回路において、前記減算手段は、前記減算の結果が零であることを示すとき、前記新係数メモリから読み出した新係数と前記中間係数メモリから読み出した係数とを比較し、比較の結果、前記新係数が前記係数より大きい場合は+1、前記新係数が前記係数より小さい場合は−1、を出力することを特徴とする。 According to a second aspect of the present invention, in the coefficient interpolation circuit, the subtracting means reads the new coefficient read from the new coefficient memory and the intermediate coefficient memory when the result of the subtraction indicates zero. As a result of comparison, +1 is output when the new coefficient is larger than the coefficient, and -1 is output when the new coefficient is smaller than the coefficient .
請求項1に記載の発明によれば、プログラムメモリから読み出されたプログラムが係数補間を指示している時は係数生成手段の出力を演算手段へ出力し、プログラムが係数補間を指示していない時は新係数メモリから読み出される係数を演算手段へ出力する選択手段を有しているので、係数補間を行う/行わないを自由に選択することができる効果がある。
また、請求項2に記載の発明によれば、乗算手段を用いることなく補間処理を行うことができ、これにより構成が簡単化できる効果がある。
また、請求項3に記載の発明によれば、補間終了の判定を簡単に行うことができる効果がある。
According to the first aspect of the present invention, when the program read from the program memory instructs the coefficient interpolation, the output of the coefficient generating means is output to the calculating means, and the program does not instruct the coefficient interpolation. In some cases, since the selection means for outputting the coefficient read from the new coefficient memory to the calculation means is provided, it is possible to freely select whether or not to perform the coefficient interpolation.
Further, according to the second aspect of the present invention, the interpolation process can be performed without using the multiplication means, which has the effect of simplifying the configuration.
Further, according to the third aspect of the present invention, there is an effect that it is possible to easily determine whether or not the interpolation is completed.
以下、図面を参照し、この発明の実施の形態について説明する。図1はこの発明の一実施の形態による係数補間回路を用いた楽音信号生成回路Gの構成を示すブロック図、 図2は図1に示す楽音信号生成回路Gを用いた携帯電話機の構成を示すブロック図である。図2において、符号1は回路各部を制御するCPU(中央処理装置)であり、通常の通信、通話処理を行うと共に、ゲームプログラムの処理等を行う。2はCPU1において実行されるプログラム、すなわち、通信・通話処理プログラム、ゲームプログラム、音楽再生処理プログラム等が記憶されたROM(リードオンリメモリ)である。3はデータ記憶用の不揮発性RAM(ランダムアクセスメモリ)であり、CPU1が各処理の過程においてデータを一時記憶させる。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a configuration of a musical tone signal generation circuit G using a coefficient interpolation circuit according to an embodiment of the present invention, and FIG. 2 shows a configuration of a mobile phone using the musical tone signal generation circuit G shown in FIG. It is a block diagram. In FIG. 2,
4は電話番号入力用のテンキー、各種ファンクションキー等が設けられた入力部、5は液晶表示器による表示部である。6はアンテナ7を有する通信部であり、送信データによって搬送波を変調してアンテナ7から送信し、また、アンテナ7を介して受信した着信信号を復調してCPU1または音声処理部8へ出力する。音声処理部8はマイクロフォン9から出力された音声信号をディジタルデータに変換し、さらに圧縮し送信データとして通信
部6へ出力し、また、通信部6から出力される圧縮音声データを伸張し、アナログ音声信
号に変換してスピーカ10へ出力する。楽音信号生成回路Gは、着信メロディ、ゲームの
効果音楽、鑑賞用音楽等、各種の楽音信号を生成し、スピーカ16へ出力する。
4 is an input unit provided with a numeric keypad for inputting a telephone number and various function keys , and 5 is a display unit using a liquid crystal display. A
次に、図1を参照して楽音信号生成回路Gについて詳述する。
図1において、12はCPU1からバスラインBを介して供給される各種のデータおよび制御命令が一時記憶されるバッファレジスタである。13は音源回路であり、CPU1からバッファレジスタ12を介して着信メロディ生成指令を受けて着信メロディのディジタル楽音信号(PCMデータ)を生成して出力する。また、CPU1からゲームの効果音の生成指令を受けた時は、ゲームの効果音のPCMデータを生成して出力する。DSP(データ処理回路)14は、音源回路13から出力されるディジタル楽音信号にエフェクト、立体音響効果(3D)、ワイドステレオ効果を付与してDAC(ディジタル/アナログプロセッサ)15へ出力する。DAC15はDSP14から出力されるディジタル楽音信号をアナログ楽音信号に変換し、スピーカ16へ出力する。
Next, the tone signal generation circuit G will be described in detail with reference to FIG.
In FIG. 1,
次に、DSP14において、21はデータRAMであり、音源回路13から出力されるPCMデータを一時記憶し、記憶したデータをプログラムRAM22から出力されるプログラムに従って演算回路23へ出力する。演算回路23はデータRAM21から出力されるPCMデータに、プログラムRAM22から出力されるプログラムが指定する演算を行って出力する。この場合、演算係数としてセレクタ43から出力される係数Kが用いられる。24はバッファメモリであり、演算回路23から出力されるPCMデータを一時記憶し、クロックパルスCLK1のタイミングでDAC15へ出力する。ここで、クロックパルスCLK1はPCMデータのサンプリング周波数と同じ周波数(48KHz)のクロックパルスである。
Next, in the
プログラムRAM22は、予め、エフェクト用プログラム、立体音響効果用プログラム、ワイドステレオ効果用プログラム等が各々記憶されたRAMであり、各プログラムはCPU1から出力されるプログラムによって書き換え可能である。
また、各プログラムの個々のステップはそれぞれ、データRAM21のアドレス、演算回路23への演算命令および1ビットの補正コントロール信号HCを含んでいる。
The
Each step of each program includes an address of the
このプログラムRAM22は、最大768ステップのプログラムが記憶できるもので、各ステップがプログラムカウンタ27から出力されるアドレスデータに従って順次読み出され出力される。例えば、エフェクト用プログラム、立体音響効果用プログラム、ワイドステレオ効果用プログラム等の1つまたは複数が768ステップに記憶されている。アドレス端子へ供給されるプログラムカウンタ27のカウント出力に従って、エフェクト用プログラムが読み出され、これにより、データRAM21から出力されるPCMデータにエフェクトが付与されたり、次に立体音響効果用プログラムが読み出されたり、または、ワイドステレオ効果用プログラムが読み出され、これによりPCMデータにワイドステレオ効果が付与される。プログラムカウンタ27は768進のカウンタであり、次式の周波数のクロックパルスCLK2に従って0〜767のカウント出力を繰り返し出力する。
周波数=48KHz×768=36.864MHz
The
Frequency = 48KHz × 768 = 36.864MHz
31〜34はいずれも演算回路23において使用される演算係数が記憶される係数RAMであり、係数RAM(前段)31、係数RAM(新)32、係数RAM(中間)34は各々768ワード(1ワード=16ビット)の記憶容量を有し、係数RAM(旧)33は768バイトの記憶容量を有している。ここで、係数のビット数は16であり、したがって、係数RAM(前段)31、係数RAM(新)32、係数RAM(中間)34は各々768個の係数を記憶可能であり、また、係数RAM(旧)33は768個の係数の上位8ビットが記憶可能である。また、各係数RAM31〜34のアドレス端子にはいずれもプログラムカウンタ27のカウント出力が加えられており、プログラムカウンタ27のカウント出力によって指定されるアドレスに対しデータ書き込み/読み出しが行われる。すなわち、係数RAM31〜34内の各係数は各々プログラムRAM22の各プログラムステップに対応している。
31 to 34 are coefficient RAMs for storing calculation coefficients used in the
また、係数RAM(前段)31はCPU1から出力される係数によって書き換えられ、また、係数RAM(新)32は係数RAM(前段)31から出力される係数によって書き換えられる。また、係数RAM(旧)33は係数RAM(前段)31またはセレクタ43から出力される係数によって書き換えられる。この場合、セレクタ36によって入力データの切り換えが行われる。また、係数RAM(中間)34は係数RAM(前段)31またはセレクタ43から出力される係数によって書き換えられる。この場合、セレクタ37によって入力データの切り換えが行われる。
Further, the coefficient RAM (previous stage) 31 is rewritten by the coefficient output from the
41は減算回路であり、係数RAM(新)32の出力の上位8ビットから係数RAM(旧)33の出力を減算する。42は加算回路であり、減算回路41の出力と係数RAM(中間)34の出力とを加算する。セレクタ43は係数RAM(新)32の出力または加算回路42の出力の一方を選択し、係数Kとして演算回路23へ出力する。終了判定回路44は、係数補間の終了を判定する回路である。45はオアゲートであり、終了判定回路44の出力またはアンドゲート55から出力される補間コントロール信号HCをセレクタの選択端子へ出力する。
上述した係数RAM32〜34、セレクタ36、37、減算回路41、加算回路42、セレクタ43、終了判定回路44およびオアゲート45が係数補間回路50を構成している。この係数演算回路50は係数変更の場合に、いきなり係数を変更すると、出力されるPCMデータにノイズが含まれる虞があるので、変更前の係数から変更後の係数まで、クロックパルスCLK1の最大255クロックタイムをかけて徐々に係数を変化させるための回路である。
The coefficient RAMs 32 to 34, the
51、52は各々スタートレジスタおよびエンドレジスタであり、プログラム変更時において、CPU1から出力される変更すべきプログラムのスタートアドレスおよびエンドアドレスが書き込まれる。例えば、プログラムRAM22のアドレス0〜150に記憶されているエフェクト用プログラムの書き換えが行われる時は、スタートレジスタ51に「0」が、エンドレジスタ52に「150」が書き込まれる。54は比較回路であり、プログラムカウンタ27の出力と、スタートレジスタ51、エンドレジスタ52のデータとを比較し、プログラムカウンタ27の出力がスタートレジスタ51のデータと、エンドレジスタ52のデータとの間にある場合に”1”を、それ以外の場合に”0”を出力する。
55はアンドゲート(プログラムRAM22の出力のビット数分)であり、比較回路54の出力が”1”の時は閉状態となって、データ「0(全ビット”0”)」(NOP命令)を出力し、比較回路54の出力が”0”の時は開状態となって、プログラムRAM22から出力されるプログラムステップをデータRAM21および演算回路23へ出力すると共に、プログラムステップに含まれる補間コントロール信号HCをオアゲート45へ出力する。データ「0」はNOP(No Operation)命令としてあるので、書き換え中の誤動作を防ぐことができる。(NOP命令が「0」でない場合はアンドゲート55はそのビット配列に合わせて変更する。)
55 is an AND gate (for the number of bits of the output of the program RAM 22). When the output of the
次に、上述した楽音信号生成回路Gの動作を説明する。
まず、プログラムRAM22のアドレス0〜150にエフェクト用プログラムが、アドレス151〜767に立体音響効果用プログラムが記憶されているとする。この場合、係数RAM31、32、34の各アドレス0〜150に各々、同一のエフェクト用プログラムの係数が記憶され、アドレス151〜767に各々、同一の立体音響効果用プログラムの係数が記憶されている。また、係数RAM(旧)33には係数RAM(前段)31内の各係数の上位8ビットが記憶されている。
Next, the operation of the above-described tone signal generation circuit G will be described.
First, it is assumed that an effect program is stored in
このような状態において、CPU1から、例えば着信メロディ生成指令が音源回路13へ出力されると、音源回路13が着信メロディのディジタル楽音信号(PCMデータ)を生成し、DSP14へ出力する。出力されたPCMデータはデータRAM21に一時記憶され、同時に、プログラムカウンタ27がクロックパルスCLK2のアップカウントを開始する。プログラムカウンタ27がクロックパルスCLK2によってアップカウントを行うと、プログラムRAM22からプログラムステップが順次出力され、アンドゲート55を介してデータRAM21、演算回路23およびオアゲート45へ出力される。
In this state, for example, when an incoming melody generation command is output from the
一方、プログラムカウンタ27がクロックパルスCLK2のアップカウントを行うと、係数RAM(新)32、係数RAM(旧)33および係数RAM(中間)34から係数が順次読み出され、減算回路41および加算回路42へ出力される。しかし、上述したように、係数変更がない状態では、係数RAM(新)32のデータの上位8ビットと係数RAM(旧)33のデータは同一であり、したがって、減算回路41の出力は「0」となる。この結果、加算回路42から係数RAM(中間)34の出力データが出力され、セレクタ43を介して演算回路23へ供給されると共にセレクタ37を介して係数RAM(中間)34に書き込まれる。
On the other hand, when the
このように、プログラムカウンタ27がクロックパルスCLK2によってアップカウントを行うと、データRAM21および演算回路23へプログラムRAM22から読み出されたプログラムステップが順次加えられ、また、係数RAM(中間)34から読み出された係数が係数補間回路50を介して演算回路23へ加えられる。これにより、エフェクト用プログラム、立体音響効果用プログラムが順次繰り返し実行される。また、係数RAM(中間)34から読み出された係数は再び同係数RAM34に戻され、同じアドレスに書き込まれる。したがって、係数RAM(中間)34のデータに変化はない。
As described above, when the
次に、係数変更の場合の動作を説明する。
係数変更が行われる場合、まず、CPU1が出力した変更後の係数(新係数という)が係数RAM(前段)31に書き込まれる。例えば、エフェクト用プログラムの係数変更が行われる場合は、CPU1が出力した新係数が係数RAM(前段)31のアドレス0〜150に書き込まれる。
Next, the operation for changing the coefficient will be described.
When the coefficient is changed, first, the changed coefficient (referred to as a new coefficient) output from the
また、係数RAM(新)32内の係数は、プログラムカウンタ27のカウント出力によって読み出される毎に、係数RAM(前段)31から読み出された新係数と比較器により比較され、一致していない場合は係数RAM(新)32内の係数が新係数に書き換えられる。そして、書き換えられた新係数が減算回路41へ出力される。減算回路41はこの新係数の上位8ビットから係数RAM(旧)33から出力される変更前の係数(旧係数という)の8ビットを減算する。減算結果を係数RAM(中間)34の出力(16ビット)の下位8ビットに加算器42で加算する。符号は上位ビットに拡張する。図6に具体的な構成例を示す。減算回路41は入力A(8ビット)から入力B(8ビット)を減算する。出力A−Bは符号(SIGN1ビット)が付加されて9ビットとなる(B>Aの時負の値となるため)。加算器42は入力A(16ビット)と入力B(16ビット)を加算する。入力Aには、減算器41の出力が差分データとして入力される。符号(SIGN)は入力AのMSBから8ビットに入力され、下位はそれ以下の8ビットに入力される。すなわち、加算器42の入力Aは減算器41の出力を下位方向に8ビットシフトした差分データが入力されることになる。ここで、よく知られるように、2進数を下位方向に8ビットシフトすると、その2進数を「256」で割ったことになり、したがって、新係数の上位8ビットから旧係数の上位8ビットを減算し、加算器42下位8ビット入力することは、次の差分データを加算器42の入力Aに与えることを意味している。
差分データ=(新係数−旧係数)/256・・・(1)
Each time the coefficient in the coefficient RAM (new) 32 is read by the count output of the
Difference data = (new coefficient−old coefficient) / 256 (1)
加算回路42は、係数RAM(中間)34から出力される係数に上記の差分データを加算し、次式の加算結果(中間係数という)をセレクタ43の一方の入力端へ出力する。
中間係数=旧係数+差分データ・・・(2)
ここで、プログラムRAM22から出力されるプログラムステップに含まれている補間コントロール信号HCが補間実行を指示する”1”であった場合は、この中間係数がセレクタ43から出力され、演算回路23へ加えられる。またこの時、セレクタ37が切り換えられ、セレクタ43から出力された中間係数が係数RAM(中間)34に書き込まれる。
The
Intermediate coefficient = old coefficient + difference data (2)
If the interpolation control signal HC included in the program step output from the
次に、クロックパルスCLK1の1クロック後(クロックパルスCLK2の768クロック後)、再び係数RAM(新)32から同じ新係数が読み出されると、減算回路41において上記(1)式の減算が行われ、その減算結果に係数RAM(中間)34から読み出された中間係数(旧係数+差分データ)に差分データがさらに加算され、次の中間係数が得られる。
中間係数=旧係数+2×差分データ・・・(3)
そして、この中間係数がセレクタ43を介して演算回路23へ出力されると共に、係数RAM(中間)34に書き込まれる。
Then, (after 768 clock of the clock pulse CLK2) 1 clock after the clock pulse CLK1, the same new coefficients are read from the coefficient RAM (New) 32 Again, the in the
Intermediate coefficient = old coefficient + 2 x difference data (3)
The intermediate coefficient is output to the
以下、クロックパルスCLK1の1周期が経過する毎に同様の動作が繰り返され、これにより、セレクタ43から出力される中間係数が、図3(a)に示すように、旧係数から新係数まで、クロックパルスCLK1のタイミングで、かつ、上記差分データのピッチで単調に増加(差分データが正の場合)または減少(差分データが負の場合)する。
Thereafter, the same operation is repeated every time one cycle of the clock pulse CLK1 elapses, whereby the intermediate coefficient output from the
そして、中間係数と新係数との差が上記(1)式の差分データより小になると、終了判定回路44がそれを検知し、終了信号を出力する。この終了信号が出力されると、セレクタ36、37、43が切り換えられ、係数RAM(新)32内の新係数が係数RAM(旧)33(上位8ビット)および係数RAM(中間)34に書き込まれる。一方、上記終了信号が出力される前にCPU1によって係数RAM(前段)31が書き換えられた場合は、その時点における中間係数の上位8ビットが係数RAM(旧)に書き込まれる。これにより、以後、図3(b)に示すように、その中間係数から新たな新係数(新々係数)に向かって中間係数が逐次変化する。
When the difference between the intermediate coefficient and the new coefficient becomes smaller than the difference data of the above equation (1), the
なお、上記説明は係数RAM31〜34の1つのアドレスについてであるが、他のアドレスの係数についても同様の動作が行われる。すなわち、CPU1によって新係数が、例えば、係数RAM(前段)31のアドレス0〜150に書き込まれた場合、各アドレス0〜150の新係数のそれぞれについて、上述した単調増加または減少による補間処理が行われる。
Although the above description is for one address of the coefficient RAMs 31-34, the same operation is performed for the coefficients of other addresses. That is, when a new coefficient is written by the
また、旧係数と新係数の各上位8ビットが一致していた場合は、減算回路41の減算結果(差分データ)が「0」となり、この場合、補間が進まず、補間処理が終わらない。そこで、差分データが「0」の時は、係数RAM(中間)34の中間係数と係数RAM(新)32の新係数の大小比較を行い、その結果にしたがって減算回路41の出力を、次のように、+1または−1に置き換えるようになっている。
新係数>中間係数・・・+1
新係数<中間係数・・・−1
この時、補間終了までの時間は、クロックパルスCLK1で1クロックから255クロックの範囲内で変動する。
If the upper 8 bits of the old coefficient and the new coefficient match, the subtraction result (difference data) of the
New coefficient >
New coefficient <intermediate coefficient ...- 1
At this time, the time until the end of interpolation varies within the range of 1 clock to 255 clocks with the clock pulse CLK1.
以上が係数補間回路50における補間処理の詳細であるが、上記の補間処理は、プログラムRAM22内のプログラムの補間コントロール信号を”0”にすれば無効とすることができる。すなわち、補間コントロール信号が”0”の場合は、オアゲート45から”0”信号がセレクタ43へ出力され、これにより、セレクタ43が係数RAM(新)32から出力される係数を選択して演算回路23へ出力する。前述したように、係数RAM(新)32は、常時、最新の係数が書き込まれるRAMであり、したがって、補間コントロール信号が”0”の場合は係数補間が行われず、最新の係数が演算回路23へ供給される。
The above is the details of the interpolation processing in the
次に、プログラム変更の場合について図4のフローチャートを参照して説明する。プログラムを変更する場合には、通常、係数も変更される。
プログラムおよび係数変更が行われる場合、CPU1が、まず、書き換え範囲を指定するデータを出力する。出力されたデータはスタートレジスタ51およびエンドレジスタ52に書き込まれる(ステップS1)。例えば、エフェクト用プログラムを書き換える場合、CPU1がアドレス0およびアドレス150を出力し、これらのアドレスがスタートレジスタ51およびエンドレジスタ52に書き込まれる。このスタートレジスタ51およびエンドレジスタ52の書き込みが行われると、以後、プログラムカウンタ27の出力がスタートアドレスからエンドアドレスの間の場合に比較回路54から”1”が出力され、これにより、アンドゲート55から全ビット”0”(NOP命令)が出力される(ステップS2)。
Next, the case of program change will be described with reference to the flowchart of FIG. When changing the program, the coefficients are usually changed.
When the program and coefficient are changed, the
また、プログラムおよび係数変更が行われる場合、セレクタ36、37が切り換えられ、係数RAM32〜34の各々に係数RAM(前段)31の出力が書き込まれる状態となる。すなわち、係数補間回路50における係数補間処理が実質的に行われない状態となる(ステップS3)。
When the program and the coefficient are changed, the
次に、CPU1が新プログラムおよび新係数を出力する。出力された新プログラムはプログラムRAM22に書き込まれ、また、この書き込みの間、アンドゲート55からNOP命令が出力される。したがって、書込みの間演算回路23は異常な出力を出すことはない。また、CPU1から出力された新係数は係数RAM(前段)31に書き込まれ、次いで、係数RAM32〜34に書き込まれる(ステップS4)。係数RAM32〜34の書き込みが終了すると、スタートレジスタ51およびエンドレジスタ52がクリアされ(ステップS5)、以後、新プログラムがアンドゲート55から出力される。また、新プログラムに同期して、係数RAM32〜34から新係数が出力されるが、これらは同じ係数であり、したがって、減算回路41の出力が「0」となり、係数補間回路40における旧係数から新係数への補間処理は行われない。この結果、プログラム変更時において、変更前の係数と変更後の係数との間で補間処理が行われるという不都合を防ぐことができる。
Next, the
次に、終了判定回路44の動作を図5を参照して詳述する。
前述したように、終了判定回路44は、加算回路42から出力される中間係数と係数RAM(新)32から出力される新係数との差が一定値以下になった時、終了信号をオアゲート45を介してセレクタ43へ出力する。このような終了判定回路44を設けている理由は、減算回路41から出力される差分データが新係数の上位8ビットと旧係数上位8ビットの差であるため、旧係数に差分データを順次加算していった場合に、加算結果がちょうど新係数に一致するとは限らないからである。ここで、上記の一定値は、当然に予測されるように、新係数と旧係数の差である差分データが大きいほど大きい値となり、差分データが小さい場合は小さい値となる。したがって、差分データが大きい時は新係数と中間係数の上位の複数ビットが一致すれば、新係数と中間係数の差が一定値以下になったと判断することができ、一方、差分データが小さい時は、上位から数えてさらに多くのビットが一致しなければ、新係数と中間係数の差が一定値以下になったと判断することはできないことになる。
Next, the operation of the
As described above, when the difference between the intermediate coefficient output from the
終了判定回路44はこの考えに従って形成されている。すなわち、差分データが+128〜+255の場合は、新係数と中間係数の各上位8ビットが一致すれば、下位8ビットがいかなるデータであっても差分データが+128〜+255以下になり、したがって、終了信号が出力される。差分データが+64〜+127の場合は、新係数と中間係数の各上位9ビットが一致すれば、下位7ビットがいかなるデータであっても差分データが+64〜+127以下になり、終了信号が出力される。図5は、このような差分データと比較ビットとの関係を示している。
The
以上がこの発明の一実施形態の詳細である。
上記実施形態によれば、プログラム中の係数コントロール信号HCによって係数補間を行うか行わないかを指定することができるので、係数の1つ1つに個別に補間するかしないかを設定することが可能となり、係数変更によるノイズを抑制したい処理には係数補間を行い、係数変更時の追従性を高めたい処理には係数補間を行わないという選択を自由に行うことができる。
The above is the details of one embodiment of the present invention.
According to the above embodiment, whether or not to perform coefficient interpolation can be specified by the coefficient control signal HC in the program, so it is possible to set whether or not to interpolate individually for each coefficient. Thus, it is possible to freely select the coefficient interpolation for the process for suppressing the noise due to the coefficient change and not to perform the coefficient interpolation for the process for improving the followability at the time of the coefficient change.
また、係数補間終了後や係数補間せずの場合に、係数RAM(前段)31から係数RAM(旧)33および係数RAM(中間)34への係数転送を停止することや、係数RAM(旧)33、係数RAM(中間)34の係数読み出しを停止することによってパワーセーブをすることが可能となる。 Further, after the coefficient interpolation is completed or when the coefficient interpolation is not performed, the coefficient transfer from the coefficient RAM (previous stage) 31 to the coefficient RAM (old) 33 and the coefficient RAM (middle) 34 is stopped, or the coefficient RAM (old) 33, by stopping the coefficient reading of the coefficient RAM (intermediate) 34, the power can be saved.
また、上記実施形態によれば、乗算器を使用せずに、データシフト後の差分計算によって係数補間を行うようになっている。差分計算後にデータシフトを行う場合は係数長16ビット、補間完了まで256ステップの場合、係数RAMに16ビット分全て記憶しておく必要がある。しかし、データシフト後に差分計算であると、シフト後に破棄されると分かっている下位8ビット分は最初から不要で上位8ビット分の係数だけを持っていればよいことになり、回路削減の効果がある。 Further, according to the above-described embodiment, coefficient interpolation is performed by difference calculation after data shift without using a multiplier. When the data shift is performed after the difference calculation, the coefficient length is 16 bits, and when the interpolation is completed in 256 steps, it is necessary to store all 16 bits in the coefficient RAM. However, if the difference calculation is performed after the data shift, the lower 8 bits that are known to be discarded after the shift are unnecessary from the beginning, and it is only necessary to have the coefficients for the upper 8 bits. There is.
この発明は、携帯端末における着信音やゲームの効果音の生成等に用いられる。 The present invention is used for generating ringtones and game sound effects in a portable terminal.
1…CPU、12…バッファレジスタ、13…音源回路、14…データ処理回路(DSP)、21…データRAM、22…プログラムRAM、23…演算回路、24…バッファメモリ、27…プログラムカウンタ、31…係数RAM(前段)、32…係数RAM(新)、33…係数RAM(旧)、34…係数RAM(中間)、36、37、43…セレクタ、41…減算回路、42…加算回路、44…終了判定回路、50…係数補間回路。
DESCRIPTION OF
Claims (2)
外部の制御装置から出力された係数が記憶された係数メモリと、
プログラムカウンタから出力されるアドレスデータに従って、前記プログラムメモリ内のプログラムおよび前記係数メモリ内の係数を順次読み出し、前記プログラムおよび前記係数に従って動作する演算回路とを具備するデータ処理回路において、
外部の制御装置から前記係数の変更を指示されると、変更後の新係数が記憶される新係数メモリと、
外部の制御装置から前記係数の変更を指示されると、変更前の旧係数が記憶される中間係数メモリと、
前記中間係数メモリ内の旧係数から前記新係数メモリ内の新係数に向かって順次変化する係数を生成する係数生成手段と、
前記プログラムには係数補間を指示するか否かを示す補間制御情報が含まれており、前記プログラムメモリから読み出されたプログラムに含まれる補間制御情報が係数補間を指示している時は前記係数生成手段の出力を前記演算回路へ出力し、前記補間制御情報が係数補間を指示していない時は前記新係数メモリから読み出される係数を前記演算回路へ出力する選択手段と、
を具備し、
前記係数生成手段は、前記新係数メモリから読み出された新係数を所定ビット下位方向へシフトしたデータから、前記中間係数メモリから読み出された変更前の旧係数を前記所定ビット下位方向へシフトしたデータを減算する減算手段と、
前記減算手段の出力と前記中間係数メモリの出力を加算する加算手段と、
前記加算手段の出力を前記中間係数メモリへ書き込む書込手段と、
前記減算手段の出力の大きさに対応してビット数N(Nは正の整数)を決定する決定手段を有しており、前記新係数メモリの出力の上位Nビットのデータと前記加算手段の出力の上位Nビットのデータが一致した時、補間終了と判定する終了判定手段と、
を具備し、
前記選択手段は、前記終了判定手段にて補間終了と判定した時、前記新係数メモリから読み出される係数を前記演算回路へ出力することを特徴とするデータ処理回路における係数補間回路。 A program memory in which a program output from an external control device is stored;
A coefficient memory in which coefficients output from an external control device are stored;
In accordance with address data output from a program counter, a data processing circuit comprising: an operation circuit that sequentially reads out a program in the program memory and a coefficient in the coefficient memory and operates according to the program and the coefficient;
A new coefficient memory for storing a new coefficient after the change when the change of the coefficient is instructed from an external control device;
When instructed to change the coefficient from an external control device, an intermediate coefficient memory in which the old coefficient before the change is stored;
Coefficient generating means for generating a coefficient that sequentially changes from an old coefficient in the intermediate coefficient memory toward a new coefficient in the new coefficient memory;
The program includes interpolation control information indicating whether or not coefficient interpolation is instructed. When the interpolation control information included in the program read from the program memory indicates coefficient interpolation, the coefficient Selecting means for outputting the output of the generating means to the arithmetic circuit, and outputting the coefficient read from the new coefficient memory to the arithmetic circuit when the interpolation control information does not instruct coefficient interpolation;
Equipped with,
The coefficient generation means shifts the old coefficient before change read from the intermediate coefficient memory from the data obtained by shifting the new coefficient read from the new coefficient memory to the predetermined bit lower direction. Subtracting means for subtracting the obtained data;
Adding means for adding the output of the subtracting means and the output of the intermediate coefficient memory;
Writing means for writing the output of the adding means to the intermediate coefficient memory;
Determining means for determining the number of bits N (N is a positive integer) corresponding to the magnitude of the output of the subtracting means; the upper N bits of data of the new coefficient memory; An end determination means for determining the end of interpolation when the upper N bits of output data match,
Comprising
The coefficient interpolating circuit in the data processing circuit , wherein the selecting means outputs the coefficient read from the new coefficient memory to the arithmetic circuit when the end judging means judges that the interpolation is finished .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004240707A JP4385893B2 (en) | 2004-08-20 | 2004-08-20 | Coefficient interpolation circuit in data processing circuit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004240707A JP4385893B2 (en) | 2004-08-20 | 2004-08-20 | Coefficient interpolation circuit in data processing circuit |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006058626A JP2006058626A (en) | 2006-03-02 |
JP4385893B2 true JP4385893B2 (en) | 2009-12-16 |
Family
ID=36106135
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004240707A Expired - Fee Related JP4385893B2 (en) | 2004-08-20 | 2004-08-20 | Coefficient interpolation circuit in data processing circuit |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4385893B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014204213A (en) * | 2013-04-03 | 2014-10-27 | パイオニア株式会社 | Digital filter and filter characteristic modification method |
-
2004
- 2004-08-20 JP JP2004240707A patent/JP4385893B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2006058626A (en) | 2006-03-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4636926B2 (en) | Multi-bit ΔΣ modulation type DA converter | |
US8175525B2 (en) | Conversion from note-based audio format to PCM-based audio format | |
JP4385893B2 (en) | Coefficient interpolation circuit in data processing circuit | |
JP4400373B2 (en) | Data processing circuit | |
US20080263268A1 (en) | Digital signal processor | |
US5522010A (en) | Pitch control apparatus for setting coefficients for cross-fading operation in accordance with intervals between write address and a number of read addresses in a sampling cycle | |
JP2950461B2 (en) | Tone generator | |
JP2634561B2 (en) | Variable delay circuit | |
US5956670A (en) | Speech reproducing device capable of reproducing long-time speech with reduced memory | |
CA2568117C (en) | Conversion from note-based audio format to pcm-based audio format | |
JP4545272B2 (en) | Digital attenuator and digital attenuation processing method | |
KR100236786B1 (en) | Sound source device | |
JP3601164B2 (en) | Echo suppressor method and echo suppressor device | |
JP2001154673A (en) | Sound source circuit and telephone terminal device using the circuit | |
JP3383474B2 (en) | Sound effect giving device and sound effect giving system | |
JP2008047223A (en) | Audio reproduction circuit | |
JP2008061053A (en) | Signal processing apparatus | |
JP4306944B2 (en) | Music playback device | |
JPH03201900A (en) | Sound field correction device | |
JP3223555B2 (en) | Waveform reading device | |
KR100729510B1 (en) | Mobile phone with different speaker driving modes according to usage | |
KR840002361B1 (en) | Lattice filter for waveform or speech synthesis circuits using digital filter | |
US5932826A (en) | Effect adder circuit with a coefficient smoothing circuit for an electronic musical instrument | |
JPH04129497A (en) | Master slave telephone system and facsimile equipment | |
JP2007235265A (en) | Portable terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20070618 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080826 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20081027 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090113 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090316 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090623 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090819 |
|
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: 20090908 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090921 |
|
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: 20121009 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121009 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131009 Year of fee payment: 4 |
|
LAPS | Cancellation because of no payment of annual fees |