JP4983858B2 - Filter device and filter processing program - Google Patents

Filter device and filter processing program Download PDF

Info

Publication number
JP4983858B2
JP4983858B2 JP2009122641A JP2009122641A JP4983858B2 JP 4983858 B2 JP4983858 B2 JP 4983858B2 JP 2009122641 A JP2009122641 A JP 2009122641A JP 2009122641 A JP2009122641 A JP 2009122641A JP 4983858 B2 JP4983858 B2 JP 4983858B2
Authority
JP
Japan
Prior art keywords
filter
waveform
frequency band
input waveform
bits
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
JP2009122641A
Other languages
Japanese (ja)
Other versions
JP2009183007A (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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2009122641A priority Critical patent/JP4983858B2/en
Publication of JP2009183007A publication Critical patent/JP2009183007A/en
Application granted granted Critical
Publication of JP4983858B2 publication Critical patent/JP4983858B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Electrophonic Musical Instruments (AREA)

Description

本発明は、例えば電子楽器に用いて好適なフィルタ装置およびフィルタ処理プログラムに関する。   The present invention relates to a filter device and a filter processing program suitable for use in, for example, an electronic musical instrument.

電子楽器では楽音生成する態様に応じてフィルタ特性を動的に変更可能なデジタルフィルタを用いる。その為、フィルタ特性とフィルタ係数とを対応付けて記憶した係数テーブルを参照して所望のフィルタ特性となるフィルタ係数を得るようにする場合が多い。   An electronic musical instrument uses a digital filter whose filter characteristics can be dynamically changed according to the manner in which musical sounds are generated. For this reason, in many cases, a filter coefficient having desired filter characteristics is obtained by referring to a coefficient table in which filter characteristics and filter coefficients are stored in association with each other.

この種の技術として、例えば特許文献1には、カットオフ周波数値を整数部Iおよび小数部Fで表現し、カットオフ周波数値の整数部Iに対応するフィルタ係数を記憶した係数テーブルを設け、カットオフ周波数値の小数部Fがゼロの時はカットオフ周波数値の整数部Iに対応するフィルタ係数を係数テーブルから読み出してそのまま出力し、小数部Fがゼロでない時には係数テーブルから整数部Iに対応するフィルタ係数Aと、整数部I+1に対応するフィルタ係数Bとを読み出し、読み出したフィルタ係数A,Bを小数部Fで直線補間A+F(A−B)して得られるフィルタ係数Cを出力するフィルタ装置が開示されている。   As this type of technology, for example, in Patent Document 1, a cutoff frequency value is expressed by an integer part I and a fractional part F, and a coefficient table storing filter coefficients corresponding to the integer part I of the cutoff frequency value is provided. When the fractional part F of the cutoff frequency value is zero, the filter coefficient corresponding to the integer part I of the cutoff frequency value is read from the coefficient table and output as it is, and when the fractional part F is not zero, the coefficient table is changed to the integer part I. The corresponding filter coefficient A and the filter coefficient B corresponding to the integer part I + 1 are read out, and the filter coefficient C obtained by linear interpolation A + F (AB) of the read filter coefficients A and B with the decimal part F is output. A filter device is disclosed.

特公平6−91418号公報Japanese Examined Patent Publication No. 6-91418

ところで、上述した従来のフィルタ装置では、フィルタの周波数特性を連続的に変化させる場合、フィルタ係数を急激に変化させると出力が不連続になってノイズ発生要因となる為、フィルタ係数を小刻みに設定したり、フィルタ係数を補間形成するようにしている。
しかしながら、フィルタ係数を小刻みに設定すると係数テーブルの肥大化を招き、一方、フィルタ係数を補間形成するには別途に係数補間器を備えることから、回路規模増大や処理速度低下を招く問題がある。
また、出力の音質向上を図るためには、フィルタ演算する演算ビット数を上げればよいが、演算ビット数を高めると、更なる回路規模増大と処理速度低下を招いてしまう、という問題もある。
By the way, in the conventional filter device described above, when the filter frequency characteristics are continuously changed, if the filter coefficient is changed suddenly, the output becomes discontinuous and causes noise, so the filter coefficient is set in small increments. Or by interpolating filter coefficients.
However, if the filter coefficient is set in small increments, the coefficient table is enlarged. On the other hand, since the filter coefficient is interpolated, a separate coefficient interpolator is provided, resulting in an increase in circuit scale and a decrease in processing speed.
Further, in order to improve the sound quality of the output, it is only necessary to increase the number of calculation bits for the filter operation. However, if the number of calculation bits is increased, there is a problem that the circuit scale and the processing speed are further reduced.

そこで本発明の第1の目的は、係数テーブルを肥大化させず、しかも回路規模増大や処理速度低下を招くことなく周波数特性を連続的に変化させることができるフィルタ装置およびフィルタ処理プログラムを提供することにある。
また、本発明の第2の目的は、回路規模増大と処理速度低下を招致することなく音質向上を図ることができるフィルタ装置およびフィルタ処理プログラムを提供することにある。
Accordingly, a first object of the present invention is to provide a filter device and a filter processing program capable of continuously changing the frequency characteristics without enlarging the coefficient table and without causing an increase in circuit scale or a reduction in processing speed. There is.
A second object of the present invention is to provide a filter device and a filter processing program capable of improving sound quality without inviting an increase in circuit scale and a decrease in processing speed.

請求項に記載の発明では、入力波形を複数の周波数帯域に分割し、分割された各周波数帯域毎のエンベロープレベルを検出する検出手段と、この検出手段により検出されたエンベロープレベルが所定値を超えた周波数帯域について第1の演算ビット数のフィルタ演算を指示し、所定値以下の周波数帯域について第2の演算ビット数のフィルタ演算を指示する指示手段と、前記複数の周波数帯域に対応して設けられ、前記指示手段から指示される第1および第2の演算ビット数のいずれかのフィルタ演算を、対応する周波数帯域の入力波形に施すフィルタ手段とを具備することを特徴とする。 According to the first aspect of the present invention, the input waveform is divided into a plurality of frequency bands, the detection means for detecting the envelope level for each divided frequency band, and the envelope level detected by the detection means has a predetermined value. Instructing means for instructing filter operation of the first number of calculation bits for the frequency band exceeding, and instructing filter operation of the second number of calculation bits for the frequency band below a predetermined value, corresponding to the plurality of frequency bands Provided with a filter means for applying any one of the first and second calculation bit numbers instructed by the instruction means to the input waveform in the corresponding frequency band.

請求項に記載の発明では、入力波形を複数の周波数帯域に分割する帯域分割手段と、前記複数の周波数帯域毎に、前記入力波形の波形種および音高に対応付けた演算ビット数を予め記憶する記憶手段と、前記入力波形の波形種および音高を表す楽音パラメータに応じて、前記記憶手段から対応する演算ビット数を読み出して各周波数帯域に割当てる割当て手段と、前記複数の周波数帯域に対応して設けられ、前記割当て手段により割当てられた演算ビット数のフィルタ演算を、対応する周波数帯域の入力波形に施すフィルタ手段とを具備することを特徴とする。 According to the second aspect of the present invention, band dividing means for dividing the input waveform into a plurality of frequency bands, and the number of calculation bits associated with the waveform type and pitch of the input waveform for each of the plurality of frequency bands in advance. Storage means for storing, assignment means for reading out the corresponding number of operation bits from the storage means and assigning them to each frequency band in accordance with a musical tone parameter representing the waveform type and pitch of the input waveform, and for each of the plurality of frequency bands And a filter unit that is provided correspondingly and applies a filter operation of the number of operation bits assigned by the assigning unit to an input waveform in a corresponding frequency band.

請求項に記載の発明では、入力波形を複数の周波数帯域に分割し、分割された各周波数帯域毎のエンベロープレベルを検出する検出ステップと、この検出ステップにて検出されたエンベロープレベルが所定値を超えた周波数帯域について第1の演算ビット数のフィルタ演算を指示し、所定値以下の周波数帯域について第2の演算ビット数のフィルタ演算を指示する指示ステップと、前記複数の周波数帯域に対応して実行され、前記指示ステップで指示される第1および第2の演算ビット数のいずれかのフィルタ演算を、対応する周波数帯域の入力波形に施すフィルタリングステップとをコンピュータで実行させることを特徴とする。 According to the third aspect of the invention, the input waveform is divided into a plurality of frequency bands, the detection step for detecting the envelope level for each of the divided frequency bands, and the envelope level detected in the detection step is a predetermined value. An instruction step for instructing a filter operation with a first number of calculation bits for a frequency band exceeding 1, a command for instructing a filter operation with a second number of calculation bits for a frequency band equal to or less than a predetermined value, and corresponding to the plurality of frequency bands And a filtering step in which any one of the first and second calculation bit numbers indicated in the instruction step is applied to the input waveform in the corresponding frequency band. .

請求項に記載の発明では、入力波形を複数の周波数帯域に分割する帯域分割ステップと、前記複数の周波数帯域毎に、前記入力波形の波形種および音高に対応付けた演算ビット数を予め記憶しておき、前記入力波形の波形種および音高を表す楽音パラメータに応じて、対応する演算ビット数を読み出して各周波数帯域に割当てる割当てステップと、前記複数の周波数帯域に対応して実行され、前記割当てステップにて割当てられた演算ビット数のフィルタ演算を、対応する周波数帯域の入力波形に施すフィルタリングステップとをコンピュータで実行させることを特徴とする。 In the invention according to claim 4 , a band dividing step for dividing the input waveform into a plurality of frequency bands, and a calculation bit number associated with the waveform type and the pitch of the input waveform for each of the plurality of frequency bands in advance. An allocation step of storing and assigning the corresponding number of operation bits to each frequency band in accordance with a musical sound parameter indicating the waveform type and pitch of the input waveform, and executing corresponding to the plurality of frequency bands A filtering step of applying a filter operation of the number of operation bits assigned in the assignment step to an input waveform in a corresponding frequency band is executed by a computer.

本発明では、入力波形を複数の周波数帯域に分割して各周波数帯域毎のエンベロープレベルを検出し、検出されたエンベロープレベルが所定値を超えた周波数帯域に第1の演算ビット数のフィルタ演算を指示し、所定値以下の周波数帯域に第2の演算ビット数のフィルタ演算を指示すると、各周波数帯域に対応して設けられたフィルタ手段が指示された演算ビット数のフィルタ演算を入力波形に施すので、波形レベルが大きく聴覚的に耳につきやすい周波数帯域では精度の高いフィルタリングを、波形レベルが小さく聴覚的に目立たない周波数帯域では精度の低いフィルタリングを行わせるようにし、これにより回路規模増大と処理速度低下を招致することなく聴感上の音質向上を図ることが可能になる。   In the present invention, the input waveform is divided into a plurality of frequency bands, the envelope level for each frequency band is detected, and a filter operation with the first number of calculation bits is performed on the frequency band where the detected envelope level exceeds a predetermined value. When a filter operation of the second number of calculation bits is instructed to a frequency band equal to or less than a predetermined value, the filter means provided corresponding to each frequency band performs a filter operation of the specified number of calculation bits on the input waveform. Therefore, high-accuracy filtering is performed in the frequency band where the waveform level is large and easily audible, and low-accuracy filtering is performed in the frequency band where the waveform level is small and audibly inconspicuous, thereby increasing the circuit scale and processing. It is possible to improve the sound quality on hearing without incurring a decrease in speed.

請求項1,3に記載の発明によれば、入力波形を複数の周波数帯域に分割して各周波数帯域毎のエンベロープレベルを検出し、検出されたエンベロープレベルが所定値を超えた周波数帯域に第1の演算ビット数のフィルタ演算を指示し、所定値以下の周波数帯域に第2の演算ビット数のフィルタ演算を指示すると、各周波数帯域に対応して設けられたフィルタ手段が指示された演算ビット数のフィルタ演算を入力波形に施すので、波形レベルが大きく聴覚的に耳につきやすい周波数帯域では精度の高いフィルタリングを、波形レベルが小さく聴覚的に目立たない周波数帯域では精度の低いフィルタリングを行わせるので、回路規模増大や処理速度低下を招致することなく聴感上の音質向上を図ることができる。
請求項2,4に記載の発明によれば、複数の周波数帯域毎に、入力波形の波形種および音高に対応付けた演算ビット数を予め記憶しておき、入力波形の波形種および音高を表す楽音パラメータに応じて、対応する演算ビット数を読み出して各周波数帯域のフィルタ手段に割当てると、各フィルタ手段は割当てられた演算ビット数のフィルタ演算を、対応する周波数帯域の入力波形に施すので、波形種または音高の変化に対応した最適な演算ビット数のフィルタリングを即座に指示出来、しかもエンベロープ検出する構成を省くことができるから、回路規模増大や処理速度低下を招致することなく聴感上の音質向上を図ることができる。
According to the first and third aspects of the present invention, the input waveform is divided into a plurality of frequency bands to detect the envelope level for each frequency band, and the detected envelope level exceeds the predetermined value. When a filter operation with the number of operation bits of 1 is instructed and a filter operation with the second number of operation bits is instructed in a frequency band equal to or less than a predetermined value, the filter means provided corresponding to each frequency band is instructed Since a number of filter operations are performed on the input waveform, high-accuracy filtering is performed in the frequency band where the waveform level is large and easily audible, and low-accuracy filtering is performed in the frequency band where the waveform level is small and audible. Further, it is possible to improve the sound quality on hearing without inviting an increase in circuit scale or a decrease in processing speed.
According to the second and fourth aspects of the invention, the number of calculation bits associated with the waveform type and pitch of the input waveform is stored in advance for each of a plurality of frequency bands, and the waveform type and pitch of the input waveform are stored. When the corresponding number of operation bits is read out and assigned to the filter means for each frequency band in accordance with the musical sound parameter representing, each filter means performs the filter operation for the assigned operation bit number on the input waveform of the corresponding frequency band. Therefore, it is possible to immediately specify filtering of the optimum number of calculation bits corresponding to the change in waveform type or pitch, and the configuration for detecting the envelope can be omitted, so that the audibility is not incurred without increasing the circuit scale or reducing the processing speed. The above sound quality can be improved.

第1実施例によるフィルタ装置を備えた電子楽器の全体構成を示すブロック図である。It is a block diagram which shows the whole structure of the electronic musical instrument provided with the filter apparatus by 1st Example. 第1実施例によるフィルタ装置を備えた音源6の部分構成を示すブロック図である。It is a block diagram which shows the partial structure of the sound source 6 provided with the filter apparatus by 1st Example. フィルタ部12の一構成例を示すブロック図である。3 is a block diagram illustrating a configuration example of a filter unit 12. FIG. 係数テーブル13に記憶されるフィルタ係数の一例を示す図である。It is a figure which shows an example of the filter coefficient memorize | stored in the coefficient table. 振幅補間器14の構成を示すブロック図である。3 is a block diagram showing a configuration of an amplitude interpolator 14. FIG. 補間係数発生器14aが発生する係数αの経時変化(同図(イ))および係数βの経時変化(同図(ロ))の様子を示す図である。It is a figure which shows the mode of the time-dependent change (the figure (A)) of the coefficient (alpha) which the interpolation coefficient generator 14a generate | occur | produces, and the time-dependent change (the figure (B)) of the coefficient (beta). 第2実施例によるフィルタ装置の構成を示すブロック図である。It is a block diagram which shows the structure of the filter apparatus by 2nd Example. 積和演算処理ロジックを示すブロック図である。It is a block diagram which shows a product-sum operation processing logic. 制御部10が実行する語長割当処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the word length allocation process which the control part 10 performs. ローパスフィルタ22が実行するフィルタ演算タイマインタラプト処理の動作を示すフローチャートである。6 is a flowchart showing an operation of a filter operation timer interrupt process executed by the low-pass filter 22; 変形例における語長割当テーブルTBLの構成を示す図である。It is a figure which shows the structure of the word length allocation table TBL in a modification. 変形例における制御部10が実行する語長割当処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the word length allocation process which the control part 10 in a modification is performed.

本発明によるフィルタ装置およびフィルタ処理プログラムは、電子楽器や効果付加装置などに適用される。以下では、電子楽器に搭載されるフィルタ装置(もしくはフィルタ処理プログラム)を実施例とし、これについて図面を参照して説明する。   The filter device and the filter processing program according to the present invention are applied to an electronic musical instrument, an effect adding device, and the like. Hereinafter, a filter device (or a filter processing program) mounted on an electronic musical instrument will be described as an example, and this will be described with reference to the drawings.

A.第1実施例
(1)全体構成
図1は第1実施例によるフィルタ装置を備えた電子楽器の全体構成を示すブロック図である。この図において、1は押離鍵操作に応じたキーオン/キーオフイベントおよびノート番号、ベロシティ等からなる演奏情報を発生する鍵盤である。2は楽器パネルに配設される各種スイッチから構成されるスイッチ部であり、操作されたスイッチに対応したスイッチイベントを発生する。3は各種制御プログラムを記憶するROMである。4はCPU5のワークエリアとして用いられ、各種レジスタ・フラグデータを一時記憶するRAMである。
A. First Embodiment (1) Overall Configuration FIG. 1 is a block diagram showing the overall configuration of an electronic musical instrument provided with a filter device according to a first embodiment. In this figure, reference numeral 1 denotes a keyboard for generating performance information including key-on / key-off events, note numbers, velocities, and the like in response to pressing and releasing keys. Reference numeral 2 denotes a switch unit composed of various switches arranged on the musical instrument panel, and generates a switch event corresponding to the operated switch. Reference numeral 3 denotes a ROM for storing various control programs. A RAM 4 is used as a work area for the CPU 5 and temporarily stores various register / flag data.

CPU5はROM3に格納される各種制御プログラムを実行し、例えば鍵盤1が発生する演奏情報に対応した楽音パラメータを発生して音源6に送出したり、スイッチ部2が発生するスイッチイベントに応じて動作モードを変更させる等、楽器各部を制御する。なお、CPU5が発生する楽音パラメータとは、発音又は消音を指示するノーオン/オフイベントの他、例えば音色切換えや効果付与など発生波形の周波数特性を変化させて波形修飾する為のパラメータを含む。6は上記CPU5から供給される楽音パラメータに応じた波形を発生する音源である。音源6は本発明によるフィルタ装置を備えており、その具体的な構成については追って述べる。7は音源6の出力をアナログ形式の波形信号に変換するD/A変換器である。8はD/A変換器7から供給される波形信号を増幅してスピーカ9から発音させるサウンドシステムである。   The CPU 5 executes various control programs stored in the ROM 3, for example, generates musical tone parameters corresponding to performance information generated by the keyboard 1 and sends them to the sound source 6, or operates in response to a switch event generated by the switch unit 2. Control each part of the instrument, such as changing the mode. Note that the musical sound parameters generated by the CPU 5 include parameters for modifying the waveform by changing the frequency characteristics of the generated waveform, such as timbre switching and effect application, in addition to no-on / off events for instructing sound generation or muting. Reference numeral 6 denotes a sound source that generates a waveform corresponding to a musical sound parameter supplied from the CPU 5. The sound source 6 includes a filter device according to the present invention, and a specific configuration thereof will be described later. A D / A converter 7 converts the output of the sound source 6 into an analog waveform signal. Reference numeral 8 denotes a sound system that amplifies the waveform signal supplied from the D / A converter 7 and produces sound from the speaker 9.

(2)音源6の構成
次に、図2〜図5を参照して音源6の構成を説明する。図2は、本発明によるフィルタ装置を含む音源6の部分構成を示すブロック図である。図2において、10はCPU5から供給される楽音パラメータに応じて、音色番号TN、位相データPD、カットオフ周波数データCFを発生する制御部である。また、制御部10は、楽音パラメータに対応して発生するカットオフ周波数データCFを切り替えるタイミングで補間開始トリガTRを発生する。11は周知の波形メモリ読み出し方式で構成される波形発生器である。波形発生器11は、制御部10から供給される音色番号TNで指定される音色の波形データを、位相データPDに応じて読み出して出力する。
(2) Configuration of Sound Source 6 Next, the configuration of the sound source 6 will be described with reference to FIGS. FIG. 2 is a block diagram showing a partial configuration of the sound source 6 including the filter device according to the present invention. In FIG. 2, reference numeral 10 denotes a control unit that generates a timbre number TN, phase data PD, and cut-off frequency data CF in accordance with a musical tone parameter supplied from the CPU 5. Further, the control unit 10 generates the interpolation start trigger TR at the timing of switching the cutoff frequency data CF generated corresponding to the musical tone parameter. Reference numeral 11 denotes a waveform generator configured by a known waveform memory reading system. The waveform generator 11 reads out and outputs the waveform data of the timbre specified by the timbre number TN supplied from the control unit 10 according to the phase data PD.

12は波形発生器11から出力される波形データをフィルタリングして次段の振幅補間器14に供給するフィルタ部である。フィルタ部12は、例えば図3に図示するように、入力を1サンプル遅延して出力する遅延素子12a〜12dと、後述のフィルタ係数a0〜a2およびb1〜b2がそれぞれ供給される係数乗算器12e〜12iと、これら係数乗算器12e〜12iの各出力を加算する加算器12jとを備える周知の2次IIR型デジタルフィルタから構成される。こうした構成のフィルタ部12は、後述する係数テーブル13から出力されるフィルタ係数a0〜a2およびb1〜b2に従った周波数特性のフィルタ演算を行う。
具体的には、入力x[n]、遅延素子12aの出力x[n−1]、遅延素子12bの出力x[n−2]、遅延素子12cの出力y[n−1]および遅延素子12dの出力y[n−2]とした場合、次式(1)で表現されるフィルタ演算にて出力y[n]を発生する。
y[n]=a0・x[n]+a1・x[n−1]+a2・x[n−2]−b1・y[n−1]−b2・y[n−2]…(1)
A filter unit 12 filters the waveform data output from the waveform generator 11 and supplies it to the amplitude interpolator 14 at the next stage. For example, as illustrated in FIG. 3, the filter unit 12 includes delay elements 12 a to 12 d that delay the input by one sample and output, and a coefficient multiplier 12 e to which filter coefficients a0 to a2 and b1 to b2 described later are respectively supplied. To 12i and an adder 12j for adding the outputs of the coefficient multipliers 12e to 12i. The filter unit 12 having such a configuration performs a filter operation of frequency characteristics according to filter coefficients a0 to a2 and b1 to b2 output from a coefficient table 13 described later.
Specifically, input x [n], output x [n-1] of delay element 12a, output x [n-2] of delay element 12b, output y [n-1] of delay element 12c, and delay element 12d Output y [n-2], the output y [n] is generated by the filter operation expressed by the following equation (1).
y [n] = a0 * x [n] + a1 * x [n-1] + a2 * x [n-2] -b1 * y [n-1] -b2 * y [n-2] (1)

係数テーブル13は、フィルタ部12をローパスフィルタとして動作させる場合、図4に図示するように、各種カットオフ周波数データCFに対応するフィルタ係数a0〜a2およびb1〜b2をROMに記憶させておき、制御部10から供給されるカットオフ周波数データCFに対応するフィルタ係数a0〜a2およびb1〜b2を読み出してフィルタ部12の係数乗算器12e〜12iに供給する。   When the filter unit 12 is operated as a low-pass filter, the coefficient table 13 stores filter coefficients a0 to a2 and b1 to b2 corresponding to various cutoff frequency data CF in the ROM as illustrated in FIG. The filter coefficients a0 to a2 and b1 to b2 corresponding to the cutoff frequency data CF supplied from the control unit 10 are read out and supplied to the coefficient multipliers 12e to 12i of the filter unit 12.

振幅補間器14は、図5に図示するように、補間係数発生器14a、リングバッファ14b、乗算器14c〜14dおよび加算器14eから構成される。補間係数発生器14aは、制御部10から補間開始トリガTRが入力された時点、すなわちフィルタ係数切り替え時点から波形N周期分の時間に一定レートで経時変化する係数α、βを発生すると共に、係数αが「0」(係数βが「1」)となった時点でリングバッファ14bにバッファクリアおよび書き込み開始を指示する信号writeを発生する。また、振幅補間器14は、リングバッファ14bが波形N周期分(Nは整数)の波形データを書き込み終えた時点で係数αを「1」、係数βを「0」の初期設定に戻す。   As shown in FIG. 5, the amplitude interpolator 14 includes an interpolation coefficient generator 14a, a ring buffer 14b, multipliers 14c to 14d, and an adder 14e. The interpolation coefficient generator 14a generates coefficients α and β that change with time at a constant rate from the time when the interpolation start trigger TR is input from the control unit 10, that is, the time corresponding to the N cycles of the waveform from the filter coefficient switching time. When α becomes “0” (coefficient β becomes “1”), a signal “write” is generated to instruct the ring buffer 14b to start buffer clear and write. The amplitude interpolator 14 returns the coefficient α to the initial setting of “1” and the coefficient β to “0” when the ring buffer 14 b has finished writing the waveform data for N cycles (N is an integer).

リングバッファ14bは、入力される波形データを波形N周期分(Nは整数)分蓄積しながら、蓄積した波形データを順次読み出して出力する。換言すると、リングバッファ14bは入力される波形データを波形N周期分遅延して出力するものであり、補間係数発生器14aから信号writeが供給された場合、蓄積している波形データを一旦クリアして新たに入力される波形データの書き込みを開始する。
乗算器14cは、リングバッファ14bから出力される波形データに、補間係数発生器14aから供給される係数αを乗算して出力する。乗算器14dは、前段のフィルタ部12が出力する波形データに、補間係数発生器14aから供給される係数βを乗算して出力する。加算器14eは、乗算器14c,14dの各乗算結果を加算して出力する。
The ring buffer 14b sequentially reads and outputs the accumulated waveform data while accumulating the input waveform data for N cycles of the waveform (N is an integer). In other words, the ring buffer 14b delays the input waveform data by N cycles of the waveform and outputs it. When the signal write is supplied from the interpolation coefficient generator 14a, the accumulated waveform data is once cleared. Start writing the newly input waveform data.
The multiplier 14c multiplies the waveform data output from the ring buffer 14b by the coefficient α supplied from the interpolation coefficient generator 14a and outputs the result. The multiplier 14d multiplies the waveform data output from the previous filter unit 12 by the coefficient β supplied from the interpolation coefficient generator 14a, and outputs the result. The adder 14e adds the multiplication results of the multipliers 14c and 14d and outputs the result.

(3)振幅補間器14の動作
次に、本発明の要旨にかかわる振幅補間器14の動作について図6を参照して説明する。図6は補間係数発生器14aが発生する係数αの経時変化(同図(イ))および係数βの経時変化(同図(ロ))の様子を図示している。この図において、(A)は制御部10から補間開始トリガTRが供給される以前の定常状態を表す。定常状態(A)では、補間係数発生器14aは係数αを「1」、係数βを「0」とする初期設定下にある為、振幅補間器14はリングバッファ14bから読み出される波形データだけを出力する。
(3) Operation of Amplitude Interpolator 14 Next, the operation of the amplitude interpolator 14 according to the gist of the present invention will be described with reference to FIG. FIG. 6 illustrates the change over time of the coefficient α (FIG. 6 (a)) and the change over time of the coefficient β (FIG. 6 (b)) generated by the interpolation coefficient generator 14a. In this figure, (A) represents a steady state before the interpolation start trigger TR is supplied from the control unit 10. In the steady state (A), since the interpolation coefficient generator 14a is under the initial setting with the coefficient α being “1” and the coefficient β being “0”, the amplitude interpolator 14 receives only the waveform data read from the ring buffer 14b. Output.

そして、制御部10から補間係数発生器14aに補間開始トリガTRが入力されるフィルタ係数切り替え時点t1になったとする。この時、補間係数発生器14aは係数αを「1」、係数βを「0」に設定しているので、振幅補間器14はリングバッファ14bから読み出される波形データ(フィルタ係数切り替え前に蓄積された波形データ)だけを出力する。したがって、フィルタ係数の切り替えに際してフィルタ部12の出力に不連続が生じたとしても、そのフィルタ部12の出力は乗算器14dでミュートされる結果、ノイズ発生を抑止できる。   Then, it is assumed that the filter coefficient switching time t1 when the interpolation start trigger TR is input from the control unit 10 to the interpolation coefficient generator 14a is reached. At this time, since the interpolation coefficient generator 14a sets the coefficient α to “1” and the coefficient β to “0”, the amplitude interpolator 14 stores the waveform data read from the ring buffer 14b (accumulated before switching the filter coefficient). Only waveform data). Therefore, even if a discontinuity occurs in the output of the filter unit 12 when the filter coefficient is switched, the output of the filter unit 12 is muted by the multiplier 14d, so that noise generation can be suppressed.

