JP3149466B2 - Pitch extraction device and electronic musical instrument using the same - Google Patents

Pitch extraction device and electronic musical instrument using the same

Info

Publication number
JP3149466B2
JP3149466B2 JP18748691A JP18748691A JP3149466B2 JP 3149466 B2 JP3149466 B2 JP 3149466B2 JP 18748691 A JP18748691 A JP 18748691A JP 18748691 A JP18748691 A JP 18748691A JP 3149466 B2 JP3149466 B2 JP 3149466B2
Authority
JP
Japan
Prior art keywords
pitch
zero
processing
interval
value
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
JP18748691A
Other languages
Japanese (ja)
Other versions
JPH0535296A (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 JP18748691A priority Critical patent/JP3149466B2/en
Publication of JPH0535296A publication Critical patent/JPH0535296A/en
Application granted granted Critical
Publication of JP3149466B2 publication Critical patent/JP3149466B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Electrophonic Musical Instruments (AREA)

Abstract

PURPOSE:To exactly detect the frequencies whatever the frequencies of input sound signals are by switching and selecting the output of a pitch extracting method through the use of a zero cross detection and the output of a pitch extracting method through the use of a digital filtering in accordance with the pitch frequency. CONSTITUTION:The note.number.pit value, which correspond to the pitch obtained by a zero cross detection method, and the prescribed musical scale are compared and a pronunciation processing is executed against a musical pronunciation circuit based on the processing results of the zero cross detection method when the input sound signal pitch is low and conversely when the input sound signal pitch is high, the processing is executed based on the processing results of the filter processing method. That is to say, a DSP 116 performs the zero cross detection or the filter process using a ROM 117 which stores a conversion table that converts from the various coefficients for digital filter operation based on the sound signals and pitch period to the note.number and a work RAM 18 which stores various data.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、入力された音響信号か
ら、その波形のピッチ(音階)を抽出するピッチ抽出装
置及びそれを用いた電子楽器に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a pitch extracting apparatus for extracting a pitch (scale) of a waveform from an input acoustic signal, and an electronic musical instrument using the same.

【0002】[0002]

【従来の技術】従来から、例えば人が歌う歌声やマイク
ロフォンから採取した楽音などの繰り返し波形からなる
音声信号から、そのピッチ周波数又はピッチ周期(以
下、単に「ピッチ」と呼ぶ)を抽出したいという要請が
強い。ピッチを抽出できれば、例えば、そのピッチに対
応する楽音を電子楽器等から発音させることができるよ
うになるなど、抽出されたピッチ情報を様々な処理に用
いることが可能となる。
2. Description of the Related Art Conventionally, there has been a demand for extracting a pitch frequency or a pitch period (hereinafter simply referred to as "pitch") from an audio signal having a repetitive waveform such as a singing voice sung by a person or a musical tone collected from a microphone. Is strong. If the pitch can be extracted, the extracted pitch information can be used for various processes, for example, a musical tone corresponding to the pitch can be generated from an electronic musical instrument or the like.

【0003】従来から、音声信号からピッチを抽出する
技術として種々の手法が提案されている。ピッチ抽出方
式の第1の代表的な従来例として、例えば本出願人が特
願平3−120291で開示したように、入力された音
響信号の隣接するゼロクロス点(振幅が0となる時間位
置)の間の時間をその波形のピッチ周期として求める方
式がある。
Conventionally, various techniques have been proposed as techniques for extracting a pitch from an audio signal. As a first representative conventional example of the pitch extraction method, for example, as disclosed in Japanese Patent Application No. 3-120291 by the present applicant, adjacent zero-cross points (time positions where the amplitude becomes 0) of an input audio signal. Is determined as the pitch period of the waveform.

【0004】ピッチ抽出方式の第2の代表的な従来例と
して、例えば本出願人が特願平2−123789で開示
したように、各音階に対応するバンドパスフィルタを各
々設け、各フィルタを介して各音階に対応する周波数に
関する周波数スペクトルのレベルを検知し、レベルが最
大になった周波数をピッチ周波数として求める方式が
る。
As a second representative conventional example of the pitch extraction system, for example, as disclosed by the present applicant in Japanese Patent Application No. Hei 2-123789, band pass filters corresponding to respective musical scales are provided, and each filter is provided with a filter. In this method, the level of the frequency spectrum related to the frequency corresponding to each scale is detected, and the frequency having the maximum level is determined as the pitch frequency.

【0005】[0005]

【発明が解決しようとする課題】しかし、第1の従来例
では、入力される音響信号のピッチ周波数が高くなる
と、ピッチ周期が短くなりすぎてしまい、正確なピッチ
周期を求めるのが困難になるという問題点を有してい
る。
However, in the first conventional example, when the pitch frequency of the input acoustic signal becomes high, the pitch period becomes too short, and it is difficult to obtain an accurate pitch period. There is a problem that.

【0006】また、第2の従来例では、それがアナログ
回路によって構成される場合にはバンドパスフィルタを
複数組設けなければならず、回路規模が大きくなってし
まうという問題点を有している。
Further, the second conventional example has a problem that when it is constituted by an analog circuit, a plurality of band-pass filters must be provided, and the circuit scale becomes large. .

【0007】これに対して、時分割で動作するディジタ
ルフィルタによって複数のバンドパスフィルタを実現す
れば、回路規模を小さくすることができる。しかし、入
力される音響信号のピッチ周波数が低くなると、低帯域
のバンドパスフィルタを構成しなければならないためフ
ィルタ係数の値が大きくなり、そのフィルタ係数を表現
するために必要なビット数が、ディジタルフィルタを実
現する例えばDSP(ディジタル信号処理プロセッサ)
の許容ビット数をオーバーしてしまうという問題が発生
する。
On the other hand, if a plurality of bandpass filters are realized by digital filters operating in a time-division manner, the circuit scale can be reduced. However, when the pitch frequency of the input acoustic signal decreases, the value of the filter coefficient increases because a low-band bandpass filter must be configured, and the number of bits required to express the filter coefficient becomes digital. For example, a DSP (Digital Signal Processor) that realizes a filter
The number of bits exceeds the allowable bit number.

【0008】また、ピッチ抽出装置の第2の従来例が楽
器の音階検出装置として使用される場合、高い音階域の
音階周波数の差は、例えばA6 =1760[Hz]とA
#6=1867[Hz]の差の107[Hz]のように、
比較的大きい周波数差となるが、低い音階域の音階周波
数の差は、例えばA2 =110[Hz]とA#2=116
[Hz]の差の7[Hz]のように、僅かな周波数差に
しかならない。従って、低い音階域ほどカットオフ周波
数の急俊なバンドパスフィルタを構成しなければなら
ず、その結果バンドパスフィルタの次数が高くなってD
SP等によるリアルタイム処理が不可能になってしまう
という問題点を有している。
When the second conventional example of the pitch extracting device is used as a musical scale detecting device, the difference between the scale frequencies in the high scale region is, for example, A6 = 1760 [Hz] and A
# 6 = 1867 [Hz] difference of 107 [Hz]
Although the frequency difference is relatively large, the difference between the scale frequencies in the lower scale region is, for example, A2 = 110 [Hz] and A # 2 = 116.
There is only a slight frequency difference, such as 7 [Hz] which is the difference between [Hz]. Therefore, a band-pass filter having a sharper cut-off frequency must be formed in a lower scale region, and as a result, the order of the band-pass filter becomes higher and D
There is a problem that real-time processing by SP or the like becomes impossible.

【0009】本発明の課題は、入力する音響信号が如何
なるピッチ周波数を有していてもそれを正確に検出可能
とすることにある。
An object of the present invention is to make it possible to accurately detect any pitch frequency of an input acoustic signal, regardless of the pitch frequency.

【0010】[0010]

【課題を解決するための手段】本発明は、まず、入力さ
れる音響信号から値が負又は正の第1の極性から他方の
第2の極性へ変化するゼロクロス点を順次検出し、それ
ら各ゼロクロス点間の間隔から音響信号のピッチ情報を
検出する第1のピッチ検出手段を有する。同手段は、例
えば音響信号の極性が所定方向に変化するゼロクロス点
からその次の極性が逆方向に変化するゼロクロス点まで
のゼロクロス間隔を順次求め、順次求まるゼロクロス間
隔が一致したときの一方のゼロクロス間隔の先頭のゼロ
クロス点から他方のゼロクロス間隔の先頭のゼロクロス
点までの間隔から音響信号のピッチ周期を検出する。
According to the present invention, first, a zero-cross point at which a value changes from a negative or positive first polarity to another second polarity is sequentially detected from an input acoustic signal. There is provided a first pitch detecting means for detecting pitch information of the audio signal from an interval between the zero cross points. The means sequentially obtains, for example, a zero-crossing interval from a zero-crossing point at which the polarity of the sound signal changes in a predetermined direction to a zero-crossing point at which the next polarity changes in the opposite direction, and one zero-crossing when the sequentially obtained zero-crossing intervals match. The pitch period of the sound signal is detected from the interval from the leading zero-cross point of the interval to the leading zero-cross point of the other zero-cross interval.

【0011】次に、音響信号に対して異なる特性のディ
ジタルフィルタリング処理を時分割で順次行うことによ
り、その処理に対応する各々所定の複数の周波数に関す
る各周波数スペクトルのレベルを検出し、これら各周波
数スペクトルのレベルを判定することによって音響信号
のピッチ情報を検出する第2のピッチ検出手段を有す
る。同手段は、例えば所定の特性のハイパスフィルタリ
ング処理と、上述した各所定の周波数でピークを有する
レゾナンスが付加された各ローパスフィルタリング処理
とを音響信号に対して時分割のカスケード処理として順
次実行し、更に、その結果得られる各所定の周波数に対
応する各出力信号から各エンベロープ成分を抽出するロ
ーパスフィルタ処理等の信号処理を時分割で順次実行
し、それにより得られる各所定の周波数に対応する各エ
ンベロープ成分として上述の各周波数スペクトルのレベ
ルを検出する。そして、例えば、これら各周波数スペク
トルのレベルのうち値が最大となるレベルに対応する周
波数としてピッチ情報が検出される。
Next, digital filtering processes having different characteristics are sequentially performed on the audio signal in a time-division manner, whereby the level of each frequency spectrum for a plurality of predetermined frequencies corresponding to the process is detected. A second pitch detecting unit that detects pitch information of the acoustic signal by determining a level of the spectrum; The same means, for example, sequentially executes a high-pass filtering process of a predetermined characteristic and each low-pass filtering process to which the resonance having a peak at each of the predetermined frequencies is added as a time-division cascade process on the audio signal, Further, signal processing such as low-pass filter processing for extracting each envelope component from each output signal corresponding to each predetermined frequency obtained as a result is sequentially performed in a time-division manner, and each signal corresponding to each predetermined frequency obtained thereby is obtained. The level of each frequency spectrum described above is detected as an envelope component. Then, for example, the pitch information is detected as a frequency corresponding to the level having the maximum value among the levels of these frequency spectra.

【0012】更に、第1又は第2のピッチ検出手段の何
れかで検出されたピッチ情報が所定の周波数閾値以下の
ピッチ周波数に対応しているならば第1のピッチ検出手
段からのピッチ情報を出力し、所定の周波数閾値以上の
ピッチ周波数に対応しているならば第2のピッチ検出手
段からのピッチ情報を出力する選択手段を有する。
Further, if the pitch information detected by any of the first and second pitch detecting means corresponds to a pitch frequency equal to or lower than a predetermined frequency threshold, the pitch information from the first pitch detecting means is used. Output means for outputting pitch information from the second pitch detection means if the pitch frequency corresponds to a pitch frequency equal to or higher than a predetermined frequency threshold.

【0013】本発明は、以上の構成を有するピッチ抽出
装置からのピッチ情報を用いることにより、そのピッチ
情報に対応する音階の楽音を発生する楽音発生手段を更
に有するような電子楽器として構成することもできる。
According to the present invention, there is provided an electronic musical instrument having a tone generating means for generating a musical tone of a musical scale corresponding to the pitch information by using the pitch information from the pitch extracting apparatus having the above configuration. Can also.

【0014】[0014]

【作用】「発明が解決しようとする課題」において説明
したように、ゼロクロス検出によるピッチ抽出方式は、
入力される音響信号のピッチ周波数が低い範囲では良い
性能を発揮する。一方、ディジタルフィルタリングによ
るピッチ抽出方式は、入力される音響信号のピッチ周波
数が高い範囲では良い性能を発揮する。
As described in "Problems to be Solved by the Invention", the pitch extraction method based on zero-cross detection is as follows.
Good performance is exhibited in a range where the pitch frequency of the input acoustic signal is low. On the other hand, the pitch extraction method using digital filtering exhibits good performance in a range where the pitch frequency of the input audio signal is high.

【0015】そこで、本発明では、これら2つの方式の
出力をピッチ周波数に応じて切替えて選択することによ
り、両者の長所を生かした高精度なピッチ抽出を実現す
ることができる。
Therefore, in the present invention, high-precision pitch extraction utilizing both advantages can be realized by switching and selecting the output of these two systems according to the pitch frequency.

【0016】この場合特に、ディジタルフィルタリング
によるピッチ抽出方式がピッチ周波数の高い範囲でのみ
使用されることにより、フィルタ係数の値を小さくする
ことができ、通常のDSP(ディジタル信号処理プロセ
ッサ)等によって容易にディジタルフィルタを構成する
ことができる。
In this case, in particular, since the pitch extraction method by digital filtering is used only in a high pitch frequency range, the value of the filter coefficient can be reduced, and it is easy to use a normal DSP (digital signal processor) or the like. A digital filter can be configured as follows.

【0017】また、本発明によるピッチ抽出装置が電子
楽器の音階検出装置として使用される場合、ピッチ周波
数が高い、即ち音階が高い範囲の音階周波数の差は大き
な値となるため、カットオフ周波数の急俊なディジタル
フィルタを構成する必要がなくなり、その結果バンドパ
スフィルタの次数を低くすることができ、DSP等によ
るリアルタイム処理を容易に実現できる。
When the pitch extracting device according to the present invention is used as a musical scale detecting device of an electronic musical instrument, the pitch frequency is high, that is, the difference between the musical scale frequencies in the high musical scale range is a large value. There is no need to construct a rapid digital filter. As a result, the order of the bandpass filter can be reduced, and real-time processing by a DSP or the like can be easily realized.

【0018】[0018]

【実施例】以下、図面を参照しながら本発明の実施例に
つき詳細に説明する。全体構成 図1は、本発明の実施例の全体構成を示すブロック図で
ある。
Embodiments of the present invention will be described below in detail with reference to the drawings. Overall Configuration FIG. 1 is a block diagram showing the overall configuration of an embodiment of the present invention.

【0019】本実施例は、CPU(中央演算制御装置)
101、ROM102、RAM103、音階検出部11
1、キーボード106、ディスプレイ105、プリンタ
104、楽音発生回路108、D/A変換器109、ア
ンプ110及びスピーカ111等を備えており、こらら
各部分は、バス107により接続されている。
In this embodiment, a CPU (Central Processing Controller) is used.
101, ROM 102, RAM 103, scale detector 11
1, a keyboard 106, a display 105, a printer 104, a tone generation circuit 108, a D / A converter 109, an amplifier 110, a speaker 111, and the like. These components are connected by a bus 107.

【0020】ROM102には、後述する動作フローチ
ャートで示される各種制御プログラムや、音色データ等
の各種データが格納されている。CPU101は、RO
M102内の制御プログラムに従って、他の各部分を制
御する。
The ROM 102 stores various control programs shown in an operation flowchart described later and various data such as timbre data. The CPU 101 uses the RO
The other parts are controlled according to the control program in M102.

【0021】RAM103は、後述する音階検出部11
1をゼロクロス検出装置やディジタルフィルタ又はエン
ベロープ抽出装置として動作させるためのデータ等を記
憶すると共に、CPU101のワークメモリとして機能
する。
The RAM 103 stores a scale detection unit 11 described later.
1 stores data and the like for operating 1 as a zero-cross detection device, a digital filter, or an envelope extraction device, and also functions as a work memory of the CPU 101.

【0022】音階検出部111は、マイク112、マイ
クアンプ113、ローパスフィルタ114、A/D変換
器115、DSP116、ROM117及びワークRA
M118から構成され、また、音響信号のライン入力端
子として、LINE IN を備えている。
The scale detecting section 111 includes a microphone 112, a microphone amplifier 113, a low-pass filter 114, an A / D converter 115, a DSP 116, a ROM 117, and a work RA.
M118, and has LINE IN as a line input terminal for audio signals.

【0023】この音階検出部111では、マイク112
又はライン入力端子LINE IN から入力されるアナログ音
響信号(楽器音、人声音、或いはテープレコーダやラジ
オ、テレビ、CDプレーヤ等からの再生音響等)が、ロ
ーパスフィルタ114を介してA/D変換器115に入
力され、ディジタル音響信号(以後、単に音響信号と呼
ぶ)x(n) に変換されてDSP116に入力される。
The scale detecting section 111 includes a microphone 112
Alternatively, an analog sound signal (instrument sound, human voice sound, or reproduction sound from a tape recorder, a radio, a television, a CD player, or the like) input from a line input terminal LINE IN is input to an A / D converter via a low-pass filter 114. The signal is converted to a digital audio signal (hereinafter simply referred to as an audio signal) x (n) and input to the DSP 116.

【0024】DSP116は、上記音響信号x(n) に基
づいて、後述するディジタルフィルタ演算のための各種
係数及びピッチ周期からノート・ナンバーへの変換テー
ブルを記憶したROM117、或いは各種データを記憶
するワークRAM118を用いて、後述するゼロクロス
検出又はフィルタ処理を行う。
The DSP 116 is based on the audio signal x (n), and is a ROM 117 storing a conversion table for converting various coefficients and a pitch period into a note number for a digital filter operation to be described later, or a work for storing various data. Using the RAM 118, zero-cross detection or filter processing described later is performed.

【0025】DSP116での処理結果は、CPU10
1に送られる。CPU101は、DSP116での処理
結果及び後述する楽音発生回路108に内蔵されている
各種モジュールの記憶状態に基づいて、楽音発生回路1
08に対する音階音の割り付け処理や削除処理を行う。
The processing result of the DSP 116 is transmitted to the CPU 10
Sent to 1. The CPU 101 generates the tone generation circuit 1 based on the processing result of the DSP 116 and the storage states of various modules incorporated in the tone generation circuit 108 described later.
Assignment processing and deletion processing of the scale sound to 08 are performed.

【0026】キーボード106には、ファンクションス
イッチや鍵盤等が設けられており、これらが操作される
と、CPU101が、その操作状態を検出し、楽音発生
回路108に発生されるべき楽音を割り当てる。
The keyboard 106 is provided with function switches, a keyboard, and the like. When these are operated, the CPU 101 detects the operation state and assigns a tone to be generated to the tone generator 108.

【0027】ディスプレイ105又はプリンタ104
は、CPU101の制御下で動作し、検出された音階を
表示し又は用紙に印字する。例えばCPU101は、リ
アルタイムで入力中の音響信号の音階をディスプレイ1
05に表示し、或いは、この音響信号の音階を、ノンリ
アルタイムで、編集作業等を経た上で、楽譜などとして
ディスプレイ105にしたりプリンタ104で用紙に印
字したりしてもよい。
Display 105 or Printer 104
Operates under the control of the CPU 101 to display the detected scale or to print the scale on paper. For example, the CPU 101 displays the scale of the audio signal being input in real time on the display 1.
The musical scale of the audio signal may be displayed on the display 105 as a musical score or printed on paper by the printer 104 after editing work or the like in non-real time.

【0028】楽音発生回路108としては、例えば、P
CM方式、FM方式、iPD方式、正弦波合成方式等の
各種タイプの音源回路が適用可能である。この楽音発生
回路108は、複数(例えば4チャネル)の楽音発音チ
ャネルを有しており、CPU101によって割り付けら
れた音階番号の音階音を発生する。この音階音は、オー
ディオシステム109を介してスピーカ110から放音
される。DSPの構成 次に、図2は、図1のDSP116の全体構成図であ
る。
As the tone generating circuit 108, for example, P
Various types of sound source circuits such as a CM system, an FM system, an iPD system, and a sine wave synthesis system can be applied. The tone generation circuit 108 has a plurality of (for example, four) tone generation channels, and generates a scale tone having a scale number assigned by the CPU 101. This scale sound is emitted from the speaker 110 via the audio system 109. FIG. 2 is an overall configuration diagram of the DSP 116 shown in FIG.

【0029】同図において、まず、インタフェース20
1は、CPU101に接続されるバス107及びA/D
変換115に接続されるバスを収容し、各バスとDSP
内部の回路とを接続する。
Referring to FIG.
1 is a bus 107 connected to the CPU 101 and an A / D
The buses connected to the conversion 115 are accommodated, and each bus and the DSP
Connect to internal circuit.

【0030】オペレーションROM203は、DSP1
16の全体の動作を規定するマイクロプログラムを格納
したROMであり、アドレスカウンタ202からの指定
アドレスに基づいて対応するプログラム命令が読み出さ
れる。図1のCPU101は、アドレスカウンタ202
にデータをセットすることによって、オペレーションR
OM203から如何なるプログラムを読み出して後述す
る各処理を実行するかを、アドレスカウンタ202に指
示する。
The operation ROM 203 stores the DSP 1
16 is a ROM that stores a microprogram that defines the entire operation of the microcomputer 16, and reads a corresponding program instruction based on a designated address from the address counter 202. The CPU 101 in FIG.
By setting data in
It instructs the address counter 202 what program to read from the OM 203 and execute each process described below.

【0031】オペレーションROM203の出力は、デ
コーダ204にも与えられ、DSP116内の各回路に
各種の制御信号を出力し、所望の動作を行わせる。一
方、DSP116の内部バスには、図1のROM117
及びワークRAM118が接続される。そして、オペレ
ーションROM203からのプログラム命令に従って、
フィルタ係数や音響信号x(n) 等が、DSP116に対
して供給され、或いはワークRAM118に対して入出
力される。
The output of the operation ROM 203 is also supplied to a decoder 204, which outputs various control signals to each circuit in the DSP 116 to perform a desired operation. On the other hand, the internal bus of the DSP 116 has a ROM 117 of FIG.
And the work RAM 118 are connected. Then, according to the program command from the operation ROM 203,
A filter coefficient, an acoustic signal x (n), and the like are supplied to the DSP 116 or input / output to / from the work RAM 118.

【0032】レジスタ群208は、演算中のデータを一
時記憶する複数のレジスタからなり、乗算器205又は
加減算器207の各入出力端子に、内部バスを介して接
続されている。そして、加減算器207からの演算結果
(比較結果等)に基づいたジャッジ処理を実現するた
め、フラグレジスタ206を介してアドレスカウンタ2
02へ、ジャッジ結果を示すフラグ信号が送出される。
The register group 208 is composed of a plurality of registers for temporarily storing data being operated on, and is connected to each input / output terminal of the multiplier 205 or the adder / subtractor 207 via an internal bus. Then, in order to implement a judging process based on the operation result (comparison result or the like) from the adder / subtractor 207, the address counter 2 via the flag register 206 is used.
To 02, a flag signal indicating the judgment result is transmitted.

【0033】このフラグレジスタ206の出力に応じて
アドレスカウンタ202のアドレスが変更され、そのア
ドレスに応じてオペレーションROM203からプログ
ラム命令が読み出される。このようにして、ジャッジ処
理が実現される。
The address of the address counter 202 is changed according to the output of the flag register 206, and the program instruction is read from the operation ROM 203 according to the address. In this way, a judge process is realized.

【0034】以上、図1及び図2の構成を有する本発明
の実施例の動作について、以下に順次説明する。DSP116とCPU101の基本動作 まず、DSP116の全体的な動作について説明する。
The operation of the embodiment of the present invention having the configuration shown in FIGS. 1 and 2 will be described below in order. Basic Operation of DSP 116 and CPU 101 First, the overall operation of the DSP 116 will be described.

【0035】図3は、図2のオペレーションROM20
3に格納されたマイクロプログラムが実行されることに
より実現されるDSP116の全体的な動作を示すフロ
ーチャートである。
FIG. 3 shows the operation ROM 20 of FIG.
6 is a flowchart illustrating an overall operation of the DSP 116 realized by executing a microprogram stored in the DSP 3.

【0036】まず、電源がオンされると、図2のワーク
RAM118、レジスタ群208などの全ての内容が初
期化される(ステップS301)。次に、図1のA/D変換
器115において1サンプル分のA/D変換処理が終了
するのが待たれ(ステップS302)、A/D変換処理が終
了すると、ディジタルデータに変換された1サンプル分
の音響信号が、ワークRAM118に取り込まれる。
First, when the power is turned on, all contents such as the work RAM 118 and the register group 208 in FIG. 2 are initialized (step S301). Next, the A / D converter 115 of FIG. 1 waits for the A / D conversion processing for one sample to be completed (step S302). When the A / D conversion processing is completed, the A / D converter 1 converts the data into digital data. The sound signals for the samples are taken into the work RAM 118.

【0037】続いて、上述のA/D変換された音響信号
に基づいて、後に詳述するゼロクロス検出によるピッチ
検出が行われる(ステップS303)。更に、同じく上述の
A/D変換された音響信号に基づいて、後に詳述するフ
ィルタ処理によるピッチ検出が行われる(ステップS30
4)。
Subsequently, based on the A / D-converted sound signal, pitch detection is performed by zero-cross detection described later (step S303). Further, based on the A / D-converted sound signal, pitch detection is performed by a filtering process described later in detail (step S30).
Four).