次に、フィルタ係数切り替え時点t1以後の遷移状態(B)になると、振幅補間器14は、波形N周期分の時間内で「1」から「0」に一定レートで経時変化する係数αを乗算したフィルタ係数切り替え前の波形データと、波形N周期分の時間内で「0」から「1」に一定レートで経時変化する係数β(=1−α)を乗算したフィルタ係数切り替え後の波形データとを加算する線形補間を行う。これにより、フィルタ係数切り替え前の波形データからフィルタ係数切り替え後の波形データにクロスフェードさせる形で連続的に振幅レベルを制御する為、ノイズ発生を抑止し得る。   Next, in the transition state (B) after the filter coefficient switching time t1, the amplitude interpolator 14 multiplies the coefficient α that changes with time at a constant rate from “1” to “0” within the time corresponding to the N cycles of the waveform. Waveform data before switching the filter coefficient and waveform data after switching the filter coefficient obtained by multiplying “0” to “1” by a coefficient β (= 1−α) that changes with time at a constant rate within the time corresponding to N cycles of the waveform. Perform linear interpolation to add As a result, the amplitude level is continuously controlled in such a manner that the waveform data before the filter coefficient switching is cross-fade to the waveform data after the filter coefficient switching.

そして、係数αが「0」となってフィルタ係数切り替え前の波形データをミュートする一方、係数βが「1」に達してフィルタ係数切り替え後の波形データだけを出力する時点t2になると、振幅補間器14では補間係数発生器14aより供給される信号writeに従い、リングバッファ14bは蓄積していた波形データを一旦クリアした後、新たに入力される波形データの書き込みを開始する。続いて、リングバッファ14bに波形N周期分(Nは整数)の波形データを書き込み終える時点t3に達すると、補間係数発生器14aは係数αを「1」、係数βを「0」の初期設定に戻す。これにより、振幅補間器14はリングバッファ14bから読み出される波形データだけを出力する定常状態(A)に復帰する。   When the coefficient α becomes “0” and the waveform data before switching the filter coefficient is muted, the coefficient β reaches “1” and only the waveform data after switching the filter coefficient is output. In the unit 14, in accordance with the signal write supplied from the interpolation coefficient generator 14a, the ring buffer 14b once clears the accumulated waveform data, and then starts writing the newly input waveform data. Subsequently, when reaching the time point t3 when the writing of waveform data for N waveforms (N is an integer) is completed in the ring buffer 14b, the interpolation coefficient generator 14a initializes the coefficient α to “1” and the coefficient β to “0”. Return to. As a result, the amplitude interpolator 14 returns to the steady state (A) in which only the waveform data read from the ring buffer 14b is output.

このように、第1実施例では、フィルタ係数が切り替えられる時点まではフィルタ部12から出力されるフィルタ係数切り替え前の波形データをリングバッファ14bに蓄積しつつ、当該リングバッファ14bから波形N周期(Nは整数)分遅延させた波形データを読み出して出力する。そして、フィルタ係数切り替え後はリングバッファ14bから読み出すフィルタ係数切り替え前の波形データを、フィルタ係数切り替え後のフィルタ部12から出力される波形データにクロスフェードさせるよう振幅補間して出力する。   Thus, in the first embodiment, the waveform data before the filter coefficient switching output from the filter unit 12 is accumulated in the ring buffer 14b until the filter coefficient is switched, while the waveform N period ( Waveform data delayed by N) is read and output. After the filter coefficient is switched, the waveform data before switching the filter coefficient read from the ring buffer 14b is subjected to amplitude interpolation so that the waveform data output from the filter unit 12 after the filter coefficient switching is crossfaded and output.

そして、クロスフェードし終えた時点からリングバッファ14bの蓄積内容をフィルタ係数切り替え前の波形データからフィルタ係数切り替え後の波形データに更新させる間はフィルタ部12から出力されるフィルタ係数切り替え後の波形データを出力し、更新完了後はフィルタ部12から出力されるフィルタ係数切り替え後の波形データをリングバッファ14bに蓄積しつつ、当該リングバッファ14bから波形N周期(Nは整数)分遅延させた波形データを読み出して出力する。これにより、フィルタ出力の不連続を回避するので、係数テーブルの肥大化あるいは回路規模増大や処理速度低下を招くことなく周波数特性を連続的に変化させることが可能になる。   The waveform data after switching the filter coefficient output from the filter unit 12 is updated while the accumulated content of the ring buffer 14b is updated from the waveform data before switching the filter coefficient to the waveform data after switching the filter coefficient from the time when the crossfading is completed. After the update is completed, the waveform data after the filter coefficient switching output from the filter unit 12 is accumulated in the ring buffer 14b, and the waveform data delayed from the ring buffer 14b by the waveform N period (N is an integer). Is read and output. As a result, discontinuity of the filter output is avoided, so that it is possible to continuously change the frequency characteristics without increasing the coefficient table, increasing the circuit scale, or reducing the processing speed.