【0038】そして、ゼロクロス検出によりワークRA
M118に得られたピッチに対応するノート・ナンバー
PIT とエンベロープ値ENV 、及びフィルタ処理により同
じくワークRAM118に得られた各音階のエンベロー
プ信号Et(n)が、CPU101に転送される(ステップ
S305)。
The work RA is detected by the zero-cross detection.
Note number corresponding to the pitch obtained in M118
The PIT, the envelope value ENV, and the envelope signal Et (n) of each scale also obtained in the work RAM 118 by the filtering process are transferred to the CPU 101 (step S101).
S305).

【0039】以上のステップS302〜S305の処理が、A/
D変換器115において1サンプル分のA/D変換処理
が終了する毎に実行される。以上のように、DSP11
6では、音響信号に対して、ゼロクロス検出によるピッ
チ検出とフィルタ処理によるピッチ検出とがそれぞれ実
行される点が特徴である。
The processing in steps S302 to S305 is performed by A /
It is executed each time the A / D conversion processing for one sample is completed in the D converter 115. As described above, DSP11
6 is characterized in that pitch detection by zero-cross detection and pitch detection by filter processing are respectively performed on an acoustic signal.

【0040】次に、CPU101の全体的な動作につい
て説明する。図4は、図1のROM102に格納された
制御プログラムが実行されることにより実現されるCP
U101の全体的な動作を示すフローチャートである。
Next, the overall operation of the CPU 101 will be described. FIG. 4 shows a CP realized by executing a control program stored in the ROM 102 of FIG.
It is a flowchart which shows the whole operation | movement of U101.

【0041】まず、電源がオンされると、図1のRAM
118、CPU101内の特には図示しないレジスタ等
の内容が初期化される(ステップS401)。次に、DSP
116から図3のステップS305での転送処理に基づ
くデータが転送されてくるのが待たれ(ステップS40
2)、それらのデータが転送されてくると、DSP11
6でのゼロクロス検出(図3のステップS303)により得
られたピッチに対応するノート・ナンバーPIT の値が所
定の音階Kより下であるか否かが判定される(ステップ
S403)。
First, when the power is turned on, the RAM shown in FIG.
118, the contents of a register (not shown) in the CPU 101 are initialized (step S401). Next, the DSP
It is awaited that data based on the transfer processing in step S305 in FIG. 3 is transferred from step 116 (step S40).
2) When the data is transferred, the DSP 11
It is determined whether the value of the note number PIT corresponding to the pitch obtained by the zero-cross detection in step 6 (step S303 in FIG. 3) is below a predetermined scale K (step S303).
S403).

【0042】そして、ステップS403の判定がYESで、
入力された音響信号のピッチが低いと判定されたら、D
SP116でのゼロクロス検出(図3のステップS303)
の処理結果に基づいて、楽音発生回路108に対して発
音処理が実行される(ステップS404)。
Then, the determination in step S403 is YES,
If it is determined that the pitch of the input acoustic signal is low, D
Zero cross detection in SP116 (step S303 in FIG. 3)
Based on the processing result, the tone generation circuit 108 performs a tone generation process (step S404).

【0043】逆に、ステップS403の判定がNOで、入力
された音響信号のピッチが高いと判定されたら、DSP
116でのフィルタ処理(図3のステップS304)の処理
結果に基づいて、楽音発生回路108に対して発音処理
が実行される(ステップS405)。
Conversely, if the determination in step S403 is NO and it is determined that the pitch of the input acoustic signal is high, the DSP
Based on the processing result of the filter processing at 116 (step S304 in FIG. 3), tone generation processing is executed on the musical tone generation circuit 108 (step S405).

【0044】以上のステップS402〜S405の処理が、DS
P116から図3のステップS305での転送処理に基づく
データが転送されてくる毎に実行される。ゼロクロス検出処理 次に、図3のDSP処理におけるゼロクロス検出の処理
について説明する。 <ゼロクロス検出の基本動作原理>通常、例えば人の歌
声などのように、ピッチ感が明瞭でかつ単音で演奏され
る音声は、図5に示すように、ピッチ周期(例えば)
毎に繰り返されるほぼ相似の波形要素(例えば同図のa
とd、bとe、cとf)で構成されている。
The processing of steps S402 to S405 is performed by the DS
It is executed every time data based on the transfer processing in step S305 of FIG. 3 is transferred from P116. Zero Cross Detection Processing Next, zero cross detection processing in the DSP processing of FIG. 3 will be described. <Basic Operating Principle of Zero-Cross Detection> Normally, a voice that has a clear pitch feeling and is played as a single sound, such as a human singing voice, has a pitch period (for example) as shown in FIG.
A substantially similar waveform element repeated every time (for example, a
And d, b and e, and c and f).

【0045】このような音声は、その音声に含まれる倍
音成分のために、その波形が振幅0の基準レベルを横切
るゼロクロス点を1ピッチ周期内に数多く有している。
そのため、このような周期性を有する波形からそのピッ
チ周期を求めるには、いずれのゼロクロス点の間をピッ
チ周期とするかを決定しなければならないが、上述のよ
うな周期性を有する波形にはつぎのような特徴がある。
Such a sound has many zero-cross points in one pitch cycle whose waveform crosses a reference level having an amplitude of 0 due to harmonic components contained in the sound.
Therefore, in order to determine the pitch period from such a periodic waveform, it is necessary to determine which of the zero-cross points should be the pitch period. It has the following features.

【0046】即ち、隣接するピッチ周期のほぼ同形の波
形(例えば上記aとd)のそれぞれのゼロクロス点(例
えばZ1〜Z2とZ7〜Z8)で定まる区間(例えばと)の
時間はほぼ等しい。
That is, the intervals (for example,) defined by the zero cross points (for example, Z1 to Z2 and Z7 to Z8) of the substantially identical waveforms (for example, a and d) of adjacent pitch periods are approximately equal.

【0047】本実施例では上述の点に着目し、隣接する
ゼロクロス点間の時間のほぼ等しい2つの区間(例えば
と)を見出すことにより、その2つの区間のそれぞ
れの開始点(例えばZ1とZ7)の間の時間間隔を抽出し
て、入力音響信号のピッチに対応するノートナンバーを
検出する。
In this embodiment, focusing on the above-described points, finding two sections (for example, and) having substantially the same time between adjacent zero-cross points, the start points (for example, Z1 and Z7) of the two sections are determined. ) Is extracted to detect a note number corresponding to the pitch of the input audio signal.

【0048】上述のような基本動作原理に従って動作す
るゼロクロス検出の動作について、以下に説明する。 <ゼロクロス検出の動作の概要>図5において、例え
ば、波形aのゼロクロス点Z1〜Z2の区間の時間がカウ
ントされ、そのカウント値COUNT 1 が第1のカウンタに
保持される。次に、波形aと同じ極性を有する波形b、
c、d・・・のそれぞれの区間、、の時間が順次
カウントされ、そのカウント値COUNT 2 は、COUNT 1 と
ほぼ等しい値が得られるまで順次更新されながら、第2
のカウンタに保持される。
The operation of zero-cross detection that operates according to the above-described basic operation principle will be described below. <Outline of Zero-Cross Detection Operation> In FIG. 5, for example, the time of the section of the zero-cross points Z1 to Z2 of the waveform a is counted, and the count value COUNT 1 is held in the first counter. Next, a waveform b having the same polarity as the waveform a,
.. are counted sequentially, and the count value COUNT 2 is sequentially updated until a value substantially equal to COUNT 1 is obtained.
Is held in the counter.

【0049】この場合に、ゼロクロス点Z1から、波形
b、c、dのそれぞれのゼロクロス点Z3、Z5、Z7までの
時間、、及びが第3のカウンタによってカウント
される。そのカウント値COUNT 3 は、この入力音声信号
のピッチ周期となる可能性を有するので、ピッチ周期と
なるカウント値が得られるまで、順次更新されながらR
AM4内の変数PITCOUNTER に保存される。
In this case, the time from the zero-cross point Z1 to the zero-cross points Z3, Z5 and Z7 of the waveforms b, c and d is counted by the third counter. Since the count value COUNT 3 has a possibility of being the pitch period of the input audio signal, R is sequentially updated while a count value corresponding to the pitch period is obtained.
Stored in the variable PITCOUNTER in AM4.

【0050】そして、区間の時間とほぼ等しい時間を
有する区間が見出されたら、ゼロクロス点Z1、Z7間の
時間に相当するカウンタ値が上記メモリ変数PIT COUN
TERから読み出され、ピッチ周期として確定される。そ
して、そのピッチ周期に対応するノート・ナンバーがR
OM117内のテーブルから求められる。 <ゼロクロス検出の具体的動作>次に、上述の動作原理
に従い、入力される音響信号の波形のピッチを求める動
作を、図6〜図8の動作フローチャートを用いて説明す
る。これらの動作フローチャートは、図3のステップS
303の部分の詳細であり、DSP116が、オペレー
ションROM203内に記憶されているマイクロプログ
ラムを実行する動作として実現される。
When a section having a time substantially equal to the time of the section is found, the counter value corresponding to the time between the zero-cross points Z1 and Z7 is stored in the memory variable PIT COUN.
It is read from the TER and determined as the pitch period. The note number corresponding to the pitch cycle is R
It is obtained from the table in the OM 117. <Specific Operation of Zero-Cross Detection> Next, the operation for obtaining the pitch of the waveform of the input acoustic signal according to the above-described operation principle will be described with reference to the operation flowcharts of FIGS. These operation flowcharts correspond to step S in FIG.
Details of a part 303 are realized by the DSP 116 as an operation of executing a microprogram stored in the operation ROM 203.

【0051】図6において、まず、ワークRAM118
には、音声信号を読み出す時点がその信号波形のいかな
る状態(status) に対応するかを示すステータス・フ
ラグ(図5参照)、入力音声信号の波形エンベロープの
大きさを示す変数ENV 、ピッチ抽出の結果得られたピッ
チに対応するノート・ナンバーを保持する変数PIT 、第
1、第2、第3の3個のカウンタの各々のカウント値を
保持する変数count 1,count 2,count 3 、及び1つ前の
A/D変換値を保持する変数ADMEM などの各データが保
持される。
In FIG. 6, first, the work RAM 118
Includes a status flag (see FIG. 5) indicating the state of the signal waveform at the time of reading the audio signal (see FIG. 5), a variable ENV indicating the magnitude of the waveform envelope of the input audio signal, and a pitch extraction A variable PIT holding a note number corresponding to the resulting pitch, a variable count 1, count 2, count 3, and 1 holding a count value of each of the first, second, and third counters. Each data such as a variable ADMEM which holds the previous A / D conversion value is held.

【0052】続いて、A/D変換器115から入力され
てくる1サンプル分の音響信号が、レジスタ群208内
のレジスタreg1に格納される(ステップS601)。その
後、ステータス・フラグにより処理が3つに分岐される
(ステップS602)。最初は、図5のステータス・フラグ
=0の状態であるので、ステップS603に進む。ステータ
ス・フラグ=0の状態では、入力音響信号の振幅が負側
から正側へ向かうゼロクロス点Z1を検出するために、1
つ前のA/D変換値が書き込まれている変数ADMEM の値
が負で、かつ現在のA/D変換値が格納されているレジ
スタreg1の値が正であるか否かが判定される。
Subsequently, one sample of the audio signal input from the A / D converter 115 is stored in the register reg1 in the register group 208 (step S601). Thereafter, the process branches into three depending on the status flag (step S602). Initially, since the status flag of FIG. 5 is 0, the process proceeds to step S603. In the state where the status flag = 0, the amplitude of the input audio signal is detected from the negative side to the positive side to detect a zero crossing point Z1.
It is determined whether the value of the variable ADMEM in which the previous A / D conversion value is written is negative and the value of the register reg1 in which the current A / D conversion value is stored is positive.

【0053】今の場合、ステップS603の判定はNOであ
り、ステップS605に進む。そして、今回A/D変換値が
セットされたreg1の値が変数ADMEM に移され(ステップ
S605)、エンベロープ抽出(ステップS606)が実行され
た後、ゼロクロス検出を終了する。
In this case, the determination in step S603 is NO, and the process proceeds to step S605. Then, the value of reg1 in which the A / D conversion value is set this time is moved to the variable ADMEM (step
After the envelope extraction (step S606) is performed, the zero-cross detection ends.

【0054】上記エンベロープ抽出(ステップS606)の
処理は、図8の動作フローチャートとして示される。図
8において、まず、現在のA/D変換値(reg1の内容)
の絶対値が演算され(ステップS801)、その後、その絶
対値データがローパスフィルタを通されて、入力された
音響信号の波形が整形される(ステップS802)。そして
その結果得られたエンベロープ値が変数ENV に格納され
る(ステップS803)。
The process of the envelope extraction (step S606) is shown as an operation flowchart of FIG. In FIG. 8, first, the current A / D conversion value (contents of reg1)
Is calculated (step S801), and the absolute value data is passed through a low-pass filter to shape the waveform of the input acoustic signal (step S802). Then, the resulting envelope value is stored in the variable ENV (step S803).

【0055】以上の処理は、音響信号の各サンプルが入
力されて図3のステップS303のゼロクロス検出が繰り返
し実行され、入力音響信号のサンプリング点がその振幅
が負側から正側へ向うゼロクロス点(図5のZ1)に到達
するまで繰り返される。
In the above processing, each sample of the audio signal is input, and the zero-cross detection in step S303 of FIG. 3 is repeatedly executed, and the sampling point of the input audio signal is changed to the zero-cross point (the amplitude of which goes from the negative side to the positive side). This is repeated until Z1) in FIG. 5 is reached.

【0056】サンプリング点が上記ゼロクロス点に到達
すると、図6のステップS603の判定がYESとなり、ス
テータス・フラグSTATUS FLAG が1にされる(ステップ
S604)。
When the sampling point reaches the zero cross point, the determination in step S603 in FIG. 6 becomes YES, and the status flag STATUS FLAG is set to 1 (step S603).
S604).

【0057】上述のようにステータス・フラグSTATUS F
LAG が1になったため、次のサンプル点に対応する図3
のS303のゼロクロス検出でのステップS602の処理におい
て、ステップS607に移る。
As described above, the status flag STATUS F
Figure 3 corresponding to the next sample point because LAG is 1
In the process of step S602 in the zero cross detection of S303, the process proceeds to step S607.

【0058】この状態では、図5の区分に例示される
時間をカウントするために、第1のカウンタとしての変
数COUNT 1 (以下、第1のカウンタCOUNT 1 と呼ぶ)の
インクリメントが、また、区分に例示される時間をカ
ウントするために第3のカウンタとしての変数COUNT 3
(以下、第3のカウンタCOUNT 3 と呼ぶ)のインクリメ
ントがそれぞれ開始される。
In this state, the increment of the variable COUNT 1 (hereinafter, referred to as the first counter COUNT 1) as the first counter is counted in order to count the time exemplified in the section of FIG. Variable COUNT 3 as a third counter to count the time exemplified in
(Hereinafter, referred to as a third counter COUNT 3) is started.

【0059】まず、第1のカウンタCOUNT 1 の値が1増
加させられる(ステップS607)。次に、入力音響信号の
振幅が正側から負側へ向うゼロクロス点、すなわち図5
の区間の終了点であるゼロクロス点Z2を検出するため
に、1つ前のA/D変換値が書き込まれた変数ADMEM の
値が正で、かつ現在のA/D変換値が書き込まれたレジ
スタreg 1 の値が負であるか否かが判定される(ステッ
プS608)。
First, the value of the first counter COUNT 1 is incremented by 1 (step S607). Next, the zero cross point where the amplitude of the input acoustic signal goes from the positive side to the negative side, that is, FIG.
In order to detect the zero crossing point Z2, which is the end point of the section, the value of the variable ADMEM in which the previous A / D conversion value is written is positive and the register in which the current A / D conversion value is written It is determined whether the value of reg 1 is negative (step S608).

【0060】その判定がNOなら、第3のカウンタCOUN
T 3 の値が1増加させられる(ステップS610)。以後、
ステップS608→S610→S605→S606〜S602→S607→S608・
・・のループ処理が、音響信号の各サンプルが入力され
て図3のステップS303のゼロクロス検出が実行される毎
に繰り返され、その繰り返し処理毎に第1のカウンタCO
UNT 1 及び第3のカウンタCOUNT 3 の値が1づつ増加さ
れる。
If the determination is NO, the third counter COUN
The value of T 3 is increased by 1 (step S610). Since then
Step S608 → S610 → S605 → S606 ~ S602 → S607 → S608 ・
The loop processing is repeated every time each sample of the audio signal is input and the zero-crossing detection is performed in step S303 in FIG. 3, and the first counter CO
The values of UNT 1 and the third counter COUNT 3 are incremented by one.

【0061】そして、ステップS608の判定がYESにな
り、入力音響信号のサンプリング点がその振幅が正側か
ら負側へ向うゼロクロス点Z2に到達すると、ステータス
・フラグが2にされる(ステップS609)。その後、ステ
ップS610に進み、COUNT 3 が値1増加されたあと、ステ
ップS605→S606と進む。
Then, if the determination in step S608 is YES and the sampling point of the input audio signal reaches the zero crossing point Z2 where the amplitude goes from the positive side to the negative side, the status flag is set to 2 (step S609). . Thereafter, the process proceeds to step S610, and after COUNT 3 is increased by 1, the process proceeds from step S605 to S606.

【0062】以上のようなループ処理が行われて、図2
の区間の時間に相当するカウンタ値が第1のカウンタ
COUNT 1 に保持される。続いて、音響信号の次のサンプ
ルが入力されて再び図3のステップS303のゼロクロス検
出が実行されると、上述のステップS609でステータス・
フラグは2にされたため、今回はステップS602から、図
7のステップS611→S612と進む。
After the above-described loop processing is performed, FIG.
The counter value corresponding to the time of the section is the first counter
Stored in COUNT 1. Subsequently, when the next sample of the acoustic signal is input and the zero-cross detection is performed again in step S303 in FIG.
Since the flag is set to 2, the process proceeds from step S602 to step S611 → S612 in FIG. 7 this time.

【0063】ステップS612では、入力音響信号の振幅が
負側から正側へ向うゼロクロス点(図5のZ3)を検出す
るため、図6のステップS603と同じ処理、即ち、変数AD
MEMの値(1つ前のA/D変換値)が負で、かつレジス
タreg1の値(現在のA/D変換値)が正であるか否かが
判定される。
In step S612, the same processing as step S603 in FIG. 6, ie, the variable AD, is performed to detect the zero cross point (Z3 in FIG. 5) where the amplitude of the input audio signal goes from the negative side to the positive side.
It is determined whether the value of MEM (the previous A / D conversion value) is negative and the value of the register reg1 (current A / D conversion value) is positive.

【0064】その判定がNOである間は、S612→ステッ
プS610(図6)→S605→S606〜S602→S611(図7)→S6
12・・・のループ処理が、音響信号の各サンプルが入力
され図3のステップS303のゼロクロス検出が実行される
毎に繰り返され、各繰り返し毎に第3のカウンタCOUNT
3 のカウント値が1づつ増加させられる(S610)。
While the determination is NO, S612 → step S610 (FIG. 6) → S605 → S606-S602 → S611 (FIG. 7) → S6
The loop processing of 12... Is repeated every time each sample of the audio signal is input and the zero-cross detection in step S303 of FIG. 3 is executed.
The count value of 3 is incremented by one (S610).