なお、上述した第1実施例では、説明の簡略化を図るため、振幅補間器14が線形補間する一例を開示したが、本発明の要旨はこれに限定されず、非線形補間する態様も含む。
例えば、フィルタ係数切り替えの前後でフィルタ部12が出力する波形データのレベル差に応じて、最適な補間演算形態を選択し、選択した補間演算形態でフィルタ係数切り替え前の波形データからフィルタ係数切り替え後の波形データに非線形補間することも可能である。このようにすれば、フィルタ係数切り替え前後の波形データをより自然な形で滑らかに繋げる為、音質向上に寄与することができる。
In the first embodiment described above, an example in which the amplitude interpolator 14 performs linear interpolation is disclosed in order to simplify the description. However, the gist of the present invention is not limited to this, and includes a mode of nonlinear interpolation.
For example, the optimum interpolation calculation form is selected according to the level difference of the waveform data output by the filter unit 12 before and after the filter coefficient switching, and after the filter coefficient switching from the waveform data before the filter coefficient switching in the selected interpolation calculation form. It is also possible to perform non-linear interpolation on the waveform data. In this way, since the waveform data before and after the filter coefficient switching is smoothly connected in a more natural form, it is possible to contribute to improvement in sound quality.

また、第1実施例では機能構成を明確にするためにハードウェアイメージとして表現したが、本発明の要旨はそれに限定されず、開示した各機能要素をソフトウェア処理で具現することも勿論可能である。   Further, in the first embodiment, the hardware image is expressed in order to clarify the functional configuration, but the gist of the present invention is not limited thereto, and the disclosed functional elements can of course be implemented by software processing. .