【0065】そして、ステップS612の判定がYESにな
り、入力音響信号のサンプリング点がその振幅が負側か
ら正側へ向うゼロクロス点Z3に到達すると、ステータス
・フラグが3にされて、このときのCOUNT 3 の値(図5
の時間に相当)が変数PITCOUNTER に保存される(ス
テップS613)。このPIT COUNTER の値は、抽出されるべ
きピッチに対応する周期の候補、すなわち、図5の区間
のカウント値になる可能性を有するものとして、保持
される。
Then, when the determination in step S612 is YES and the sampling point of the input audio signal reaches the zero-crossing point Z3 whose amplitude goes from the negative side to the positive side, the status flag is set to 3 and the status flag at this time is set. COUNT 3 value (Figure 5
Is stored in the variable PITCOUNTER (step S613). The value of the PIT COUNTER is held as a candidate for the cycle corresponding to the pitch to be extracted, that is, as a value that has a possibility of becoming the count value of the section in FIG.

【0066】その後、ステップS613→S610(図6)→S6
05→S606と進んだ後、音響信号の次のサンプルが入力さ
れて再び図3のステップS303のゼロクロス検出が実行さ
れ、S601→S602〜S611(図7)と進む。
Thereafter, steps S613 → S610 (FIG. 6) → S6
After proceeding from 05 to S606, the next sample of the audio signal is input, zero-cross detection is performed again in step S303 in FIG. 3, and the process proceeds to S601 to S602 to S611 (FIG. 7).

【0067】今回はSTATUS FLAG =3 の状態となったた
め、ステップS611からステップS614に進み、第2のカウ
ンタCOUNT 2 のカウント値が1増加され、この時点から
図5の区分のカウントが開始される。
This time, since STATUS FLAG = 3, the process proceeds from step S611 to step S614, where the count value of the second counter COUNT 2 is incremented by 1, and from this point on, the counting of the divisions in FIG. 5 is started. .

【0068】次に、入力音響信号の振幅が正側から負側
へ向うゼロクロス点、すなわち図5の区間の終了点に
相当するゼロクロス点Z4が検出されるため、変数ADMEM
の値(1つ前のA/D 変換値)が正で、かつレジスタreg1
の値(現在のA/D 変換値)が負であるか否かが判定され
る(ステップS615)。
Next, a zero cross point where the amplitude of the input audio signal goes from the positive side to the negative side, that is, a zero cross point Z4 corresponding to the end point of the section in FIG. 5, is detected.
(The previous A / D conversion value) is positive and the register reg1
It is determined whether or not the value (current A / D conversion value) is negative (step S615).

【0069】その判定がNOの間は、ステップS614→S6
15→S610(図6)〜S606〜S601→S602→S611(図7)→
S614のループ処理が、音響信号の各サンプルが入力され
図3のステップS303のゼロクロス検出が実行される毎に
繰り返され、各繰り返し毎に第2のカウンタCOUNT 2 と
第3のカウンタCOUNT 3 の値が1づつ増加される。
While the determination is NO, steps S614 → S6
15 → S610 (Fig. 6)-S606-S601 → S602 → S611 (Fig. 7) →
The loop processing of S614 is repeated each time each sample of the audio signal is input and the zero-cross detection of step S303 in FIG. 3 is executed, and the value of the second counter COUNT 2 and the value of the third counter COUNT 3 are repeated each time. Is incremented by one.

【0070】ステップS615の判定がYESになると、ゼ
ロクロス点Z4が検出されたことになり、ここでステータ
ス・フラグが4に変えられる(ステップS616)。その
後、図6のステップS610に進み、COUNT 3 が値1増加さ
れたあと、ステップS605→S606と進み、音響信号の次の
サンプルが入力されて再び図3のステップS303のゼロク
ロス検出が実行されると、S601→S602→S611(図7)と
進む。
If the determination in step S615 is YES, it means that the zero cross point Z4 has been detected, and the status flag is changed to 4 here (step S616). Thereafter, the process proceeds to step S610 in FIG. 6, and after COUNT 3 is increased by 1, the process proceeds from step S605 to S606, the next sample of the acoustic signal is input, and the zero cross detection in step S303 in FIG. 3 is executed again. Then, the process proceeds from S601 to S602 to S611 (FIG. 7).

【0071】今回はSTATUS FLAG =4 の状態となったた
め、ステップS611からステップS617に進む。この状態で
は、図5の区分に対して区分、、が順次比較さ
れ、区分とほぼ等しい時間を有する区分が見出され
たとき、区分の時間を入力された音響信号のピッチ周
期と定める処理動作が行われる。
This time, since STATUS FLAG = 4, the process proceeds from step S611 to step S617. In this state, the divisions are sequentially compared with the divisions in FIG. 5, and when a division having a time substantially equal to the division is found, a processing operation for determining the division time as the pitch period of the input acoustic signal. Is performed.

【0072】まず、今までに得られた第1のカウンタCO
UNT 1 と第2のカウンタCOUNT 2 のそれぞれの値がほぼ
等しいか否か、すなわち、COUNT 1 とCOUNT 2 のそれぞ
れの値の差の絶対値が、許容誤差範囲内にあるか否かが
判定される(ステップS617)。この許容誤差範囲は、入
力音響信号のサンプリング周波数とピッチ周波数に依存
するが、経験的に決定される。
First, the first counter CO obtained so far is
It is determined whether or not the respective values of UNT 1 and the second counter COUNT 2 are substantially equal, that is, whether or not the absolute value of the difference between the respective values of COUNT 1 and COUNT 2 is within an allowable error range. (Step S617). This allowable error range depends on the sampling frequency and pitch frequency of the input audio signal, but is empirically determined.

【0073】今の場合は、COUNT 1 とCOUNT 2 は、それ
ぞれ図5の区間とのカウント値を保持しているた
め、ステップS617の判定はNOとなりステップS618に進
む。ここで、入力音響信号に雑音などが混入すると、そ
れが原因となって、ステップS617の判定がNOの状態が
異常に長く続き、楽音の発音指示が行われない場合があ
る。
In this case, since COUNT 1 and COUNT 2 each hold the count value of the section in FIG. 5, the determination in step S617 is NO, and the process proceeds to step S618. Here, if noise or the like is mixed in the input audio signal, the state where the determination in step S617 is NO may be abnormally long, and the tone generation instruction may not be performed.

【0074】このような異常状態の発生を防ぐために、
音響信号のピッチ周期とされるべき時間をカウントする
第3のカウンタCOUNT 3 の値が常に監視され、その値が
音声信号の最低音のピッチ周期に比べてはるかに大きい
値を有する所定の制限値を超えているか否かが判定され
る(ステップS618)。
In order to prevent the occurrence of such an abnormal state,
The value of a third counter COUNT 3 that counts the time to be taken as the pitch period of the sound signal is constantly monitored, and the value of the third counter COUNT 3 is a predetermined limit value having a value much larger than the pitch period of the lowest sound of the sound signal. Is determined (step S618).

【0075】この制限値も前述の許容誤差範囲と同様、
経験的に決定される。例えばサンプリング周波数を20KH
z 、最低抽出音高(ピッチ)を110.5Hz (音名:A1に相
当)とすると、 20000÷110.5 =180.995 ・・・ となるため、制限値は180前後とすればよい。
This limit value is also similar to the above-described allowable error range.
Determined empirically. For example, set the sampling frequency to 20KH
If the minimum extraction pitch (pitch) is 110.5 Hz (corresponding to the pitch name: A1), then 20000 ÷ 110.5 = 180.995..., the limit value may be set to around 180.

【0076】ステップS618の判定がYESの場合、すな
わち異常状態の場合は、図1のCPU101を介して楽
音発生回路108に対して、全ての発音中の音を消音す
る指示がなされると共に、後述すR変数on nowがクリア
され、ゼロクロス検出の処理を終了する。
If the determination in step S618 is YES, that is, if the state is abnormal, an instruction is given to the tone generation circuit 108 via the CPU 101 in FIG. R variable on now is cleared, and the process of zero-cross detection ends.

【0077】ステップS618の判定がNOの場合は、ステ
ップS619に進んで、第2のカウンタCOUNT 2 の値がクリ
アされ、ステータス・フラグは2に戻される。そして、
再び次のゼロクロスを求めるための処理に入る。このと
き変数PIT COUNTER に保持された値は無効となるが、第
3のカウンタCOUNT 3 は依然カウントアップをつづけて
おり、また、第1のカウンタCOUNT 1 も図5の区間の
カウント値を保持している。
If the determination in step S618 is NO, the process proceeds to step S619, where the value of the second counter COUNT 2 is cleared, and the status flag is returned to 2. And
The process for obtaining the next zero cross again is started. At this time, the value held in the variable PIT COUNTER becomes invalid, but the third counter COUNT 3 is still counting up, and the first counter COUNT 1 also holds the count value in the section of FIG. ing.

【0078】上述のようにしてステータス・フラグの2
の状態に戻された後は、前回と同様にステータス・フラ
グの3の状態、4の状態と進み、第2のカウンタCOUNT
2 には図5の区間のカウント値、変数PIT COUNTER に
は同図の区間の始まりから区間のゼロクロス点z5ま
でのカウント値(図5の)が保持される。
As described above, the status flag 2
After returning to the state, the status flag advances to the state of 3 and 4 as in the previous case, and the second counter COUNT
2 holds the count value of the section in FIG. 5, and the variable PIT COUNTER holds the count value (of FIG. 5) from the start of the section to the zero crossing point z5 of the section.

【0079】しかし、今回もCOUNT 1 の値(区分の時
間に対応)とCOUNT 2 の値(区分の時間に対応)が一
致しないため、ステップS407の判定がNOとなる。その
ためステップS618を介してステップS619に進み、再びス
テータス・フラグが2の状態から実行し直されることに
なる。
However, the value of COUNT 1 (corresponding to the time of the section) and the value of COUNT 2 (corresponding to the time of the section) do not match this time, so that the determination in step S407 is NO. Therefore, the process proceeds to step S619 via step S618, and the status flag is again executed from the state of 2.

【0080】そして、この次にステータス・フラグが再
び4の状態になったとき、COUNT 2は図5の区間のカ
ウント値を保持し、一方、PIT COUNTER は同図の時間
のカウント値を保持している。そして、ステップS617に
おいて、初めてYESと判定され、ステップS621に進
む。
Then, when the status flag becomes the state of 4 again, COUNT 2 holds the count value of the section of FIG. 5, while PIT COUNTER holds the count value of the time of FIG. ing. Then, in step S617, YES is determined for the first time, and the process proceeds to step S621.

【0081】このときの入力された音響信号のピッチ周
期の正しい値は、PIT COUNTER に保持されている第3の
カウンタCOUNT 3 の値(図5の)となる。そして、こ
の値に対応するノート・ナンバーが図2のROM117
内の変換テーブルから読み出され、変数PIT に移される
(ステップS621)。
The correct value of the pitch period of the input audio signal at this time is the value of the third counter COUNT 3 (FIG. 5) held in PIT COUNTER. The note number corresponding to this value is stored in the ROM 117 of FIG.
Is read out from the conversion table and moved to the variable PIT (step S621).

【0082】次に、ステータス・フラグと、すべてのカ
ウンタがクリアされ、初期状態にリセットされる(ステ
ップS622)。そして、図6のステップS605→S606と進ん
だ後、ゼロクロス検出の処理を終了する。
Next, the status flag and all counters are cleared and reset to the initial state (step S622). Then, after proceeding from step S605 to S606 in FIG. 6, the process of zero-cross detection ends.

【0083】以上のようにして、音響信号の各サンプル
が入力され図3のステップS303のゼロクロス検出が実行
される毎に、ピッチ周期に対応するノート・ナンバーPI
T とエンベロープ値ENV が求められ、これらが図3のス
テップS305の処理によってDSP116からCPU10
1へ転送され、後に詳述する図4のステップS404の発音
処理において使用される。
As described above, each time the sample of the acoustic signal is input and the zero-cross detection is performed in step S303 in FIG. 3, the note number PI corresponding to the pitch period is obtained.
T and the envelope value ENV are obtained, and these are transmitted from the DSP 116 to the CPU 10 by the processing of step S305 in FIG.
1 and is used in the sound generation process of step S404 in FIG.

【0084】上述のゼロクロス検出の処理では、ゼロク
ロス間隔の規則性のみに着目してノート・ナンバー(ピ
ッチ)の抽出が行われたが、ゼロクロス間隔の規則性に
例えば入力音響信号の各波形部分の面積や振幅の最大値
などの規則性を加味すれば、より高精度な処理が可能と
なる。フィルタ処理 次に、図3のDSP処理におけるフィルタ処理について
説明する。 <フィルタ処理の基本動作原理>まず、DSP116で
実行されるフィルタ処理の基本動作原理を、図9と図1
0を用いて説明する。
In the above-described zero-crossing detection processing, note numbers (pitch) are extracted by focusing only on the regularity of the zero-crossing interval. If regularities such as the area and the maximum value of the amplitude are taken into account, higher-precision processing becomes possible. Next, the filter processing in the DSP processing of FIG. 3 will be described. <Basic Operation Principle of Filter Processing> First, the basic operation principle of the filter processing executed by the DSP 116 will be described with reference to FIGS.
Explanation will be made using 0.

【0085】図9は、フィルタ処理の基本機能ブロック
図である。図9において、入力音響信号x(n) は、各サ
ンプルタイミング毎に図1のA/D変換器115からD
SP116に入力されてくる1サンプル分の音響信号で
ある。なお、nは、離散的なサンプリング時刻を示す。
FIG. 9 is a basic functional block diagram of the filtering process. In FIG. 9, the input audio signal x (n) is supplied from the A / D converter 115 of FIG.
This is an audio signal for one sample input to the SP 116. Note that n indicates a discrete sampling time.

【0086】上述の入力音響信号x(n) に対して、DS
P116における時分割処理によって、N個分のバンド
パスフィルタのフィルタリング処理が実行される。今、
任意の音階t(1≦t≦N)のバンドパスフィルタの伝
達関数をHt(z)とする。本実施例では、各伝達関数Ht
(z)(1≦t≦N)の特性が、複数オクターブの各音階
に依存して変更される。図10は、伝達関数Ht(z)を有
するバンドパスフィルタ(以下、バンドパスフィルタH
t(z)と呼ぶ)としてチェビシェフ形フィルタが採用され
る場合の周波数特性図である。この場合の伝達関数Ht
(z)は、下式で示される。
For the above-mentioned input audio signal x (n), DS
By the time division processing in P116, filtering processing of N bandpass filters is executed. now,
Let Ht (z) be the transfer function of a bandpass filter of an arbitrary scale t (1 ≦ t ≦ N). In this embodiment, each transfer function Ht
(z) The characteristic of (1 ≦ t ≦ N) is changed depending on each scale of a plurality of octaves. FIG. 10 shows a band-pass filter having a transfer function Ht (z) (hereinafter, band-pass filter H
FIG. 11 is a frequency characteristic diagram in the case where a Chebyshev filter is adopted as (t (z)). The transfer function Ht in this case
(z) is represented by the following equation.

【0087】[0087]

【数1】 (Equation 1)

【0088】ここで、i=1とすると、DSP116
は、
Here, if i = 1, the DSP 116
Is

【0089】[0089]

【数2】 (Equation 2)

【0090】で示されるディジタルフィルタリング処理
の演算を実行することになる。更に、i≧2の場合に
は、数2式と同様の演算が繰り返し実行されることにな
る。
The calculation of the digital filtering process shown in FIG. Further, when i ≧ 2, the same operation as in Expression 2 is repeatedly executed.

【0091】また、バンドパスフィルタHt(z)のフィル
タ係数は、数値計算で求めることができる。具体例とし
ては、ノートナンバーA4 に対応する中心周波数が44
0[Hz]のバンドパスフィルタを以下に示される条件
(〜は図10を参照)で構成すると、下記の如き係
数値で実現される伝達関数Ht(z)を有するディジタルフ
ィルタリング処理が実行されることになる。
The filter coefficients of the band-pass filter Ht (z) can be obtained by numerical calculation. As a specific example, the center frequency corresponding to note number A4 is 44
When the band-pass filter of 0 [Hz] is configured under the following conditions (see FIG. 10), digital filtering processing having a transfer function Ht (z) realized by the following coefficient values is executed. Will be.

【0092】即ち、 =1[dB] =サンプリング周波数fs =10[kHz] =12[dB]以上 =415[Hz] =430[Hz] =450[Hz] =466[Hz] の条件で、i=1、2の2段のディジタルフィルタの各
フィルタ係数は、 Ht(0)=0.08192384 i=1に対して、 a1(1)=-1.91442200776 a2(1)= 0.9933673 b1(1)=-1.91105345727 b2(1)= 1. i=2に対して、 a1(2)=-1.9210712 a2(2)= 0.993606 b1(2)=-1.93525314797 b2(2)= 1. となる。
That is, under the following conditions: = 1 [dB] = Sampling frequency fs = 10 [kHz] = 12 [dB] or more = 415 [Hz] = 430 [Hz] = 450 [Hz] = 466 [Hz] The filter coefficients of the two-stage digital filter of = 1, 2 are as follows: For Ht (0) = 0.08192384 i = 1, a 1 (1) =-1.91442200776 a 2 (1) = 0.9933673 b 1 (1) = -1.91105345727 b 2 (1) = 1. For i = 2, a 1 (2) =-1.9210712 a 2 (2) = 0.993606 b 1 (2) =-1.93525314797 b 2 (2) = 1. .

【0093】このように、各音階t(1≦t≦N)のバ
ンドパスフィルタHt(z)のディジタルフィルタリング処
理がDSP116において時分割的に実行され、その結
果、図9の各出力信号Yt(n)(1≦t≦N)が求まる。
As described above, the digital filtering process of the band-pass filter Ht (z) of each scale t (1 ≦ t ≦ N) is executed by the DSP 116 in a time-division manner. As a result, each output signal Yt ( n) (1 ≦ t ≦ N) is obtained.

【0094】続いて、DSP116は、図9に示される
ように、上記各出力信号Yt(n)に対して、それぞれエン
ベロープ抽出処理を時分割処理によって実行する。この
エンベロープ抽出処理は、各出力信号Yt(n)に対して、
所定時間間隔(例えば各音階に対応する時間間隔)毎に
ピークレベル(絶対値)を求める処理として実現され
る。或いは、後述するような特定のディジタルフィルタ
リング処理を各出力信号Yt(n)の絶対値に対して実行す
る処理として実現される。
Subsequently, as shown in FIG. 9, the DSP 116 performs an envelope extraction process on each of the output signals Yt (n) by a time division process. This envelope extraction process is performed for each output signal Yt (n).
This is realized as a process of obtaining a peak level (absolute value) at predetermined time intervals (for example, time intervals corresponding to each musical scale). Alternatively, it is realized as a process of executing a specific digital filtering process as described later on the absolute value of each output signal Yt (n).

【0095】以上のようにして、DSP116による時
分割処理によって、各音階t(1≦t≦N)についての
エンベロープ信号Et(n)が求まる。そして、前述したC
PU101による図4のステップS405の発音処理におい
て、後に詳述するようなレベル判断処理を実行すること
により、入力音響信号x(n) から音階情報を検出するこ
とができる。 <フィルタ処理の改良動作原理>上述のバンドパスフィ
ルタHt(z)は、それがチェビシェフ形フィルタとして実
現される場合についての原理説明であったが、例えば前
述したようなノートナンバーA4 に対応する中心周波数
が440[Hz]のバンドパスフィルタが構成された場
合、そのディジタルフィルタリング処理において各サン
プルタイミング毎に8回の乗算が必要となる。
As described above, the envelope signal Et (n) for each scale t (1 ≦ t ≦ N) is obtained by the time division processing by the DSP 116. And, C
In the sound generation process of step S405 in FIG. 4 by the PU 101, the scale information can be detected from the input audio signal x (n) by executing a level determination process as described later in detail. <Improved operation principle of filter processing> The above-described band-pass filter Ht (z) has been described in connection with the case where it is realized as a Chebyshev-type filter. For example, the center corresponding to the note number A4 as described above is used. When a bandpass filter having a frequency of 440 [Hz] is configured, the digital filtering requires eight multiplications at each sample timing.

【0096】そこで、ディジタルフィルタリング処理に
おける乗算回数を減らし、リアルタイムのフィルタ処理
を可能とする、フィルタ処理の改良された動作原理につ
き、図11〜図21を用いて以下に説明する。
The improved operation principle of the filtering process that reduces the number of multiplications in the digital filtering process and enables real-time filtering will be described below with reference to FIGS.

【0097】図11は、フィルタ処理の改良機能ブロッ
ク図である。図11では、図9の伝達関数Ht(z)(1≦
t≦N)を有するバンドパスフィルタ処理と等価なフィ
ルタ処理が、伝達関数H1(z)(全音階tで共通)を有す
るハイパスフィルタ処理と、伝達関数H2t(z) (1≦t
≦N)を有するローパスフィルタ処理とのカスケード処
理によって実現される。この場合、図9のバンドパスフ
ィルタの伝達関数Ht(z)は、図11のように、ハイパス
フィルタの伝達関数H1(z)とローパスフィルタの伝達関
数H2t(z) の積で表される。
FIG. 11 is an improved functional block diagram of the filter processing. In FIG. 11, the transfer function Ht (z) (1 ≦
t ≦ N), a high-pass filter process having a transfer function H1 (z) (common to all scales t) and a transfer function H2t (z) (1 ≦ t)
≦ N) by cascade processing with low-pass filter processing. In this case, the transfer function Ht (z) of the band-pass filter in FIG. 9 is represented by the product of the transfer function H1 (z) of the high-pass filter and the transfer function H2t (z) of the low-pass filter as shown in FIG.

【0098】ここで、ハイパスフィルタの伝達関数H1
(z)は、後に詳述するが、周波数0で0、周波数fs /
2[Hz]で出力が最大となる特性を有する。また、ロ
ーパスフィルタの伝達関数H2t(z) は、これも後に詳述
するが、各音階周波数で出力が極大となるレゾナンスタ
イプの特性を有する。従って、上述のハイパスフィルタ
H1(z)とローパスフィルタH2t(z) とがカスケード接続
されることにより得られるフィルタの伝達関数Ht(z)
は、図12の如く疑似的なバンドパスフィルタの特性と
なっている。図12で、各中心周波数f1 〜fN が各音
階周波数に対応し、また、隣接帯域間の周波数差はΔf
である。更に、Nの値は40〜50程度(本実施例の場
合、高域側の3〜4オクターブ分)にすることが可能で
ある。
Here, the transfer function H1 of the high-pass filter
(z), which will be described in detail later, is 0 at the frequency 0, and the frequency fs /
It has the characteristic that the output becomes maximum at 2 [Hz]. The transfer function H2t (z) of the low-pass filter has a resonance-type characteristic in which the output becomes maximum at each scale frequency, which will be described in detail later. Therefore, the transfer function Ht (z) of the filter obtained by cascading the above-described high-pass filter H1 (z) and low-pass filter H2t (z).
Are characteristics of a pseudo bandpass filter as shown in FIG. In FIG. 12, each center frequency f 1 to f N corresponds to each scale frequency, and the frequency difference between adjacent bands is Δf
It is. Furthermore, the value of N can be set to about 40 to 50 (in the case of this embodiment, 3 to 4 octaves on the high frequency side).

【0099】このようなフィルタリング処理によって得
られるローパスフィルタH2t(z) の各出力信号Wt(n)
(1≦t≦N)が、図11のように、伝達関数HEt(z)
(1≦t≦N)で示される各エンベロープ抽出部に入力
することによって、それぞれの出力としてエンベロープ
信号Et(n)(1≦t≦N)が得られる。このエンベロー
プ抽出部は、後に詳述するように、カットオフ周波数の
低いローパスフィルタとして実現される。
Each output signal Wt (n) of the low-pass filter H2t (z) obtained by such a filtering process.
(1 ≦ t ≦ N) is the transfer function H Et (z) as shown in FIG.
An envelope signal Et (n) (1 ≦ t ≦ N) is obtained as an output by inputting to each of the envelope extraction units represented by (1 ≦ t ≦ N). This envelope extraction unit is realized as a low-pass filter having a low cutoff frequency, as described later in detail.

【0100】つぎに、伝達関数H1(z)を有するハイパス
フィルタ、伝達関数H2t(z) を有するローパスフィル
タ、及び伝達関数HEt(z) を有するエンベロープ抽出部
の各フィルタ特性について、以下に詳細に説明する。
Next, the filter characteristics of the high-pass filter having the transfer function H1 (z), the low-pass filter having the transfer function H2t (z), and the envelope extracting section having the transfer function H Et (z) will be described in detail below. Will be described.

【0101】図13は、図11のハイパスフィルタH1
(z)をハードウエアのイメージで示した構成図である。
これは、2次のFIRディジタルフィルタであって、そ
の伝達関数は、
FIG. 13 shows the high-pass filter H1 of FIG.
FIG. 2 is a configuration diagram showing (z) by a hardware image.
This is a second-order FIR digital filter whose transfer function is

【0102】[0102]

【数3】 (Equation 3)

【0103】で示される。図13において、1301、
1302のz-1はサンプリング・クロック1周期分の遅
延を与える遅延素子を表し、1306、1307は加算
器である。また1303、1304、1305は乗算器
であり、×2、×1、×1/4 の各係数は、上記各乗算器
における乗算係数である。
Are shown. In FIG. 13, 1301,
Z -1 in 1302 represents a delay element for delaying one cycle of the sampling clock, and 1306 and 1307 are adders. Reference numerals 1303, 1304, and 1305 denote multipliers. Each of the coefficients x2, x1, and x1 / 4 is a multiplication coefficient in each of the multipliers.

【0104】DSP116では、図13のハイパスフィ
ルタと等価なフィルタ処理が、
In the DSP 116, filter processing equivalent to the high-pass filter in FIG.

【0105】[0105]

【数4】 (Equation 4)

【0106】なる離散演算処理により実現される。な
お、この場合、フィルタ係数は2の倍数であるので、係
数と信号の乗算は、単なるビットシフト処理で実現され
る。
This is realized by the following discrete operation processing. In this case, since the filter coefficient is a multiple of 2, the multiplication of the coefficient and the signal is realized by simple bit shift processing.

【0107】このハイパスフィルタの周波数特性は、The high-pass filter has the following frequency characteristics:

【0108】[0108]

【数5】 (Equation 5)

【0109】となり、Ω=0(0[Hz])でゲインが
最小、Ω=π(fs /2[Hz])でゲインが最大にな
る特性を有する。ここでfs は図1のA/D変換器11
5における音響信号x(n) のサンプリング周波数であ
る。図14にこのハイパスフィルタの特性を示す。サン
プリング定理により、fs /2〜fs [Hz]までの周
波数特性は、0〜fs /2[Hz]までの周波数特性が
fs /2[Hz]を境に折返った特性となっている。
The characteristic is such that the gain is minimum when Ω = 0 (0 [Hz]) and maximum when Ω = π (fs / 2 [Hz]). Here, fs is the A / D converter 11 of FIG.
5 is the sampling frequency of the acoustic signal x (n). FIG. 14 shows the characteristics of this high-pass filter. According to the sampling theorem, the frequency characteristics from fs / 2 to fs [Hz] are such that the frequency characteristics from 0 to fs / 2 [Hz] are turned around at fs / 2 [Hz].

【0110】続いて、図15は、図11のローパスフィ
ルタH2t(z) をハードウエアのイメージで示した構成図
である。これは、2次のIIRディジタルフィルタであ
り、その伝達関数は、
FIG. 15 is a block diagram showing the hardware of the low-pass filter H2t (z) shown in FIG. This is a second-order IIR digital filter whose transfer function is

【0111】[0111]

【数6】 (Equation 6)

【0112】で示される。そして、この式のθとCY
は、後述するように、各音階tに応じて変化し、またr
がレゾナンスの強さ、つまり出力ピークの大きさを示す
パラメータである。
## EQU12 ## Then, in this equation, θ and CY
Varies according to each scale t, and r
Is a parameter indicating the intensity of resonance, that is, the magnitude of the output peak.

【0113】図15において、1501、1502は、
サンプリング・クロック1周期分の遅延を与える遅延素
子を表し、1503、1504、1505は乗算器で、
それぞれに同図に示される係数−2rcosθ、r2
CYが乗算される。また、1506及び1507は加算
器である。
In FIG. 15, 1501 and 1502 are
Representing delay elements for delaying one cycle of the sampling clock, 1503, 1504 and 1505 are multipliers,
Coefficient shown in the drawing, each -2rcosθ, r 2,
CY is multiplied. 1506 and 1507 are adders.

【0114】DSP116においては、図15に示す構
成のローパスフィルタと等価なフィルタ演算処理が、
In the DSP 116, a filter operation equivalent to the low-pass filter having the configuration shown in FIG.

【0115】[0115]

【数7】 (Equation 7)

【0116】[0116]

【数8】 (Equation 8)

【0117】なる離散演算処理により実現される。ここ
で、伝達関数の極は、“**”をべき乗演算として、z1
=re**(jθ)、z2 =re**(-jθ)に存在し、z=
0に二重の零点がある。この極と零点の配置と、0<θ
<π/2としたときの極ベクトルと零点ベクトルとの関
係を図16に示す。
This is realized by the following discrete operation processing. Here, the pole of the transfer function is z 1 with “**” as a power operation.
= Re ** (jθ), z 2 = re ** (-jθ), and z =
There is a double zero at zero. The arrangement of the poles and zeros and 0 <θ
FIG. 16 shows the relationship between the pole vector and the zero point vector when <π / 2 is set.

【0118】同図から理解されるとおり、単位円に沿っ
て移動する点Pと零点0を結ぶ線分が実軸となす角度を
Ωとすると、Ω=0〜πにおいて、極ベクトルZ1 と零
点ベクトルV1 との差であるベクトルV2 の長さは、初
めは減少し、その後に増加する。ベクトルV2 の最小の
長さは、P点が極Z1 に最接近したとき、すなわち、θ
=Ωのときである。
As can be understood from the figure, assuming that the angle formed by the line segment connecting the point P moving along the unit circle and the zero point 0 with the real axis is Ω, the pole vector Z 1 and Ω = 0 to π the difference is that the length of the vector V 2 of the zero point vector V 1 was initially reduced and then increases to. The minimum length of the vector V 2 is when the point P is closest to the pole Z 1 , that is, θ
= Ω.

【0119】ここで、このローパスフィルタの周波数Ω
における周波数応答の大きさ(振幅特性)は、零点ベク
トルV1 とベクトルV2 のそれぞれの長さの比で定ま
る。そして、この零点ベクトルV1 の値は常に1である
から、周波数応答の大きさは、ベクトルV2 の大きさの
逆数に比例し、上述のようにθ=Ωで最大となる。また
周波数応答の大きさのピークは、rの値により定まり、
rの値が1に近づくほど大きくなる。図17は、Ω=−
π〜πにおけるこの周波数応答の大きさを表している。
Here, the frequency Ω of this low-pass filter
Magnitude of the frequency response (amplitude characteristics) of is determined by the respective ratio of the length of the zero vector V 1 and the vector V 2. Since the value of the zero point vector V 1 is always 1, the magnitude of the frequency response is proportional to the reciprocal of the magnitude of the vector V 2 , and becomes maximum at θ = Ω as described above. The peak of the magnitude of the frequency response is determined by the value of r,
It increases as the value of r approaches 1. FIG. 17 shows that Ω = −
The magnitude of this frequency response in π to π is shown.

【0120】一方、周波数応答の位相は、実軸と零点ベ
クトルV1 とのなす角Ωから、実軸とベクトルV2 との
なす角を引いた値になる。以上の説明から明らかなよう
に、各音階t(1≦t≦N)の中心周波数ftとサンプ
リング周波数fs を用いて、θ=2πfs /ft で求ま
るθの値を決めれば、図18に示されるように、各帯域
の中心周波数ft でピークを有するローパスフィルタが
実現される。
On the other hand, the phase of the frequency response is a value obtained by subtracting the angle between the real axis and the vector V 2 from the angle Ω between the real axis and the zero point vector V 1 . As apparent from the above description, with reference to the center frequency f t and the sampling frequency f s of the scale t (1 ≦ t ≦ N) , it is determined the value of theta obtained at θ = 2πf s / f t, FIG. 18 as shown in, a low-pass filter having a peak at each band of the center frequency f t can be realized.

【0121】この場合、ピークの大きさは、前述のよう
にrの値により変化するが、このrの値を選択してピー
クが隣の帯域に影響するのを防ぎ、また前述のCYの値
を選択して各帯域の出力Wt(n)のレベルがほぼ等しくな
るように設定することができる。
In this case, the magnitude of the peak varies depending on the value of r as described above. The value of r is selected to prevent the peak from affecting the adjacent band, and the value of CY described above is selected. Can be set so that the level of the output Wt (n) of each band becomes substantially equal.

【0122】上記rとCYの値は、例えば次のようにし
て求めることができる。今、各音階tの中心周波数ft
と、それからΔf離れた隣の音階t+1の中心周波数f
t+1 (=ft +Δf)との周波数応答の大きさの比をm
とすると、
The values of r and CY can be obtained, for example, as follows. Now, the center frequency f t of each scale t
And the center frequency f of the next scale t + 1 that is Δf away from it
The ratio of the magnitude of the frequency response to t + 1 (= f t + Δf) is represented by m
Then

【0123】[0123]

【数9】 (Equation 9)

【0124】というrについての4次方程式を解き、そ
の結果、得られたrのうち、0<r<1であるrを選
び、各係数−2rcosθ、r2 を求めることができ
る。数値計算の結果、例えばノートナンバーA4 に対応
する中心周波数が440[Hz]であり、サンプリング
周波数fs =5[kHz]、m=4とすると、 −2rcosθ=-1.9773 r2 = 0.9851 CY= 36.7 となる。その他の帯域についても同じようにして求める
ことができる。
By solving a quartic equation of r, as a result, among the obtained r, r satisfying 0 <r <1 is selected, and each coefficient −2rcos θ, r 2 can be obtained. Numerical results of the calculations, for example the center frequency is 440 corresponding to the note number A4 [Hz], the sampling frequency f s = 5 [kHz], When m = 4, -2rcosθ = -1.9773 r 2 = 0.9851 CY = 36.7 Becomes The other bands can be obtained in the same manner.

【0125】以上のような伝達関数H1(z)を有するロー
パスフィルタと伝達関数H2t(z) を有するローパスフィ
ルタが、図11に示されるようにカスケードに接続され
ることにより、各伝達関数の積として表される全体の伝
達関数Ht(z)によって、図12で前述したように、疑似
的なバンドパスフィルタの特性が実現される。
The low-pass filter having the transfer function H1 (z) and the low-pass filter having the transfer function H2t (z) are connected in cascade as shown in FIG. As described above with reference to FIG. 12, the characteristics of the pseudo bandpass filter are realized by the overall transfer function Ht (z) expressed as

【0126】つぎに、図19は、図11のエンベロープ
抽出部に対応するローパスフィルタ伝達特性HEt(z) を
ハードウエアのイメージで示した構成図である。これ
は、前述したローパスフィルタH2t(z) と同じ形の2次
のIIRディジタルフィルタで、その伝達関数は、
FIG. 19 is a block diagram showing a hardware image of the low-pass filter transfer characteristic H Et (z) corresponding to the envelope extraction unit in FIG. This is a second-order IIR digital filter having the same form as the low-pass filter H2t (z) described above, and its transfer function is

【0127】[0127]

【数10】 (Equation 10)

【0128】である。この式は数6式で前述したローパ
スフィルタの伝達関数H2t(z) において、r=0.9、
θ=0としたものに等しい。図19において、絶対値回
路1901は、図11のローパスフィルタH2t(z)の出
力Wt(n)の絶対値|Wt(n)|を出力し、次のディジタル
フィルタ部に送る。1902、1903はサンプリング
・クロック1周期分の遅延を与える遅延素子、190
4、1905及び1906は乗算器で、各乗算器には同
図に示される各係数が乗算される。また、1907及び
1908は加算器である。
Is as follows. This equation shows that in the transfer function H2t (z) of the low-pass filter described above in equation 6, r = 0.9,
It is equivalent to θ = 0. In FIG. 19, the absolute value circuit 1901 outputs the absolute value | Wt (n) | of the output Wt (n) of the low-pass filter H2t (z) in FIG. 11 and sends it to the next digital filter unit. 1902 and 1903 are delay elements for delaying one cycle of the sampling clock.
Reference numerals 4, 1905 and 1906 denote multipliers, each of which is multiplied by each coefficient shown in FIG. Reference numerals 1907 and 1908 denote adders.

【0129】DSP116では、図19に示される構成
のローパスフィルタと等価なフィルタ演算処理が、
In the DSP 116, a filter operation equivalent to the low-pass filter having the configuration shown in FIG.

【0130】[0130]

【数11】 [Equation 11]

【0131】なる離散演算処理により実現される。この
ローパスフィルタの周波数特性は、図20に示されるよ
うに、最大値を示すレゾナンスをΩ=0に有する。この
ローパスフィルタのカットオフ周波数は、エンベロープ
抽出という目的から、先の最低帯域のローパスフィルタ
H2t(z) のカットオフ周波数よりも、はるかに低い周波
数に設定される。
This is realized by the following discrete operation processing. As shown in FIG. 20, the frequency characteristic of this low-pass filter has a resonance having a maximum value at Ω = 0. The cut-off frequency of the low-pass filter is set to be much lower than the cut-off frequency of the low-pass filter H2t (z) in the lowest band for the purpose of extracting the envelope.

【0132】ここで、係数CEは、各音階t毎のそれぞ
れの出力レベルを合わせるためのものである。図21
は、図19のローパスフィルタで得られたエンベロープ
信号Et(n)を、ローパスフィルタH2t(z) の出力の絶対
値|Wt(n)|と対比させて模式的に示した図である。図
19の絶対値回路1901に相当する演算によって、入
力信号の負の波高値(図21の破線)が正の波高値に変
換された上で、ローパスフィルタ処理が行われる。これ
により、各音階t毎のエンベロープを求める動作が実現
される。 <フィルタ処理の具体的動作>上述のフィルタ処理の改
良原理に従い、入力される音響信号の音階(ピッチ)を
求める動作を、図22の動作フローチャートを用いて説
明する。この動作フローチャートは、図3のステップS
304の部分の詳細であり、DSP116が、オペレー
ションROM203内に記憶されているマイクロプログ
ラムを実行する動作として実現される。
Here, the coefficient CE is for adjusting the output level of each musical scale t. FIG.
FIG. 20 is a diagram schematically showing the envelope signal Et (n) obtained by the low-pass filter of FIG. 19 in comparison with the absolute value | Wt (n) | of the output of the low-pass filter H2t (z). After the negative peak value (broken line in FIG. 21) of the input signal is converted into a positive peak value by an operation corresponding to the absolute value circuit 1901 in FIG. 19, low-pass filtering is performed. As a result, an operation for obtaining an envelope for each scale t is realized. <Specific operation of filter processing> An operation of obtaining a scale (pitch) of an input acoustic signal in accordance with the above-described improved principle of the filter processing will be described with reference to an operation flowchart of FIG. This operation flowchart corresponds to step S in FIG.
Details of a part 304 are realized by the DSP 116 as an operation of executing a microprogram stored in the operation ROM 203.

【0133】図22の動作フローチャートに従ったフィ
ルタ処理により、音響信号の各サンプルx(n) が入力さ
れて図3のステップS304のフィルタ処理が繰り返し実行
される毎に、図11の各音階共通のハイパスフィルタ部
及び各音階毎のローパスフィルタイミング部とエンベロ
ープ抽出部に相当する処理が時分割処理で実行されるこ
とにより、サンプリング周期毎に各音階のエンベロープ
信号Et(n)が得られ、それが図3のステップS305の処理
によりCPU101に転送される。
Each time the sample x (n) of the audio signal is input and the filter processing of step S304 of FIG. 3 is repeatedly executed by the filter processing according to the operation flowchart of FIG. 22, each scale of FIG. The processing corresponding to the high-pass filter section and the low-pass fill timing section for each scale and the envelope extraction section is executed by time-division processing, so that the envelope signal Et (n) of each scale is obtained for each sampling period. Is transferred to the CPU 101 by the process of step S305 in FIG.

【0134】図22の動作フローチャートに関連し、ワ
ークRAM118には、図1のA/D変換器115から
入力される現在、1サンプル前及び2サンプル前の各音
響信号を保持する各変数x(n) 、x(n-1) 及びx(n-2)
、図11の伝達関数H1(z)を有するハイパスフィルタ
部の現在、1サンプル前及び2サンプル前の各出力を保
持する各変数s(n) 、s(n-1) 及びs(n-2) 、図11の
伝達関数H2t(z) を有する各音階tに対応するローパス
フィルタ部の現在、1サンプル前及び2サンプル前の各
出力を保持する各変数Wt(n)、Wt(n-1)及びWt(n-2)
(1≦t≦N)、そうして、図11の伝達関数HEt(z)
を有する各音階tに対応するエンベロープ抽出部の現
在、1サンプル前及び2サンプル前の各出力を保持する
各変数Et(n)、Et(n-1)及びEt(n-2)(1≦t≦N)
が、それぞれ格納される。
In connection with the operation flow chart of FIG. 22, the work RAM 118 stores, in the work RAM 118, each variable x () which holds the current one-sample and two-sample previous sound signals input from the A / D converter 115 of FIG. n), x (n-1) and x (n-2)
, S (n), s (n−1) and s (n−2) holding the current output of one sample before and two samples before of the high-pass filter unit having the transfer function H1 (z) of FIG. ), The variables Wt (n) and Wt (n-1) that hold the current output of one sample before and two samples before of the low-pass filter corresponding to each scale t having the transfer function H2t (z) in FIG. ) And Wt (n-2)
(1 ≦ t ≦ N), and the transfer function H Et (z) in FIG.
, The variables Et (n), Et (n-1) and Et (n-2) (1 ≦ 1) that hold the current output of one sample before and two samples before of the envelope extraction unit corresponding to each scale t having t ≦ N)
Are respectively stored.

【0135】図22において、まず、A/D変換器11
5から入力されてくる1サンプル分の音響信号が、図2
のワークRAM118内の変数x(n) に格納される(ス
テップS2201 )。
In FIG. 22, first, the A / D converter 11
The audio signal for one sample input from the input unit 5 is shown in FIG.
Is stored in the variable x (n) in the work RAM 118 (step S2201).

【0136】次に、ワークRAM118内の各変数x
(n) 、x(n-1) 及びx(n-2) から図2のレジスタ群20
8内の各レジスタに、現在のサンプルと過去2サンプル
分の音響信号が読み出され、図11の伝達関数H1(z)で
示されるハイパスフィルタ処理が実行される(ステップ
S2202 )。この処理は、前述の数4式で表される演算処
理であり、図2の乗算器205および加減算器207を
使って実行される。このとき数4式の演算に用いられる
各フィルタ係数は、ROM117から読み出される。こ
の結果得られた出力は、ワークRAM118内の変数s
(n) に格納される。
Next, each variable x in the work RAM 118
From (n), x (n-1) and x (n-2), the register group 20 of FIG.
The acoustic signals of the current sample and the past two samples are read out to each register in the block 8, and a high-pass filter process represented by a transfer function H1 (z) in FIG.
S2202). This processing is an arithmetic processing represented by the above-described Expression 4, and is executed using the multiplier 205 and the adder / subtractor 207 in FIG. At this time, each filter coefficient used for the calculation of Expression 4 is read from the ROM 117. The resulting output is the variable s in work RAM 118
(n).