B.第2実施例
次に、図7〜図10を参照して第2実施例について説明する。
(1)構成
図7は第2実施例によるフィルタ装置の構成を示すブロック図であり、上述した第1実施例と共通する要素には同一の番号を付している。図7において、フィルタ部12は、波形発生器11(不図示)から供給される入力波形を第1〜第3の周波数帯域に分別するフィルタユニット12−1〜12−3から構成される。各フィルタユニット12−1〜12−3は、入力波形をそれぞれ第1〜第3の周波数帯域に分別するバンドパスフィルタ20と、バンドパスフィルタ20の出力エンベロープを検出するエンベロープ検出器21と、後述する制御部10から供給される信号WLにて指定される演算ビット数でフィルタ演算を行うローパスフィルタ22を備える。
B. Second Embodiment Next, a second embodiment will be described with reference to FIGS.
(1) Configuration FIG. 7 is a block diagram showing the configuration of the filter device according to the second embodiment. Elements common to the first embodiment described above are given the same reference numerals. In FIG. 7, the filter unit 12 includes filter units 12-1 to 12-3 that classify an input waveform supplied from a waveform generator 11 (not shown) into first to third frequency bands. Each of the filter units 12-1 to 12-3 includes a bandpass filter 20 that classifies an input waveform into first to third frequency bands, an envelope detector 21 that detects an output envelope of the bandpass filter 20, and a later-described filter unit. A low-pass filter 22 that performs a filter operation with the number of operation bits specified by the signal WL supplied from the control unit 10.

制御部10は、第1実施例と同様、CPU5から供給される楽音パラメータに応じて、音色番号TNや位相データPDを発生して図示されていない波形発生器11に供給する一方、上記エンベロープ検出器21の検出結果に応じてフィルタ演算時の演算ビット数を指定する信号WLを発生する。信号WLは「1」の場合に16ビットのフィルタ演算を、「0」の場合に8ビットのフィルタ演算を指示する。   As in the first embodiment, the control unit 10 generates the timbre number TN and the phase data PD according to the musical tone parameters supplied from the CPU 5 and supplies them to the waveform generator 11 (not shown), while detecting the envelope. A signal WL for designating the number of calculation bits at the time of filter calculation is generated according to the detection result of the detector 21. When the signal WL is “1”, a 16-bit filter operation is instructed, and when the signal WL is “0”, an 8-bit filter operation is instructed.

ローパスフィルタ22は、前述した第1実施例と同様、図3に図示した2次IIR型デジタルフィルタで構成され、前述した(1)式、すなわち入力x[n]、遅延素子12aの出力x[n−1]、遅延素子12bの出力x[n−2]、遅延素子12cの出力y[n−1]および遅延素子12dの出力y[n−2]とした場合、y[n]=a0・x[n]+a1・x[n−1]+a2・x[n−2]−b1・y[n−1]−b2・y[n−2]で表される積和演算(フィルタ演算)を、演算ビット数16ビットもしくは8ビットで行う。なお、ローパスフィルタ22には、対応する周波数帯域に適応させたフィルタ係数a0〜a2およびb1〜b2が予め設定される。   As in the first embodiment, the low-pass filter 22 is composed of the second-order IIR digital filter shown in FIG. 3, and the above-described equation (1), that is, the input x [n] and the output x [n] of the delay element 12a. n-1], output x [n-2] of the delay element 12b, output y [n-1] of the delay element 12c, and output y [n-2] of the delay element 12d, y [n] = a0 X [n] + a1 * x [n-1] + a2 * x [n-2] -b1 * y [n-1] -b2 * y [n-2] product-sum operation (filter operation) Is performed with 16 or 8 arithmetic bits. The low-pass filter 22 is preset with filter coefficients a0 to a2 and b1 to b2 adapted to the corresponding frequency band.

ところで、積和演算e=a×c+bを16ビットもしくは8ビットで行わせる場合、a,b,cの各語長を16ビット、aの上位/下位8ビットをそれぞれah,al、cの上位/下位8ビットをそれぞれch,clとすると、16ビットの積和演算はe=ah×ch×10000h+ah×cl×100h+al×ch×100h+al×cl+bとなり、8ビット演算の組合せで表現できる。なお、ここで10000hは16ビット上位シフト、100hは8ビット上位シフトを表す。一方、8ビットの積和演算は、上記16ビットの積和演算における下位8ビットを省略した形となり、e=ah×ch×10000h+bで表される。   By the way, when the product-sum operation e = a × c + b is performed by 16 bits or 8 bits, each word length of a, b, and c is 16 bits, and the upper / lower 8 bits of a are the higher order of ah, al, and c, respectively. / If the lower 8 bits are ch and cl, respectively, the 16-bit multiply-add operation is e = ah × ch × 10000h + ah × cl × 100h + al × ch × 100h + al × cl + b, which can be expressed by a combination of 8-bit operations. Here, 10000h represents a 16-bit upper shift, and 100h represents an 8-bit upper shift. On the other hand, the 8-bit multiply-accumulate operation has a form in which the lower 8 bits in the 16-bit multiply-accumulate operation are omitted, and is represented by e = ah × ch × 10000h + b.

したがって、積和演算e=a×c+bを16ビットもしくは8ビットで行うには、図8に図示する処理ロジックを実行することになる。図8において、40はaの上位8ビットah/下位8ビットalのいずれかを選択するセレクタ、41はcの上位8ビットch/下位8ビットclのいずれかを選択するセレクタである。42はセレクタ40の出力とセレクタ41の出力とを乗算する乗算器である。43は乗算器42の出力を16ビット上位シフトあるいは8ビット上位シフトするシフタである。44は乗算結果を累算する加算器である。45は前回の乗算結果を保持するラッチ、46は加算器44が出力する累算値を保持するラッチ、47はラッチ46が保持する値にbを加算する加算器である。   Therefore, in order to perform the product-sum operation e = a × c + b with 16 bits or 8 bits, the processing logic shown in FIG. 8 is executed. In FIG. 8, 40 is a selector for selecting either the upper 8 bits ah / lower 8 bits al of a, and 41 is a selector for selecting either the upper 8 bits ch / lower 8 bits cl of c. A multiplier 42 multiplies the output of the selector 40 and the output of the selector 41. A shifter 43 shifts the output of the multiplier 42 by 16 bits or 8 bits. An adder 44 accumulates the multiplication results. 45 is a latch that holds the previous multiplication result, 46 is a latch that holds the accumulated value output from the adder 44, and 47 is an adder that adds b to the value held by the latch 46.

上記処理ロジックにて16ビットの積和演算を行う場合には、セレクタ40、41およびシフタ43を適宜切り替えながらah×ch×10000h、ah×cl×100h、al×ch×100hおよびal×clの乗算を行い、その結果を累算した後にbを加える。一方、8ビットの積和演算は、ah×chの乗算結果を16ビット上位シフトした後にbを加える。
さて、こうした処理ロジックに基づき、ローパスフィルタ22は、y[n]=a0・x[n]+a1・x[n−1]+a2・x[n−2]−b1・y[n−1]−b2・y[n−2]なるフィルタ演算を行う。つまり、信号WLにて指定される16ビット/8ビットの処理ロジックに従い、a0・x[n]、a1・x[n−1]、a2・x[n−2]、−b1・y[n−1]および−b2・y[n−2]の各項について積和演算を行う。
When performing 16-bit multiply-accumulate operations in the above processing logic, ah × ch × 10000h, ah × cl × 100h, al × ch × 100h, and al × cl while appropriately switching the selectors 40 and 41 and the shifter 43. Multiply and accumulate the result, then add b. On the other hand, the 8-bit multiply-accumulate operation adds b after shifting the multiplication result of ah × ch by 16 bits.
Based on such processing logic, the low-pass filter 22 determines that y [n] = a0 · x [n] + a1 · x [n−1] + a2 · x [n−2] −b1 · y [n−1] −. A filter operation of b2 · y [n−2] is performed. That is, according to the processing logic of 16 bits / 8 bits specified by the signal WL, a0 · x [n], a1 · x [n−1], a2 · x [n-2], −b1 · y [n −1] and −b2 · y [n−2] terms are summed up.

(2)動作
次に、上記構成による第2実施例において制御部10が実行する語長割当処理およびローパスフィルタ22が実行するフィルタ演算タイマインタラプト処理の各動作を説明する。
(2) Operation Next, operations of the word length assignment process executed by the control unit 10 and the filter operation timer interrupt process executed by the low-pass filter 22 in the second embodiment having the above-described configuration will be described.