【0137】以上のハイパスフィルタ処理は、各帯域で
共通な処理であるため、1回のみ実行される。次に、図
11の伝達関数H2t(z) を有する各音階tに対応するロ
ーパスフィルタ処理と、伝達関数HEt(z) を有する各音
階tに対応するエンベロープ抽出処理が続けて実行され
る。
The above-described high-pass filter processing is common to each band, and is therefore performed only once. Next, a low-pass filtering corresponding to each chromatic t having a transfer function H2t in FIG 11 (z), the envelope extraction process corresponding to each chromatic t having a transfer function H Et (z) are continuously executed.

【0138】これらの処理は、各音階tに対応して、N
音階分の時分割処理として繰り返される。そのために、
図2のレジスタ群208内に、N音階分の時分割処理を
行うための繰り返し制御用のレジスタtが設けられ、ス
テップS2203 でレジスタtの値が1に初期設定される。
These processes correspond to each scale t,
This is repeated as time division processing for the scale. for that reason,
A register t for repetition control for performing time division processing for N scales is provided in the register group 208 of FIG. 2, and the value of the register t is initialized to 1 in step S2203.

【0139】そして、ステップS2204 とS2205 で1音階
分のローパスフィルタ処理とエンベロープ抽出処理が終
了する毎に、ステップS2206 でレジスタtの内容がNに
達したか否かが判定され、達していなければ、ステップ
S2207 においてレジスタtの内容がインクリメントさ
れ、ステップS2204 とS2205 の処理が繰り返される。
Each time the low-pass filter processing and envelope extraction processing for one musical scale are completed in steps S2204 and S2205, it is determined in step S2206 whether or not the content of the register t has reached N. , Step
In step S2207, the content of the register t is incremented, and the processes in steps S2204 and S2205 are repeated.

【0140】このジャッジ処理は、図2の加減算器20
7とフラグレジスタ206によって実行され、アドレス
カウンタ202によって、ステップS2204、およびS2205
に対応するプログラム命令群がオペレーションROM
203から繰り返し読み出される。
This judgment processing is performed by the adder / subtractor 20 shown in FIG.
7 and the flag register 206, and the address counter 202 determines in steps S2204 and S2205
Operation ROM is the program instruction group corresponding to
It is repeatedly read from 203.

【0141】まず、ROM117から、レジスタtで示
される番号に対応する音階のフィルタ係数CY、2rc
osθ及びr2 が読み出される。そして、ワークRAM
118の各変数s(n) 、s(n-1) 及びs(n-2) から図2
のレジスタ群208内の各レジスタに、現在のサンプル
と過去2サンプル分のステップS2202 におけるハイパス
フィルタ処理の出力信号が読み出され、これらの信号に
対して上述のフィルタ係数を用いて図11の伝達関数H
2t(z) で示されるローパスフィルタ処理が実行される
(ステップS2204 )。この処理は、前述の数7式で表さ
れる演算処理であり、図2の乗算器205および加減算
器207を使って実行される。この結果得られた出力
は、ワークRAM118内の変数Wt(n)に格納される。
なお、この変数の添え字tは、現在のレジスタtの値に
対応している。
First, the filter coefficients CY, 2rc of the scale corresponding to the number indicated by the register t are read from the ROM 117.
osθ and r 2 are read. And work RAM
From the variables s (n), s (n-1) and s (n-2) of FIG.
The output signals of the high-pass filter processing in step S2202 for the current sample and the past two samples are read out to each register in the register group 208, and the signals shown in FIG. Function H
A low-pass filter process represented by 2t (z) is executed (step S2204). This processing is an arithmetic processing represented by the above-described Expression 7, and is executed using the multiplier 205 and the adder / subtractor 207 in FIG. The resulting output is stored in variable Wt (n) in work RAM 118.
Note that the subscript t of this variable corresponds to the current value of the register t.

【0142】続いて、ROM117から、レジスタtで
示される番号に対応する音階のフィルタ係数CE、「1.
8 」及び「0.81」が読み出される。そして、上述のロー
パスフィルタ処理の出力である変数Wt(n)の内容と、ワ
ークRAM118からレジスタ群208内のレジスタに
読み出された過去2サンプルのローパスフィルタ処理の
出力Wt(n-1)及びWt(n-2)に対して、上述のフィルタ係
数を用いて図11の伝達関数HEt(z) で示されるエンベ
ロープ抽出処理(ローパスフィルタ処理)が実行される
(ステップS2205 )。この処理は、前述の数11式で表
される演算処理であり、図2の乗算器205および加減
算器207を使って実行される。この結果得られた出力
は、ワークRAM118内の変数Et(n)に格納される。
なお、この変数の添え字tは、現在のレジスタtの値に
対応している。
Subsequently, from the ROM 117, the filter coefficient CE of the scale corresponding to the number indicated by the register t, "1.
8 ”and“ 0.81 ”are read out. Then, the contents of the variable Wt (n), which is the output of the above low-pass filter processing, the output Wt (n-1) of the low-pass filter processing of the past two samples read from the work RAM 118 to the registers in the register group 208, and An envelope extraction process (low-pass filter process) represented by the transfer function Het (z) in FIG. 11 is performed on Wt (n-2) using the above-described filter coefficients (step S2205). This processing is an arithmetic processing represented by the above-described Expression 11, and is executed using the multiplier 205 and the adder / subtractor 207 in FIG. The output obtained as a result is stored in a variable Et (n) in the work RAM 118.
Note that the subscript t of this variable corresponds to the current value of the register t.

【0143】以上、ステップS2204 〜S2207 の処理の繰
り返しにより、図11のN音階分のローパスフィルタ部
とエンベロープ抽出部に相当する処理が行われ、この結
果、サンプリング周期毎に各音階のエンベロープ信号E
t(n)が得られ、それが図3のステップS305の処理により
CPU101に転送される。ゼロクロス検出処理による発音処理 続いて、図4のCPU処理におけるゼロクロス検出処理
による発音処理について説明する。
As described above, by repeating the processing of steps S2204 to S2207, the processing corresponding to the low-pass filter section and the envelope extracting section for N scales in FIG. 11 is performed.
t (n) is obtained, and is transferred to the CPU 101 by the processing in step S305 in FIG. Next, the sound generation processing by the zero-cross detection processing in the CPU processing of FIG. 4 will be described.

【0144】前述したように、図4のステップS403の判
定において、DSP116でのゼロクロス検出(図3の
ステップS303)により得られたノート・ナンバーPIT の
値が所定の音階Kより下である、即ち、入力された音響
信号のピッチが低いと判定されたら、ステップS404にお
いて、DSP116でのゼロクロス検出の処理結果に基
づいて、楽音発生回路108に対して発音処理が実行さ
れる。
As described above, in the determination in step S403 in FIG. 4, the value of the note number PIT obtained by the zero-cross detection by the DSP 116 (step S303 in FIG. 3) is lower than the predetermined scale K, that is, If it is determined that the pitch of the input audio signal is low, in step S404, a tone generation process is executed on the tone generation circuit 108 based on the processing result of the zero-cross detection by the DSP 116.

【0145】図23は、図4のステップS404のゼロクロ
ス検出処理による発音処理の動作フローチャートであ
る。この動作フローチャートは、CPU101が、RA
M103内の制御プログラムを実行する動作として実現
される。
FIG. 23 is an operation flowchart of the sound generation process by the zero-cross detection process of step S404 in FIG. This operation flowchart shows that the CPU 101
This is realized as an operation of executing the control program in M103.

【0146】図23の動作フローチャートに関連して、
RAM103には、DSP116から転送されてきたピ
ッチに対応するノート・ナンバーを格納する変数PIT と
エンベロープ値を格納する変数ENV、及び現在発音中
のノートナンバーを保持する変数ON NOW等が保持されて
いる。
In connection with the operation flowchart of FIG.
The RAM 103 holds a variable PIT for storing a note number corresponding to the pitch transferred from the DSP 116, a variable ENV for storing an envelope value, a variable ON NOW for storing a currently sounding note number, and the like. .

【0147】図23において、まず、DSP116から
転送されてきたエンベロープ値ENVの値が、所定の閾
値THRESHOLD を超え、かつノートナンバーPIT の値が0
より大きいか否かが判定される(ステップS2301 )。
In FIG. 23, first, the value of the envelope value ENV transferred from the DSP 116 exceeds a predetermined threshold value THRESHOLD, and the value of the note number PIT is 0.
It is determined whether or not it is larger than (step S2301).

【0148】その判定がNOならば、図1の楽音発生回
路108で発音中の全ての楽音に対して消音が指示さ
れ、かつ発音中の音が無いことを示すために変数ON NOW
がクリアされて(ステップS2306 )、ゼロクロス検出に
よる発音処理を終了する。
If the determination is NO, the tone generation circuit 108 shown in FIG. 1 instructs all the tones being sounded to be muted, and sets the variable ON NOW to indicate that there is no sound being sounded.
Is cleared (step S2306), and the sound generation process based on the zero-cross detection ends.

【0149】即ち、エンベロープ値ENVの値は、図6
のステップS606に対応する図8の動作フローチャートな
どから理解されるように、入力音響信号の平均的な振幅
を示している。従って、入力音響信号の平均振幅が小さ
いうちは、入力音響信号に基づく発音処理は行われない
ということになる。
That is, the value of the envelope value ENV is calculated as shown in FIG.
As can be understood from the operation flowchart of FIG. 8 corresponding to step S606, the average amplitude of the input audio signal is shown. Therefore, while the average amplitude of the input audio signal is small, the sound generation processing based on the input audio signal is not performed.

【0150】また、ノートナンバーPIT の値が0である
ということは、図7の動作フローチャートで示されるD
SP116でのゼロクロス検出において、STATUS FLAG
の値が4にならずに実質的なノートナンバーの検出(ス
テップS621)が行われなかったということになる。従っ
て、このような場合にも、入力音響信号に基づく発音処
理は行われないということになる。
The fact that the value of the note number PIT is 0 means that the note number PIT is 0 in the operation flowchart shown in FIG.
In the zero cross detection by SP116, STATUS FLAG
Does not become 4 and the substantial note number is not detected (step S621). Therefore, even in such a case, the sound generation processing based on the input sound signal is not performed.

【0151】図23のステップS2301 の判定がYESな
らば、変数ON NOWの値が0か否か判別されることにより
現在発音中の音がないか否かが判定され(ステップS230
2 )、その判定がYESならば、ステップS2305 に進
む。
If the determination in step S2301 in FIG. 23 is YES, it is determined whether or not the value of the variable ON NOW is 0, thereby determining whether or not there is any sound currently being generated (step S230).
2) If the determination is YES, the process proceeds to step S2305.

【0152】ステップS2305 の判定がNOで現在発音中
の音があると判定されたなら、発音中のノートナンバー
を示す変数ON NOWの内容と抽出されたノートナンバーを
示す変数PIT の内容が比較される(ステップS2303 )。
If the determination in step S2305 is NO and it is determined that there is a currently sounding note, the contents of the variable ON NOW indicating the note number being sounded and the contents of the variable PIT indicating the extracted note number are compared. (Step S2303).

【0153】比較の結果、両者が一致すれば、再発音す
る必要がないのでそのままゼロクロス検出による発音処
理を終了し、両者が一致しなければ、発音すべきノート
ナンバーが変化したことになるため、現在発音中の音の
消音が楽音発生回路108に対して指示された後に(ス
テップS2304 )、ステップS2305が実行される。
As a result of the comparison, if they match, the tone generation process by zero-cross detection is terminated as it is not necessary to re-sound, and if they do not match, the note number to be emitted has changed. After instructing the tone generation circuit 108 to mute the currently sounding sound (step S2304), step S2305 is executed.

【0154】ステップS2305 では、ノートナンバーPIT
で示される音階の楽音の発音が楽音発生回路108に対
して指示されると共に、変数ON NOWに変数PIT の値が代
入されて、現在、変数PIT に対応する音階の楽音が発音
中であることが示される。この処理の後、ゼロクロス検
出による発音処理を終了する。
In step S2305, note number PIT
Is given to the tone generation circuit 108, the value of the variable PIT is substituted for the variable ON NOW, and the tone of the scale corresponding to the variable PIT is currently being produced. Is shown. After this processing, the sound generation processing based on the zero-cross detection ends.

【0155】以上のようにして、入力された音響信号の
ピッチが低い場合には、ゼロクロス検出によって得られ
る音階(ピッチ)データを用いて楽音が発音される。フィルタ処理による発音処理 続いて、図4のCPU処理におけるフィルタ処理による
発音処理について説明する。
As described above, when the pitch of the input acoustic signal is low, a musical tone is generated using scale (pitch) data obtained by zero-cross detection. Next, the sound generation processing by the filter processing in the CPU processing of FIG. 4 will be described.

【0156】前述したように、図4のステップS403の判
定において、DSP116でのゼロクロス検出(図3の
ステップS303)により得られたノート・ナンバーPIT の
値が所定の音階Kより上である、即ち、入力された音響
信号のピッチが高いと判定されたら、ステップS404にお
いて、DSP116でのフィルタ処理(図3のステップ
S304)の処理結果に基づいて、楽音発生回路108に対
して発音処理が実行される(ステップS405)。
As described above, in the determination at step S403 in FIG. 4, the value of the note number PIT obtained by the zero-cross detection by the DSP 116 (step S303 in FIG. 3) is above the predetermined scale K, that is, If it is determined that the pitch of the input acoustic signal is high, in step S404, the filter processing in the DSP 116 (the step of FIG.
Based on the processing result of S304), a tone generation process is executed for the tone generation circuit 108 (step S405).

【0157】図24は、図4のステップS404のフィルタ
処理による発音処理の動作フローチャートである。この
動作フローチャートもゼロクロス検出の場合と同様、C
PU101がRAM103内の制御プログラムを実行す
る動作として実現される。
FIG. 24 is an operation flowchart of the sound generation processing by the filter processing in step S404 in FIG. This operation flowchart is similar to the case of zero-cross detection,
The PU 101 is realized as an operation of executing a control program in the RAM 103.

【0158】図24で、まず、DSP116から転送さ
れてきたN音階分のエンベロープ信号Et(n)(1≦t≦
N)がRAM103に格納される(ステップS2401 )。
次に、これらのエンベロープ信号Et(n)(1≦t≦N)
のうち、その値が所定の閾値を越えているものが全部取
り出される(ステップS2402 )。
In FIG. 24, first, the envelope signal Et (n) for N scales transferred from the DSP 116 (1 ≦ t ≦
N) is stored in the RAM 103 (step S2401).
Next, these envelope signals Et (n) (1 ≦ t ≦ N)
Among them, those whose values exceed a predetermined threshold are all extracted (step S2402).

【0159】上記閾値を越えているエンベロープ信号が
あれば(ステップS2403 の判定がYESならば)、それ
らのうち値が最大となるものが抽出され、そのエンベロ
ープ信号に対応する音階が検出される(ステップS240
4)。ここで、上記N個の音階は、予めROM102等
にプリセットされており、CPU101は、値が最大と
なるエンベロープ信号の番号tでROM102をアクセ
スすることにより、その音階を検出する。
If there is an envelope signal exceeding the threshold value (if the determination in step S2403 is YES), the one having the maximum value is extracted from them, and the scale corresponding to the envelope signal is detected (step S2403). Step S240
Four). Here, the N scales are preset in the ROM 102 or the like in advance, and the CPU 101 detects the scale by accessing the ROM 102 with the envelope signal number t having the maximum value.

【0160】次に、取り出された音階の楽音が、楽音発
生回路108において現在発音中か否かが判定される
(ステップS2405 )。発音中であるならば(ステップS2
405 の判定がYESならば)、再発音する必要がないの
でそのままフィルタ処理による発音処理を終了し、発音
中でないならば、別の音階の楽音が発音中か否かが判定
される(ステップS2406 )。
Next, it is determined in the musical tone generating circuit 108 whether the extracted musical tone of the musical scale is currently being generated (step S2405). If pronunciation is in progress (Step S2
If the determination in step 405 is YES), there is no need to re-produce the sound, so that the sound generation processing by the filter processing is terminated as it is. ).

【0161】そして、別の音階の楽音が発音中でないな
らば(ステップS2406 の判定がNOならば)、ステップ
S2404 で取り出された音階による楽音の発音が楽音発生
回路108に対して指示される(ステップS2407 )。
If a musical tone of another scale is not being produced (if the judgment in step S2406 is NO), the step
The tone generation circuit 108 is instructed to generate a tone based on the scale extracted in S2404 (step S2407).

【0162】また、別の音階の楽音が発音中であるなら
ば、その楽音の消音処理を行った後に(ステップS2408
)、ステップS2407 の発音処理が行われる。ステップS
2407 の処理の後、フィルタ処理による発音処理を終了
する。
If a musical tone of another musical scale is being generated, the musical tone is silenced (step S2408).
), The sound generation processing of step S2407 is performed. Step S
After the processing of 2407, the sound generation processing by the filter processing ends.

【0163】以上のようにして、入力された音響信号の
ピッチが高い場合には、フィルタ処理によって得られる
音階(ピッチ)データを用いて楽音が発音される。
As described above, when the pitch of the input acoustic signal is high, a musical tone is generated using scale (pitch) data obtained by the filtering process.

【0164】[0164]

【発明の効果】本発明によれば、ゼロクロス検出による
ピッチ抽出方式の出力とディジタルフィルタリングによ
るピッチ抽出方式の出力をピッチ周波数に応じて切替え
て選択することにより、両者の長所を生かした高精度な
ピッチ抽出を実現することが可能となる。
According to the present invention, the output of the pitch extraction system based on the zero-crossing detection and the output of the pitch extraction system based on the digital filtering are switched and selected according to the pitch frequency. It is possible to realize pitch extraction.

【0165】特に、ディジタルフィルタリングによるピ
ッチ抽出方式がピッチ周波数の高い範囲でのみ使用され
ることにより、フィルタ係数の値を小さくすることがで
き、通常のDSP等によって容易にディジタルフィルタ
を構成することが可能となる。
In particular, since the pitch extraction method using digital filtering is used only in a high pitch frequency range, the value of the filter coefficient can be reduced, and the digital filter can be easily formed by a normal DSP or the like. It becomes possible.

【0166】更に、本発明によるピッチ抽出装置が電子
楽器の音階検出装置として使用される場合、音階が高い
範囲の音階周波数の差は大きな値となるため、カットオ
フ周波数の急俊なディジタルフィルタを構成する必要が
なくなり、その結果バンドパスフィルタの次数を低くす
ることができ、DSP等によるリアルタイム処理を容易
に実現可能となる。
Further, when the pitch extracting device according to the present invention is used as a musical scale detecting device of an electronic musical instrument, the difference between musical scale frequencies in a high musical scale range becomes a large value. This eliminates the need for configuration, and as a result, the order of the bandpass filter can be reduced, and real-time processing by a DSP or the like can be easily realized.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の実施例の全体構成図である。FIG. 1 is an overall configuration diagram of an embodiment of the present invention.

【図2】DSPの全体構成図である。FIG. 2 is an overall configuration diagram of a DSP.

【図3】DSP処理の全体動作フローチャートである。FIG. 3 is an overall operation flowchart of a DSP process.

【図4】CPU処理の全体動作フローチャートである。FIG. 4 is an overall operation flowchart of a CPU process.

【図5】ゼロクロス検出の原理説明図である。FIG. 5 is a diagram illustrating the principle of zero-cross detection.

【図6】ゼロクロス検出の動作フローチャート(その
1)である。
FIG. 6 is an operation flowchart (part 1) of zero-cross detection.

【図7】ゼロクロス検出の動作フローチャート(その
2)である。
FIG. 7 is an operation flowchart (part 2) of zero-cross detection.

【図8】ゼロクロス検出におけるエンベロープ抽出の動
作フローチャートである。
FIG. 8 is an operation flowchart of envelope extraction in zero-cross detection.

【図9】フィルタ処理の基本機能ブロック図である。FIG. 9 is a basic functional block diagram of a filtering process.

【図10】バンドパスフィルタHt(z)の特性図である。FIG. 10 is a characteristic diagram of the bandpass filter Ht (z).

【図11】フィルタ処理の改良機能ブロック図である。FIG. 11 is an improved functional block diagram of the filter processing.

【図12】バンドパスフィルタH1(z)・H2t(z) の特性
図である。ある。
FIG. 12 is a characteristic diagram of bandpass filters H1 (z) and H2t (z). is there.

【図13】ハイパスフィルタH1(z)の構成図である。FIG. 13 is a configuration diagram of a high-pass filter H1 (z).

【図14】ハイパスフィルタH1(z)の特性図である。FIG. 14 is a characteristic diagram of the high-pass filter H1 (z).

【図15】ローパスフィルタH2t(z) の構成図である。FIG. 15 is a configuration diagram of a low-pass filter H2t (z).

【図16】ローパスフィルタH2t(z) の極と零点及び極
ベクトルと零ベクトルの関係図である。
FIG. 16 is a diagram showing the relationship between the poles and zeros of the low-pass filter H2t (z) and the relationship between the pole vectors and the zero vectors.

【図17】ローパスフィルタH2t(z) の振幅特性図であ
る。ある。
FIG. 17 is an amplitude characteristic diagram of the low-pass filter H2t (z). is there.

【図18】ローパスフィルタH2t(z) の特性図である。
ある。
FIG. 18 is a characteristic diagram of the low-pass filter H2t (z).
is there.

【図19】ローパスフィルタHEt(z) の構成図である。FIG. 19 is a configuration diagram of a low-pass filter H Et (z).

【図20】ローパスフィルタHEt(z) の特性図である。FIG. 20 is a characteristic diagram of a low-pass filter H Et (z).

【図21】|Wt(n)|とEt(n)の関係図である。FIG. 21 is a relationship diagram between | Wt (n) | and Et (n).

【図22】フィルタ処理の動作フローチャートである。FIG. 22 is an operation flowchart of a filter process.

【図23】ゼロクロス検出による発音処理の動作フロー
チャートである。
FIG. 23 is an operation flowchart of sound generation processing by zero-cross detection.

【図24】フィルタ処理による発音処理の動作フローチ
ャートである。
FIG. 24 is an operation flowchart of sound generation processing by filter processing.

【符号の説明】[Explanation of symbols]

101 CPU 102 ROM 103 RAM 104 プリンタ 105 ディスプレイ 106 キーボード 107 バス 108 楽音発生回路 109 オーディオシステム 110 スピーカ 111 音階検出部 112 マイク 113 マイクアンプ 114 ローパスフィルタ 115 A/D変換器 116 DSP 117 ROM 201 インタフェース 202 アドレスカウンタ 203 オペレーションROM 204 デコーダ 205 乗算器 206 フラグレジスタ 207 加減算器 208 レジスタ群 101 CPU 102 ROM 103 RAM 104 Printer 105 Display 106 Keyboard 107 Bus 108 Musical tone generating circuit 109 Audio system 110 Speaker 111 Scale detector 112 Microphone 113 Microphone amplifier 114 Low-pass filter 115 A / D converter 116 DSP 117 ROM 201 Interface 202 Address counter 203 Operation ROM 204 Decoder 205 Multiplier 206 Flag register 207 Adder / subtractor 208 Register group

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 入力される音響信号から値が負又は正の
第1の極性から他方の第2の極性へ変化するゼロクロス
点を順次検出し、該各ゼロクロス点間の間隔から前記音
響信号のピッチ情報を検出する第1のピッチ検出手段
と、 前記音響信号に対して異なる特性のディジタルフィルタ
リング処理を時分割で順次行うことにより、該処理に対
応する各々所定の複数の周波数に関する各周波数スペク
トルのレベルを検出し、該各周波数スペクトルのレベル
を判定することにより前記音響信号のピッチ情報を検出
する第2のピッチ検出手段と、 前記第1のピッチ検出手段又は前記第2のピッチ検出手
段の何れかで検出されたピッチ情報が所定の周波数閾値
以下のピッチ周波数に対応しているならば前記第1のピ
ッチ検出手段からのピッチ情報を出力し、所定の周波数
閾値以上のピッチ周波数に対応しているならば前記第2
のピッチ検出手段からのピッチ情報を出力する選択手段
と、 を有することを特徴とするピッチ抽出装置。
1. A zero-cross point at which a value changes from a negative or positive first polarity to another second polarity is sequentially detected from an input sound signal, and the sound signal of the sound signal is detected from an interval between the zero-cross points. First pitch detecting means for detecting pitch information; and sequentially performing digital filtering processing of different characteristics on the audio signal in a time-division manner, thereby obtaining a frequency spectrum of each of a plurality of predetermined frequencies corresponding to the processing. A second pitch detecting means for detecting a level and detecting the pitch information of the acoustic signal by determining the level of each frequency spectrum; and any one of the first pitch detecting means or the second pitch detecting means If the detected pitch information corresponds to a pitch frequency equal to or lower than a predetermined frequency threshold, the pitch information from the first pitch detecting means is output. Wherein if in response that the pitch frequency higher than a predetermined frequency threshold second
Selecting means for outputting pitch information from the pitch detecting means.
【請求項2】 前記第1のピッチ検出手段は、 前記音響信号が負又は正の第1の極性から他方の第2の
極性へゼロクロスするゼロクロス点から次に前記第2の
極性から前記第1の極性へゼロクロスするゼロクロス点
までの間隔を第1の間隔として計測する第1の間隔計測
手段と、 該第1の間隔計測手段による計測の終了後、前記音響信
号が前記第1の極性から前記第2の極性へゼロクロスす
るゼロクロス点から次に前記第2の極性から前記第1の
極性へゼロクロスするゼロクロス点までの各々の区間の
間隔を第2の間隔として順次計測する第2の間隔計測手
段と、 前記第1の間隔計測手段による計測が開始されたゼロク
ロス点からの間隔を逐次計測する第3の間隔計測手段
と、 前記第2の計測手段が前記各第2の間隔の計測を開始し
た各時点において前記第3の間隔計測手段が計測してい
る間隔を周期情報として順次更新しながら記憶する間隔
記憶手段と、 前記第1の間隔計測手段が計測した前記第1の間隔と前
記第2の間隔計測手段が順次計測した前記各第2の間隔
が、所定の許容誤差範囲内で一致したか否かを順次判定
する判定手段と、 該判定手段が前記一致を検出した時点で前記時間記憶手
段に記憶されている前記周期情報を前記音響信号のピッ
チ情報として出力し、その後、前記第1の間隔計測手段
による計測処理から順に前記各処理を繰り返させること
により前記音響信号からピッチ情報を順次抽出する繰り
返し制御手段と、 を含むことを特徴とする請求項1に記載のピッチ抽出装
置。
2. The apparatus according to claim 1, wherein said first pitch detecting means comprises: a zero-crossing point at which said acoustic signal crosses zero from a negative or positive first polarity to another second polarity; A first interval measuring means for measuring an interval up to a zero crossing point at which a zero crossing is made to the polarity of the first interval, after the measurement by the first interval measuring means is completed, the sound signal is converted from the first polarity to the first polarity. A second interval measuring means for sequentially measuring, as a second interval, an interval of each section from a zero-cross point at which a zero-cross to the second polarity crosses to a zero-cross point at which the second polarity crosses to the first polarity; A third interval measuring unit that sequentially measures an interval from a zero-cross point at which the measurement by the first interval measuring unit is started; and the second measuring unit starts measuring each of the second intervals. Each hour , An interval storage means for storing the interval measured by the third interval measuring means while sequentially updating the interval information as cycle information; and the first interval and the second interval measured by the first interval measuring means. Determining means for sequentially determining whether or not each of the second intervals sequentially measured by the measuring means matches within a predetermined allowable error range; and when the determining means detects the match, the time storage means The stored cycle information is output as pitch information of the sound signal, and thereafter, the pitch information is sequentially extracted from the sound signal by repeating the processing in order from the measurement processing by the first interval measuring means. The pitch extraction device according to claim 1, further comprising: a repetition control unit.
【請求項3】 前記第2のピッチ検出手段は、 所定の特性のハイパスフィルタリング処理と、前記各所
定の周波数でピークを有するレゾナンスが付加された各
ローパスフィルタリング処理とを前記音響信号に対して
時分割のカスケード処理として順次実行し、 その結果得られる前記各所定の周波数に対応する各出力
信号から各エンベロープ成分を抽出する信号処理を時分
割で順次実行し、 その結果得られる前記各所定の周波数に対応する各エン
ベロープ成分として前記各周波数スペクトルのレベルを
検出する、 ことを特徴とする請求項1又は2の何れか1項に記載の
ピッチ抽出装置。
3. The method according to claim 2, wherein the second pitch detecting means performs a high-pass filtering process of a predetermined characteristic and a low-pass filtering process of adding a resonance having a peak at each of the predetermined frequencies to the audio signal. Cascade processing of division is sequentially performed, and signal processing for extracting each envelope component from each output signal corresponding to each of the predetermined frequencies obtained as a result is sequentially performed in a time division manner. Each of the predetermined frequencies obtained as a result is obtained. 3. The pitch extraction device according to claim 1, wherein a level of each of the frequency spectra is detected as each envelope component corresponding to (b).
【請求項4】 請求項1乃至3の何れか1項に記載のピ
ッチ抽出装置からのピッチ情報に対応する音階の楽音を
発生する楽音発生手段を更に有する、 ことを特徴とする電子楽器。
4. An electronic musical instrument further comprising a musical tone generating means for generating musical tones of a scale corresponding to pitch information from the pitch extracting device according to claim 1.
JP18748691A 1991-07-26 1991-07-26 Pitch extraction device and electronic musical instrument using the same Expired - Fee Related JP3149466B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18748691A JP3149466B2 (en) 1991-07-26 1991-07-26 Pitch extraction device and electronic musical instrument using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18748691A JP3149466B2 (en) 1991-07-26 1991-07-26 Pitch extraction device and electronic musical instrument using the same

Publications (2)

Publication Number Publication Date
JPH0535296A JPH0535296A (en) 1993-02-12
JP3149466B2 true JP3149466B2 (en) 2001-03-26

Family

ID=16206912

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18748691A Expired - Fee Related JP3149466B2 (en) 1991-07-26 1991-07-26 Pitch extraction device and electronic musical instrument using the same

Country Status (1)

Country Link
JP (1) JP3149466B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101121217B1 (en) * 2011-10-14 2012-03-22 주식회사 스마트송 Apparatus for estimating pitch in time domain using iir filter

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3669129B2 (en) * 1996-11-20 2005-07-06 ヤマハ株式会社 Sound signal analyzing apparatus and method
JP3888370B2 (en) * 1996-11-20 2007-02-28 ヤマハ株式会社 Sound signal analyzing apparatus and method
JP3888372B2 (en) * 1996-11-20 2007-02-28 ヤマハ株式会社 Sound signal analyzing apparatus and method
EP1605439B1 (en) * 2004-06-04 2007-06-27 Honda Research Institute Europe GmbH Unified treatment of resolved and unresolved harmonics

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101121217B1 (en) * 2011-10-14 2012-03-22 주식회사 스마트송 Apparatus for estimating pitch in time domain using iir filter

Also Published As

Publication number Publication date
JPH0535296A (en) 1993-02-12

Similar Documents

Publication Publication Date Title
JP2775651B2 (en) Scale detecting device and electronic musical instrument using the same
EP0484137B1 (en) Digital filter for a music synthesizer
US5157215A (en) Electronic musical instrument for modulating musical tone signal with voice
US5270954A (en) Filter device and electronic musical instrument using the filter device
US5367120A (en) Musical tone signal forming device for a stringed musical instrument
JP3149466B2 (en) Pitch extraction device and electronic musical instrument using the same
CN101149916A (en) Filter device and electronic musical instrument using the filter device
US4231277A (en) Process for forming musical tones
JP3203687B2 (en) Tone modulator and electronic musical instrument using the tone modulator
JP2779983B2 (en) Electronic musical instrument
JPH10149187A (en) Audio information extracting device
JP3127406B2 (en) Tempo detection device
JP3185266B2 (en) Music generator
JPH06214571A (en) Distortion circuit
JP3149097B2 (en) Sound component extraction device, electronic musical instrument using the same, and frequency component extraction device
JP3321921B2 (en) Sound component extraction device, electronic musical instrument using the same, and frequency component extraction device
JPH04318597A (en) Chord decision device and automatic accompaniment device using the same
JP3258318B2 (en) Voice-controlled electronic musical instruments
JP3120468B2 (en) Scale detecting device and musical tone generating device using the same
JP3166197B2 (en) Voice modulator and electronic musical instrument incorporating voice modulator
JPH05346787A (en) Speech operated control musical sound generating device
JP3118863B2 (en) Musical tone generator using scale detection device
JP3274503B2 (en) Music processing equipment
JPH05346783A (en) Scale detecting device
JPH10171454A (en) Timbre control device and method therefor

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20001219

LAPS Cancellation because of no payment of annual fees