(a)語長割当処理の動作
制御部10では、CPU5から供給される楽音パラメータが更新される毎に、図9に示す語長割当処理を実行する。本処理が実行されると、制御部10は図9のステップSA1に処理を進め、ポインタiに初期値「1」をストアする。ポインタiは、フィルタユニット12−iが備えるエンベロープ検出器21の検出結果ENV[i]を指定する。次いで、ステップSA2では、ポインタiに対応する検出結果ENV[i]が予め定められる基準値以下であるか否かを判断する。検出結果ENV[i]が基準値以下であると、判断結果は「YES」になり、ステップSA3に進み、レジスタWL[i]に「0」をセットし、8ビットのフィルタ演算を行うようローパスフィルタ22に指示する。
(A) Operation of Word Length Allocation Processing The control unit 10 executes the word length allocation processing shown in FIG. 9 every time the musical tone parameter supplied from the CPU 5 is updated. When this process is executed, the control unit 10 advances the process to step SA1 in FIG. 9, and stores the initial value “1” in the pointer i. The pointer i designates the detection result ENV [i] of the envelope detector 21 included in the filter unit 12-i. Next, in step SA2, it is determined whether or not the detection result ENV [i] corresponding to the pointer i is equal to or less than a predetermined reference value. If the detection result ENV [i] is less than or equal to the reference value, the determination result is “YES”, the process proceeds to step SA3, “0” is set in the register WL [i], and the low pass is performed so as to perform the 8-bit filter operation. The filter 22 is instructed.

一方、検出結果ENV[i]が基準値を超えていれば、判断結果が「NO」になり、ステップSA4に進み、レジスタWL[i]に「1」をセットし、16ビットのフィルタ演算を行うようローパスフィルタ22に指示する。そして、ステップSA5では、ポインタiをインクリメントして歩進させ、続くステップSA6では、歩進されたポインタiが「3」を超えたか否か、つまり、フィルタユニット12−1〜12−3の各ローパスフィルタ22にフィルタ演算の演算ビット数を指示し終えたかどうかを判断する。指示し終えていなければ、判断結果は「NO」になり、上述のステップSA2以降を繰り返す。そして、演算ビット数を指示し終えると、判断結果が「YES」になり、本処理を完了させる。   On the other hand, if the detection result ENV [i] exceeds the reference value, the determination result is “NO”, the process proceeds to step SA4, “1” is set in the register WL [i], and a 16-bit filter operation is performed. The low-pass filter 22 is instructed to do so. In step SA5, the pointer i is incremented and incremented, and in the subsequent step SA6, whether or not the incremented pointer i exceeds “3”, that is, each of the filter units 12-1 to 12-3. It is determined whether or not the low-pass filter 22 has been instructed about the number of calculation bits for the filter calculation. If the instruction has not been completed, the determination result is “NO”, and the above steps SA2 and after are repeated. When the instruction on the number of calculation bits is completed, the determination result is “YES”, and this processing is completed.

このように、制御部10では、CPU5から供給される楽音パラメータが更新される毎に、各周波数帯域のエンベロープレベルが予め定められる基準値を超えるかどうかを判断し、エンベロープレベルが基準値以下であると、その周波数帯域でローパスフィルタリングするローパスフィルタ22に、8ビット演算を指示し、一方、エンベロープレベルが基準値を超えれば、その周波数帯域でローパスフィルタリングするローパスフィルタ22に、16ビット演算を指示するようになっている。   Thus, every time the musical tone parameter supplied from the CPU 5 is updated, the control unit 10 determines whether or not the envelope level of each frequency band exceeds a predetermined reference value, and the envelope level is below the reference value. If there is, the low-pass filter 22 that performs low-pass filtering in the frequency band is instructed to perform 8-bit arithmetic. On the other hand, if the envelope level exceeds the reference value, the low-pass filter 22 that performs low-pass filtering in the frequency band is instructed to perform 16-bit arithmetic. It is supposed to be.

(b)フィルタ演算タイマインタラプト処理
ローパスフィルタ22では、一定周期毎に本処理を割込み実行しており、実行タイミングになると、制御部10が指示する演算ビット数に従い、図8に図示した処理ロジックに基づくフィルタ演算、すなわちステップSB1〜SB16を実行する。
先ずステップSB1では、フィルタユニット12−1〜12−3を識別するフィルタ番号mに「1」をセットすると共に、加算値bをゼロリセットする。次いで、ステップSB2では、項番号sに「1」をセットする。項番号sとは、前述した(1)式で表されるフィルタ演算式の項を指定する。具体的には、項番号s=1はa0・x[n]を、項番号s=2はa1・x[n−1]を、項番号s=3はa2・x[n−2]を、項番号s=4は−b1・y[n−1]を、項番号s=5は−b2・y[n−2]を指定する。
(B) Filter calculation timer interrupt process The low-pass filter 22 interrupts and executes this process at regular intervals. When the execution timing comes, the processing logic shown in FIG. Based on the filter operation, that is, steps SB1 to SB16 are executed.
First, in step SB1, “1” is set to the filter number m for identifying the filter units 12-1 to 12-3, and the addition value b is reset to zero. Next, in step SB2, “1” is set to the item number s. The term number s designates the term of the filter operation expression represented by the above-described equation (1). Specifically, the term number s = 1 is a0 · x [n], the term number s = 2 is a1 · x [n−1], and the term number s = 3 is a2 · x [n-2]. The term number s = 4 designates -b1 · y [n-1], and the term number s = 5 designates -b2 · y [n-2].

ステップSB3では、項番号sの信号値をレジスタaに、項番号sのフィルタ係数をレジスタcにそれぞれストアし、続くステップSB4では、積和演算項kに「1」をセットすると共に、レジスタDL1をゼロリセットする。積和演算項kは、図8の処理ロジック中のah×ch×10000h(k=1)、ah×cl×100h(k=2)、al×ch×100h(k=3)およびal×cl(k=4)を指定する。レジスタDL1は、図8に図示する処理ロジック中のラッチ45の値を保持する。   In step SB3, the signal value of the term number s is stored in the register a and the filter coefficient of the term number s is stored in the register c. In the subsequent step SB4, “1” is set in the product-sum operation term k and the register DL1 Reset to zero. The product-sum operation term k is ah × ch × 10000h (k = 1), ah × cl × 100h (k = 2), al × ch × 100h (k = 3) and al × cl in the processing logic of FIG. Specify (k = 4). The register DL1 holds the value of the latch 45 in the processing logic illustrated in FIG.

次に、ステップSB5では、積和演算項kの値に応じた処理を実行させる。すなわち、積和演算項kが「1」の場合、つまり図8の処理ロジック中のah×ch×10000hを実行するには、ステップSB6に処理を進め、レジスタa(信号値)の上位8ビットahをレジスタDS1に、レジスタc(フィルタ係数)の上位8ビットchをレジスタDS2にそれぞれストアすると共に、ビットシフト値を保持するレジスタLSに「16」をセットする。
積和演算項kが「2」の場合、つまり図8の処理ロジック中のah×cl×100hを実行するには、ステップSB7に処理を進め、レジスタa(信号値)の上位8ビットahをレジスタDS1に、レジスタc(フィルタ係数)の下位8ビットclをレジスタDS2にそれぞれストアすると共に、ビットシフト値を保持するレジスタLSに「8」をセットする。
Next, in step SB5, processing according to the value of the product-sum operation term k is executed. That is, when the product-sum operation term k is “1”, that is, in order to execute ah × ch × 10000h in the processing logic of FIG. 8, the process proceeds to step SB6 and the upper 8 bits of the register a (signal value) The ah is stored in the register DS1, the upper 8 bits ch of the register c (filter coefficient) are stored in the register DS2, and “16” is set in the register LS that holds the bit shift value.
When the product-sum operation term k is “2”, that is, to execute ah × cl × 100h in the processing logic of FIG. 8, the process proceeds to step SB7, and the upper 8 bits ah of the register a (signal value) are set. The lower 8 bits cl of the register c (filter coefficient) are stored in the register DS1, respectively, and “8” is set in the register LS holding the bit shift value.

積和演算項kが「3」の場合、つまり図8の処理ロジック中のal×ch×100hを実行するには、ステップSB8に処理を進め、レジスタa(信号値)の下位8ビットalをレジスタDS1に、レジスタc(フィルタ係数)の上位8ビットchをレジスタDS2にそれぞれストアすると共に、ビットシフト値を保持するレジスタLSに「8」をセットする。
積和演算項kが「4」の場合、つまり図8の処理ロジック中のal×clを実行するには、ステップSB8に処理を進め、レジスタa(信号値)の下位8ビットalをレジスタDS1に、レジスタc(フィルタ係数)の下位8ビットclをレジスタDS2にそれぞれストアすると共に、ビットシフト値を保持するレジスタLSをゼロリセットする。
When the product-sum operation term k is “3”, that is, to execute al × ch × 100h in the processing logic of FIG. 8, the process proceeds to step SB8 and the lower 8 bits al of the register a (signal value) are set. The upper 8 bits ch of the register c (filter coefficient) are stored in the register DS1 in the register DS2, and “8” is set in the register LS that holds the bit shift value.
When the product-sum operation term k is “4”, that is, to execute al × cl in the processing logic of FIG. 8, the process proceeds to step SB8, and the lower 8 bits al of the register a (signal value) are stored in the register DS1. In addition, the lower 8 bits cl of the register c (filter coefficient) are stored in the register DS2, respectively, and the register LS holding the bit shift value is reset to zero.

こうして、積和演算項kの値に対応したデータをレジスタDS1、DS2、LSにセットし終えると、ステップSB10に進む。ステップSB10では、レジスタDS1の値とレジスタDS2の値とを乗算した結果を、レジスタLSの値分上位ビットシフトさせ、その値をレジスタDL1,DL2に加算する。そして、ステップSB11に進み、積和演算項kをインクリメントして歩進させる。
次に、ステップSB12では、フィルタ番号mに対応するレジスタWL[m]の値が「1」であって、積和演算項kが「5」より小さいかどうかを判断する。つまり、制御部10から16ビット演算指示を受け、しかもその積和演算の途中であるかどうかを判断する。
When the data corresponding to the value of the product-sum operation term k is thus set in the registers DS1, DS2, and LS, the process proceeds to step SB10. In step SB10, the result of multiplying the value of the register DS1 and the value of the register DS2 is shifted by the upper bits by the value of the register LS, and the value is added to the registers DL1 and DL2. In step SB11, the product-sum operation term k is incremented and stepped.
Next, in step SB12, it is determined whether the value of the register WL [m] corresponding to the filter number m is “1” and the product-sum operation term k is smaller than “5”. That is, a 16-bit operation instruction is received from the control unit 10 and it is determined whether or not the product-sum operation is in progress.

16ビット演算指示に従った積和演算の途中であれば、判断結果は「YES」になり、ステップSB5に処理を戻す。以後、積和演算項k=4の積和演算を終えるまでステップSB5〜SB12を繰り返す。そして、全ての積和演算を終えて積和演算項kが「5」になると、ステップSB12の判断結果は「NO」になり、ステップSB13に進む。一方、8ビット演算指示を受けた場合には、上記ステップSB12の判断結果は「NO」になり、ステップSB13に進む。
ステップSB13では、レジスタDL2に加算値bを加算した結果をレジスタeにセットした後、そのレジスタeの値を加算値bにセットし直す。また、ステップSB13では、項番号sを歩進させる。
If it is in the middle of the product-sum operation according to the 16-bit operation instruction, the determination result is “YES”, and the process returns to step SB5. Thereafter, steps SB5 to SB12 are repeated until the product-sum operation of the product-sum operation term k = 4 is completed. When all the product-sum operations are completed and the product-sum operation term k becomes “5”, the determination result in step SB12 is “NO”, and the process proceeds to step SB13. On the other hand, if an 8-bit calculation instruction is received, the determination result in step SB12 is “NO”, and the flow advances to step SB13.
In step SB13, the result of adding the addition value b to the register DL2 is set in the register e, and then the value of the register e is reset to the addition value b. In step SB13, the item number s is incremented.

続いて、ステップSB14では、歩進された項番号sが「5」を超えたか、つまりフィルタ演算し終えたかどうかを判断する。フィルタ演算し終えていなければ、判断結果は「NO」になり、上述したステップSB3に処理を戻す。以後、フィルタ演算し終えるまでステップSB3〜SB13を繰り返す。そして、a0・x[n]から−b2・y[n−2]までの全ての項のフィルタ演算を行うと、ステップSB14の判断結果が「YES」となり、ステップSB15に進む。ステップSB15ではフィルタ番号mを歩進させ、続くステップSB16では歩進されたフィルタ番号mが「3」を超えたか否か、すなわち全てのフィルタユニット12−1〜12−3においてフィルタ演算を行ったかどうかを判断する。その途中であると、判断結果は「NO」になり、ステップSB2に処理を戻す。一方、全てのフィルタユニット12−1〜12−3においてフィルタ演算を終えると、判断結果が「YES」になり、本処理を完了させる。   Subsequently, in step SB14, it is determined whether or not the incremented item number s exceeds “5”, that is, whether or not the filter operation has been completed. If the filter operation has not been completed, the determination result is “NO”, and the process returns to step SB3 described above. Thereafter, steps SB3 to SB13 are repeated until the filter operation is completed. When the filter calculation is performed for all terms from a0 · x [n] to −b2 · y [n−2], the determination result in step SB14 is “YES”, and the flow proceeds to step SB15. In step SB15, the filter number m is incremented, and in the subsequent step SB16, whether or not the incremented filter number m exceeds “3”, that is, whether all the filter units 12-1 to 12-3 have performed the filter operation. Judge whether. If it is halfway, the determination result is “NO”, and the process returns to step SB2. On the other hand, when the filter operation is finished in all the filter units 12-1 to 12-3, the determination result is “YES”, and this processing is completed.

以上のように、第2実施例によるフィルタ装置は、波形発生器11(不図示)から供給される入力波形を第1〜第3の周波数帯域に分別し、それら各周波数帯域毎に入力波形のエンベロープレベルを検出し、検出したエンベロープレベルが予め設定される基準値を超えた場合には16ビットのフィルタ演算を、基準値以下なら8ビットのフィルタ演算を行う。
つまり換言すると、波形レベルが大きく聴覚的に耳につきやすい周波数帯域では精度の高いフィルタリングを、波形レベルが小さく聴覚的に目立たない周波数帯域では精度の低いフィルタリングを行わせるようにし、これにより回路規模増大と処理速度低下を招致することなく聴感上の音質向上を図るようになっている。
As described above, the filter device according to the second embodiment classifies the input waveform supplied from the waveform generator 11 (not shown) into the first to third frequency bands, and the input waveform for each frequency band. An envelope level is detected, and if the detected envelope level exceeds a preset reference value, a 16-bit filter operation is performed, and if it is less than the reference value, an 8-bit filter operation is performed.
In other words, high-accuracy filtering is performed in the frequency band where the waveform level is large and easily audible, and low-accuracy filtering is performed in the frequency band where the waveform level is small and not audibly conspicuous, thereby increasing the circuit scale. As a result, it is possible to improve the sound quality on hearing without incurring a decrease in processing speed.

C.変形例
上述した第2実施例では、入力波形のエンベロープレベルに応じてフィルタ演算の演算ビット数を指示するようにしたが、これに替えて、例えば図11に示すように、波形種nおよび音高pに応じて、フィルタユニット12−1〜12−3にそれぞれ与える演算ビット数WL[n,p,1]〜[n,p,3]を読み出す語長割当テーブルTBLを制御部10に設けておき、CPU5から供給される楽音パラメータに従い、制御部10が語長割当テーブルTBLから対応する演算ビット数WL[n,p,1]〜[n,p,3]を読み出してフィルタユニット12−1〜12−3に供給する態様としてもよい。
C. In the second embodiment described above, the number of calculation bits for the filter operation is specified according to the envelope level of the input waveform. Instead, for example, as shown in FIG. The control unit 10 is provided with a word length allocation table TBL for reading out the number of operation bits WL [n, p, 1] to [n, p, 3] to be given to the filter units 12-1 to 12-3 according to the height p. In accordance with the musical tone parameter supplied from the CPU 5, the control unit 10 reads out the corresponding operation bit number WL [n, p, 1] to [n, p, 3] from the word length allocation table TBL, and the filter unit 12- It is good also as an aspect supplied to 1-12-3.

具体的には、制御部10が図12に図示する語長割当処理を一定周期毎に割込み実行する。実行タイミングになると、ステップSC1に進み、CPU5から供給される楽音パラメータが波形または音高の変化を指示するものであるか否かを判断する。波形または音高の変化を指示するものでなければ、判断結果は「NO」となり、何も行わずに本処理を完了させる。
一方、波形または音高の変化を指示するものであると、判断結果が「YES」になり、ステップSC2に進み、変更された波形種nまたは音高pに対応する演算ビット数WL[n,p,1]〜[n,p,3]を語長割当テーブルTBLから読み出し、それぞれをフィルタユニット12−1〜12−3に送出して本処理を終える。
このような変形例によれば、波形または音高の変化に対応した最適な演算ビット数のフィルタリングを即座に指示出来、しかもエンベロープ検出する構成を省くことができるから、回路規模増大や処理速度低下を招致することなく聴感上の音質向上を図ることが可能になる。
Specifically, the control unit 10 interrupts and executes the word length allocation process shown in FIG. 12 at regular intervals. When the execution timing is reached, the process proceeds to step SC1, and it is determined whether or not the musical tone parameter supplied from the CPU 5 indicates a change in waveform or pitch. If the change of the waveform or pitch is not instructed, the determination result is “NO”, and this process is completed without doing anything.
On the other hand, if a change in waveform or pitch is instructed, the determination result is “YES”, the process proceeds to step SC2, and the number of calculation bits WL [n, n corresponding to the changed waveform type n or pitch p is reached. p, 1] to [n, p, 3] are read from the word length assignment table TBL, and each is sent to the filter units 12-1 to 12-3 to complete the process.
According to such a modified example, it is possible to immediately instruct the filtering of the optimum number of calculation bits corresponding to the change in the waveform or the pitch, and the configuration for detecting the envelope can be omitted, so that the circuit scale increases and the processing speed decreases. It is possible to improve the audible sound quality without inviting sound.

1 鍵盤
2 スイッチ部
3 ROM
4 RAM
5 CPU
6 音源
7 D/A変換器
8 サウンドシステム
9 スピーカ
10 制御部
11 波形発生器
12 フィルタ部
13 係数テーブル
14 振幅補間器
14a補間係数発生器
14bリングバッファ
14c,14d 乗算器
14e加算器
1 Keyboard 2 Switch 3 ROM
4 RAM
5 CPU
6 Sound source 7 D / A converter 8 Sound system 9 Speaker 10 Control unit 11 Waveform generator 12 Filter unit 13 Coefficient table 14 Amplitude interpolator 14a Interpolation coefficient generator 14b Ring buffer 14c, 14d Multiplier 14e Adder

Claims (4)

入力波形を複数の周波数帯域に分割し、分割された各周波数帯域毎のエンベロープレベルを検出する検出手段と、
この検出手段により検出されたエンベロープレベルが所定値を超えた周波数帯域について第1の演算ビット数のフィルタ演算を指示し、所定値以下の周波数帯域について第2の演算ビット数のフィルタ演算を指示する指示手段と、
前記複数の周波数帯域に対応して設けられ、前記指示手段から指示される第1および第2の演算ビット数のいずれかのフィルタ演算を、対応する周波数帯域の入力波形に施すフィルタ手段と
を具備することを特徴とするフィルタ装置。
Detecting means for dividing an input waveform into a plurality of frequency bands and detecting an envelope level for each divided frequency band;
The filter operation of the first calculation bit number is instructed for the frequency band in which the envelope level detected by the detection means exceeds the predetermined value, and the filter operation of the second operation bit number is instructed for the frequency band below the predetermined value. Indicating means;
Filter means provided corresponding to the plurality of frequency bands, and applying a filter operation of any of the first and second calculation bit numbers indicated by the instruction means to an input waveform of the corresponding frequency band. A filter device characterized by:
入力波形を複数の周波数帯域に分割する帯域分割手段と、
前記複数の周波数帯域毎に、前記入力波形の波形種および音高に対応付けた演算ビット数を予め記憶する記憶手段と、
前記入力波形の波形種および音高を表す楽音パラメータに応じて、前記記憶手段から対応する演算ビット数を読み出して各周波数帯域に割当てる割当て手段と、
前記複数の周波数帯域に対応して設けられ、前記割当て手段により割当てられた演算ビット数のフィルタ演算を、対応する周波数帯域の入力波形に施すフィルタ手段と
を具備することを特徴とするフィルタ装置。
A band dividing means for dividing the input waveform into a plurality of frequency bands;
Storage means for storing in advance the number of calculation bits associated with the waveform type and pitch of the input waveform for each of the plurality of frequency bands;
In accordance with a musical tone parameter indicating the waveform type and pitch of the input waveform, an assigning unit that reads out the corresponding number of calculation bits from the storage unit and assigns it to each frequency band;
And a filter unit that is provided corresponding to the plurality of frequency bands and that performs a filter operation of the number of operation bits assigned by the assigning unit on an input waveform in the corresponding frequency band.
入力波形を複数の周波数帯域に分割し、分割された各周波数帯域毎のエンベロープレベルを検出する検出ステップと、
この検出ステップにて検出されたエンベロープレベルが所定値を超えた周波数帯域について第1の演算ビット数のフィルタ演算を指示し、所定値以下の周波数帯域について第2の演算ビット数のフィルタ演算を指示する指示ステップと、
前記複数の周波数帯域に対応して実行され、前記指示ステップで指示される第1および第2の演算ビット数のいずれかのフィルタ演算を、対応する周波数帯域の入力波形に施すフィルタリングステップと
をコンピュータで実行させることを特徴とするフィルタ処理プログラム。
A detection step of dividing an input waveform into a plurality of frequency bands and detecting an envelope level for each of the divided frequency bands;
The filter operation of the first calculation bit number is instructed for the frequency band in which the envelope level detected in the detection step exceeds the predetermined value, and the filter operation of the second calculation bit number is instructed for the frequency band below the predetermined value. An instruction step to
A filtering step that is executed corresponding to the plurality of frequency bands, and that performs a filter operation of any one of the first and second calculation bit numbers indicated in the indicating step on an input waveform in the corresponding frequency band; A filter processing program that is executed by the program.
入力波形を複数の周波数帯域に分割する帯域分割ステップと、
前記複数の周波数帯域毎に、前記入力波形の波形種および音高に対応付けた演算ビット数を予め記憶しておき、前記入力波形の波形種および音高を表す楽音パラメータに応じて、対応する演算ビット数を読み出して各周波数帯域に割当てる割当てステップと、
前記複数の周波数帯域に対応して実行され、前記割当てステップにて割当てられた演算ビット数のフィルタ演算を、対応する周波数帯域の入力波形に施すフィルタリングステップと
をコンピュータで実行させることを特徴とするフィルタ処理プログラム。
A band dividing step for dividing the input waveform into a plurality of frequency bands;
For each of the plurality of frequency bands, the number of calculation bits associated with the waveform type and pitch of the input waveform is stored in advance, and the number of calculation bits corresponding to the musical sound parameter representing the waveform type and pitch of the input waveform is stored. An assignment step of reading out the number of operation bits and assigning it to each frequency band;
A filtering step that is executed in correspondence with the plurality of frequency bands and that performs a filtering operation of the number of calculation bits assigned in the assignment step on an input waveform in the corresponding frequency band, Filter processing program.
JP2009122641A 2009-05-21 2009-05-21 Filter device and filter processing program Expired - Fee Related JP4983858B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009122641A JP4983858B2 (en) 2009-05-21 2009-05-21 Filter device and filter processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009122641A JP4983858B2 (en) 2009-05-21 2009-05-21 Filter device and filter processing program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2003177557A Division JP2005012728A (en) 2003-06-23 2003-06-23 Filter device and filter processing program

Publications (2)

Publication Number Publication Date
JP2009183007A JP2009183007A (en) 2009-08-13
JP4983858B2 true JP4983858B2 (en) 2012-07-25

Family

ID=41036542

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009122641A Expired - Fee Related JP4983858B2 (en) 2009-05-21 2009-05-21 Filter device and filter processing program

Country Status (1)

Country Link
JP (1) JP4983858B2 (en)

Also Published As

Publication number Publication date
JP2009183007A (en) 2009-08-13

Similar Documents

Publication Publication Date Title
US7612281B2 (en) Reverberation effect adding device
JP6391265B2 (en) Electronic keyboard instrument
JPS6147435B2 (en)
JPH06195073A (en) Effect adding device
JP4702392B2 (en) Resonant sound generator and electronic musical instrument
CN101149916A (en) Filter device and electronic musical instrument using the filter device
JPH04289900A (en) Digital pitch shifter
JP4983858B2 (en) Filter device and filter processing program
JP2009175677A (en) Resonance sound adding device and electronic musical instrument
JP2005012728A (en) Filter device and filter processing program
CN113453120B (en) Effect applying device, method and storage medium
JP2009025589A (en) Resonance sound adding device of electronic musical instrument and electronic musical instrument
JP5169753B2 (en) Resonance sound adding device and electronic musical instrument
JP3658826B2 (en) Music generation method
JP3341777B2 (en) Effect giving device
JP3435702B2 (en) Music generator
JP5029898B2 (en) Tone generator and tone generator processing program
JPH04116598A (en) Musical sound signal generation device
WO2020195041A1 (en) Filter effect imparting device, electronic musical instrument, and control method for electronic musical instrument
JP2608938B2 (en) Waveform interpolation device
JP2008107682A (en) Filter device and electronic musical instrument
JP2007286503A (en) Envelope generator
JP2671825B2 (en) Waveform synthesizer
JPH0320797A (en) Sampling electronic musical instrument
JPH06202624A (en) Tuning state display device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090521

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

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

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4983858

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150511

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees