JP3092198B2 - Pitch extraction device - Google Patents

Pitch extraction device

Info

Publication number
JP3092198B2
JP3092198B2 JP10098691A JP10098691A JP3092198B2 JP 3092198 B2 JP3092198 B2 JP 3092198B2 JP 10098691 A JP10098691 A JP 10098691A JP 10098691 A JP10098691 A JP 10098691A JP 3092198 B2 JP3092198 B2 JP 3092198B2
Authority
JP
Japan
Prior art keywords
interval
value
zero
amplitude
measuring means
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
JP10098691A
Other languages
Japanese (ja)
Other versions
JPH04330500A (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 JP10098691A priority Critical patent/JP3092198B2/en
Publication of JPH04330500A publication Critical patent/JPH04330500A/en
Priority to US08/154,157 priority patent/US5349130A/en
Application granted granted Critical
Publication of JP3092198B2 publication Critical patent/JP3092198B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Electrophonic Musical Instruments (AREA)
  • Measurement Of Mechanical Vibrations Or Ultrasonic Waves (AREA)

Abstract

PURPOSE:To correctly measure zero-cross intervals of an input waveform corresponding to a one-pitch period by eliminating the influence of the zero crossing of harmonic components when pitches are extracted from a voice signal of a human voice, a musical sound, etc. CONSTITUTION:A CPU measures the cumulative values of the interval between zero-cross points at both ends of, a wave form part (a) whose polarity is, for example, positive and the amplitude of the waveform part (a) and then extracts the interval between the start points (zero-cross point) of waveforms (a) and (d) as the pitch period of the input waveform when finding the waveform part (d) which is at the shortest distance in terms of time while both the cumulative values of the intervals between zero-cross points at both ends of equal-polarity waveform parts (b), (c), and (d) and the amplitudes of the waveform parts are nearly equal to the cumulative values of the interval and amplitude of the waveform part (a).

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 of a waveform from an input audio signal.

【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 of the pitch can be generated from an electronic musical instrument or the like.

【0003】従来から、音声信号からピッチを抽出する
技術として種々の手法が提案されているが、その中でも
時間域の音声信号から直接ピッチを抽出する方式は、演
算量が少なく、リアルタイム処理が容易に実現可能であ
る。
Conventionally, various techniques have been proposed as techniques for extracting a pitch from an audio signal. Among them, a method for directly extracting a pitch from an audio signal in a time domain requires a small amount of calculation and facilitates real-time processing. It is feasible.

【0004】時間域のピッチ抽出方式の第1の従来例と
しては、例えば、入力波形の隣接するゼロクロス点(振
幅が0となる時間位置)の間の時間を、その波形のピッ
チ周期として求める方式がある。
[0004] As a first conventional example of a time domain pitch extraction method, for example, a time between adjacent zero cross points (time positions where the amplitude becomes 0) of an input waveform is obtained as a pitch period of the waveform. There is.

【0005】また、第2の従来例として、入力波形をロ
ーパスフルタに通して倍音成分を除去してから、ゼロク
ロス間隔を抽出するようにした方式もある。更に、第3
の従来例として、入力波形の自己相関値を演算して、そ
の値がピークとなる自己相関のずれ量からピッチ周期を
抽出する方式も提案されている。
As a second conventional example, there is a method in which an input waveform is passed through a low-pass filter to remove a harmonic component, and then a zero-cross interval is extracted. Furthermore, the third
As a conventional example, there has been proposed a method of calculating an autocorrelation value of an input waveform and extracting a pitch period from a shift amount of the autocorrelation at which the value becomes a peak.

【0006】[0006]

【発明が解決しようとする課題】しかし、人の声などは
倍音をかなり含み、入力波形の1ピッチ周期中にゼロク
ロス点が何回か出現するため、第1の従来例のように単
純にゼロクロス間隔を抽出する方式では、正しい周期が
求められずピッチ抽出誤りが大きいという問題点を有し
ている。
However, since a human voice or the like contains considerable overtones and a zero-cross point appears several times during one pitch period of the input waveform, the zero-cross point is simply obtained as in the first conventional example. The method of extracting an interval has a problem that a correct period cannot be obtained and a pitch extraction error is large.

【0007】また、第2の従来例では、ローパスフィル
タのカットオフ周波数を下げると、ピッチを抽出できる
音域が低い音域に限られてしまい、逆に、カットオフ周
波数を上げると倍音成分が残ってピッチ抽出誤りが増加
してしまうという、相反する問題点を有している。
In the second conventional example, when the cutoff frequency of the low-pass filter is lowered, the range in which the pitch can be extracted is limited to a low range. Conversely, when the cutoff frequency is raised, harmonic components remain. There is a contradictory problem that pitch extraction errors increase.

【0008】更に、第3の従来例は、時間域の処理であ
るにもかかわらず、非常に多くの演算量を必要とし、リ
アルタイムで入力波形のピッチを抽出する目的には適さ
ないという問題点を有している。
Furthermore, the third conventional example requires a very large amount of calculation despite the processing in the time domain, and is not suitable for the purpose of extracting the pitch of the input waveform in real time. have.

【0009】本発明の課題は、上述のような倍音成分に
よるゼロクロスの影響をなくし、一ピッチ周期に相当す
る入力波形のゼロクロス間隔の正しい計測を可能とする
ことにある。
SUMMARY OF THE INVENTION It is an object of the present invention to eliminate the above-mentioned effect of zero crossing due to harmonic components and to enable correct measurement of the zero crossing interval of an input waveform corresponding to one pitch period.

【0010】[0010]

【課題を解決するための手段】本発明は、まず、入力波
形が負又は正の第1の極性から他方の第2の極性へゼロ
クロスするゼロクロス点からつぎに前記第2の極性から
前記第1の極性へゼロクロスするゼロクロス点までの間
隔を第1の間隔として計測する第1の間隔計測手段を有
する。
According to the present invention, first, an input waveform starts from a zero crossing point where the input waveform crosses zero from a first polarity, negative or positive, to another second polarity, and then from the second polarity to the first polarity. And a first interval measuring means for measuring an interval to a zero-crossing point at which a zero-crossing is made to the polarity as a first interval.

【0011】つぎに、第1の間隔計測手段が第1の間隔
の計測を行っている間の入力波形の各振幅の絶対値の累
算値を第1の振幅累算値として計測する第1の振幅累算
値計測手段を有する。
Then, the first interval measuring means measures the accumulated value of the absolute value of each amplitude of the input waveform as the first amplitude accumulated value while the first interval measuring means measures the first interval. Has an amplitude accumulated value measuring means.

【0012】つぎに、第1の間隔計測手段による計測の
終了後、入力波形が第1の極性から第2の極性へゼロク
ロスするゼロクロス点からつぎに第2の極性から第1の
極性へゼロクロスするゼロクロス点までのそれぞれの区
間の間隔を第2の間隔として順次計測する第2の間隔計
測手段を有する。
Next, after the end of the measurement by the first interval measuring means, the input waveform zero-crosses from the second polarity to the first polarity from the zero-cross point where the input waveform crosses zero from the first polarity to the second polarity. There is provided a second interval measuring means for sequentially measuring an interval of each section up to the zero cross point as a second interval.

【0013】つぎに、第2の間隔計測手段が各第2の間
隔の計測を順次行っているそれぞれの区間において入力
波形の各振幅の絶対値の累算値を第2の振幅累算値とし
て順次計測する第2の振幅累算値計測手段を有する。
Next, the accumulated value of the absolute value of each amplitude of the input waveform is set as the second amplitude accumulated value in each section where the second interval measuring means sequentially measures each second interval. It has a second amplitude accumulated value measuring means for sequentially measuring.

【0014】さらに、第1の間隔計測手段による計測が
開始されたゼロクロス点からの間隔を逐次計測する第3
の間隔計測手段を有する。上述の第1、第2、第3の各
間隔計測手段は、例えばカウンタによって構成される。
Further, a third step is to sequentially measure an interval from the zero-cross point at which the measurement by the first interval measuring means is started.
Interval measuring means. Each of the first, second, and third interval measuring means described above is constituted by, for example, a counter.

【0015】また、第2の計測手段が各第2の間隔の計
測を開始した各時点において第3の間隔計測手段が計測
している間隔を周期情報として順次更新しながら記憶す
る間隔記憶手段を有する。
Further, at each time when the second measuring means starts measuring each second interval, an interval storing means for storing the intervals measured by the third interval measuring means while sequentially updating them as cycle information is provided. Have.

【0016】加えて、第1の間隔計測手段が計測した第
1の間隔と第2の間隔計測手段が順次計測した各第2の
間隔が所定の許容誤差範囲内で一致し、かつ第1の振幅
累算値計測手段が計測した第1の振幅累算値と第2の振
幅累算値計測手段が順次計測した各第2の振幅累算値が
所定の許容誤差範囲内で一致したか否かを順次判定する
判定手段を有する。
In addition, the first interval measured by the first interval measuring means and each second interval sequentially measured by the second interval measuring means coincide with each other within a predetermined allowable error range, and Whether the first accumulated amplitude value measured by the accumulated amplitude value measuring means and each second accumulated amplitude value sequentially measured by the second accumulated amplitude value measuring means coincide with each other within a predetermined allowable error range. It has a determination means for sequentially determining whether

【0017】そして、判定手段が一致を検出した時点で
時間記憶手段に記憶されている周期情報を入力波形のピ
ッチ情報として出力し、その後、第1の間隔計測手段に
よる計測処理から順に各処理を繰り返させることにより
入力波形からピッチ情報を順次抽出する繰り返し制御手
段を有する。
Then, when the determination means detects the coincidence, the period information stored in the time storage means is output as pitch information of the input waveform, and thereafter, each processing is sequentially performed from the measurement processing by the first interval measurement means. It has a repetition control means for successively extracting pitch information from the input waveform by repeating.

【0018】上述の発明の構成において、判定手段が一
致を検出しなかった時点において、第3の間隔計測手段
が計測している間隔が予め設定された最低音のピッチ周
期に対応する間隔を越えたか否かを判定し、越えたと判
定した場合に、第1の間隔計測手段による計測処理から
各処理をやり直させる制限手段を有するように構成でき
る。
In the configuration of the invention described above, when the determination means does not detect a match, the interval measured by the third interval measurement means exceeds the interval corresponding to the preset pitch cycle of the lowest tone. It is possible to have a limiting means for determining whether or not the processing has been performed and, when it is determined to have exceeded the limit, restarting each processing from the measurement processing by the first interval measuring means.

【0019】[0019]

【作用】音声信号は、ピッチ周期毎に1つ以上の波形の
山が繰り返す波形として構成され、各ピッチ周期内の各
波形の山は連続するピッチ周期間で相似形を呈する。そ
して、隣接するピッチ周期のほぼ相似の波形の山のそれ
ぞれの両端のゼロクロス点間の間隔及び山の面積は、互
いにほぼ等しいという特徴を有する。
The audio signal is formed as a waveform in which one or more peaks of the waveform repeat at each pitch period, and the peaks of each waveform in each pitch period exhibit a similar shape between successive pitch periods. The interval between the zero-cross points at both ends of the peaks having substantially similar waveforms in adjacent pitch periods and the peak area are substantially equal to each other.

【0020】本発明は、この点に着目して、まず、第1
の間隔計測手段が1つの波形の山の両端のゼロクロス点
の間隔を計測し、第1の振幅累算値計測手段がその山の
面積に対応する第1の振幅累算値を計測する。また、第
2の間隔計測手段がそれ以後順次現れる山の両端のゼロ
クロス点の間隔を順次計測し、第2の振幅累算値計測手
段が各山の面積に対応する第2の振幅累算値を計測す
る。
In the present invention, focusing on this point, first, the first
The interval measuring means measures the interval between zero cross points at both ends of one peak of one waveform, and the first amplitude accumulated value measuring means measures the first amplitude accumulated value corresponding to the area of the peak. Further, the second interval measuring means sequentially measures the intervals of the zero cross points at both ends of the peaks which appear sequentially thereafter, and the second amplitude accumulated value measuring means measures the second amplitude accumulated value corresponding to the area of each peak. Is measured.

【0021】そして、判定手段が、上述の第1の間隔と
それぞれの第2の間隔が所定の許容誤差範囲内で一致
し、かつ第1の振幅累算値とそれぞれの第2の振幅累算
値が所定の許容誤差範囲内で一致したか否かを順次判定
し、一致した時点における第1の間隔に対応する山から
当該第2の間隔に対応する山の先頭までの間隔をピッチ
情報として抽出する。このピッチ情報は、間隔記憶手段
に記憶された第3の計測手段の各計測間隔である周期情
報として得ることができる。
The determination means determines that the first interval and each second interval match within a predetermined allowable error range, and that the first amplitude accumulation value and each second amplitude accumulation It is sequentially determined whether or not the values match within a predetermined allowable error range, and the interval from the peak corresponding to the first interval to the head of the peak corresponding to the second interval at the time of matching is determined as pitch information. Extract. This pitch information can be obtained as period information which is each measurement interval of the third measurement means stored in the interval storage means.

【0022】このようにして、倍音成分による影響に関
わらず、入力波形のピッチを安定して抽出することがで
きる。
Thus, the pitch of the input waveform can be stably extracted regardless of the influence of the harmonic components.

【0023】[0023]

【実施例】以下、図面を参照しながら本発明の実施例に
つき説明する。 <実施例の構成>図1は、本発明の実施例の全体構成図
である。
Embodiments of the present invention will be described below with reference to the drawings. <Structure of Embodiment> FIG. 1 is an overall structural diagram of an embodiment of the present invention.

【0024】同図において、例えば特には図示しないマ
イクロフォンによって採取された1人の人が歌う歌声や
アナログ楽器の単音の演奏音などのアナログ信号は、直
流成分を除くためのキャパシタ1を介してA/D変換器
2に入力され、デジタル信号に変換される。
In FIG. 1, for example, an analog signal such as a singing voice singed by one person or a single sound of an analog musical instrument, which is picked up by a microphone (not shown), is passed through a capacitor 1 for removing a DC component. The signal is input to the / D converter 2 and converted into a digital signal.

【0025】CPU(中央演算制御装置)3は、RAM
(Random Access Memory)4をワークメモリとして、RO
M(Read Only Memory)9に記憶されたプログラムを実行
することにより、入力音声信号の音高(ピッチ)に関す
る情報を抽出する。
The CPU (Central Processing Control Unit) 3 has a RAM
(Random Access Memory) 4 as work memory, RO
By executing the program stored in the M (Read Only Memory) 9, information on the pitch of the input audio signal is extracted.

【0026】つぎに、音源5はCPU3の制御により、
上記音高に関する情報に基づくノートナンバーと、演奏
者が音色選択スイッチ(図示はしていない)などで選択
した音色(例えば、上記歌声とはまったく異なるトラン
ペットなどの管楽器の音色)を有する楽音信号を生成す
る。そのあと、生成された楽音信号はD/A変換器6で
アナログの楽音信号に変換され、増幅器7を介してスピ
ーカ8から楽音として放音される。
Next, the sound source 5 is controlled by the CPU 3
A note number based on the pitch information and a tone signal having a tone selected by a player with a tone selection switch (not shown) (for example, a tone of a wind instrument such as a trumpet completely different from the singing voice) are generated. Generate. After that, the generated tone signal is converted into an analog tone signal by the D / A converter 6 and is emitted as a tone from the speaker 8 via the amplifier 7.

【0027】なお、ROM9には、上述のプログラムの
他に、後述するように、ピッチ抽出時に用いられる種々
のデータや、得られた入力信号の周期とノートナンバー
との対応を示すテーブル等を有する。
The ROM 9 has, in addition to the above-mentioned programs, various data used for pitch extraction, a table indicating the correspondence between the cycle of the obtained input signal and the note number, as described later. .

【0028】上述の回路構成により、以下に説明する基
本動作原理に従って、入力される音声信号からピッチデ
ータ(以後、略称する場合は、単にピッチと呼ぶ)の抽
出が行われる。 <実施例の基本動作原理>通常、例えば人の歌声などの
ように、ピッチ感が明瞭でかつ単音で演奏される音声
は、図2に示すように、ピッチ周期(例えば)毎に繰
り返される、ほぼ相似の波形要素(例えば同図のaと
d、bとe、cとf)で構成されている。
With the above-described circuit configuration, pitch data (hereinafter simply referred to as pitch in the abbreviated form) is extracted from an input audio signal in accordance with the basic operation principle described below. <Basic operating principle of the embodiment> Normally, a voice having a clear pitch feeling and being played as a single sound, such as a human singing voice, is repeated at every pitch cycle (for example) as shown in FIG. It is composed of substantially similar waveform elements (for example, a and d, b and e, c and f in the same figure).

【0029】このような音声は、その音声に含まれる倍
音成分のために、その波形が振幅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.

【0030】すなわち、隣接するピッチ周期のほぼ同形
の波形(例えば上記aとd)のそれぞれのゼロクロス点
(例えばZ1〜Z2とZ7〜Z8)で定まる区間(例えばと
)の時間、および2つの波形(例えばa、d)のそれ
ぞれの面積(A/D変換された振幅値の累算値に相当)
はほぼ等しい。
That is, the time of a section (for example) defined by the respective zero-cross points (for example, Z1 to Z2 and Z7 to Z8) of substantially the same waveforms (for example, a and d) of adjacent pitch periods, and two waveforms Each area (for example, a, d) (corresponding to the accumulated value of the A / D converted amplitude values)
Are almost equal.

【0031】本発明は、この点に着目して、隣接するゼ
ロクロス点間の時間と波形面積のほぼ等しい2つの区間
(例えばと)を見出すことにより、その2つの区間
のそれぞれの開始点(例えばZ1とZ7)の間の時間間隔を
抽出して、ピッチ周期を抽出する。
By focusing on this point, the present invention finds two sections (for example,) having substantially the same time and waveform area as the time between adjacent zero-cross points, so that the start points (for example, Extract the time interval between Z1 and Z7) to extract the pitch period.

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

【0033】この場合に、ゼロクロス点Z1から、波形
b、c、dのそれぞれのゼロクロス点Z3、Z5、Z7までの
時間、、およびが第3のカウンタによってカウン
トされる。そのカウント値COUNT 3は、この入力音声信
号のピッチ周期となる可能性を有するので、ピッチ周期
となるカウント値が得られるまで、順次更新されながら
RAM4内の変数PITCOUNTER に保存される。また、上
記区間が見出されるまで、波形aの面積に相当するA
/D変換された振幅値の累算値が、RAM4内の変数SU
M 1 に、また波形b、c、dのそれぞれ面積に相当する
A/D変換された振幅値の累算値が、順次更新されなが
らRAM4内の変数SUM 2 に書き込まれてゆく。
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 cycle of the input voice signal, it is sequentially updated and stored in the variable PITCOUNTER in the RAM 4 until a count value that becomes the pitch cycle is obtained. Until the above section is found, A corresponding to the area of waveform a
The accumulated value of the / D-converted amplitude value is stored in the variable SU in the RAM 4.
The accumulated value of the A / D-converted amplitude values corresponding to the areas of the waveforms b, c, and d are written to the variable SUM 2 in the RAM 4 while being sequentially updated.

【0034】そして、区間の時間とほぼ等しい時間を
有する区間が見出され、また両区間、の波形a、
dの面積に相当する、SUM 1 とSUM 2 に書き込まれた振
幅値の累算値が、ほぼ等しいことが確認されると、両区
間、のそれぞれのゼロクロス点Z1、Z7の間の時間
に相当するカウンタ値が上記メモリ変数PIT COUNTERか
ら読み出され、ピッチ周期として確定される。そして、
そのピッチ周期に対応するノートナンバーがROM9内
のテーブルから求められる。 <本実施例の動作>つぎに、上述の動作原理に従い、入
力波形のピッチを求める動作を、図3〜図6の動作フロ
ーチャートを用いて説明する。これらの動作フローチャ
ートは、図1のCPU3が、ROM9内に記憶されてい
る制御プログラムを実行する動作として実現される。
Then, a section having a time substantially equal to the time of the section is found, and the waveforms a,
When it is confirmed that the accumulated values of the amplitude values written in SUM 1 and SUM 2 corresponding to the area of d are substantially equal, the time corresponding to the time between the respective zero-cross points Z1 and Z7 of both sections is obtained. The counter value to be read is read from the memory variable PIT COUNTER, and is determined as the pitch cycle. And
A note number corresponding to the pitch cycle is obtained from a table in the ROM 9. <Operation of the Present Embodiment> Next, the operation of obtaining the pitch of the input waveform in accordance with the above-described operation principle will be described with reference to the operation flowcharts of FIGS. These operation flowcharts are realized as operations in which the CPU 3 of FIG. 1 executes a control program stored in the ROM 9.

【0035】図3において、まず、RAM4のイニシャ
ル・セットが行われる。すなわち、音声信号を読み出す
時点がその信号波形のいかなる状態(status)に対応す
るかを示すステータス・フラグ(STATUS FLAG 、図2参
照)、入力音声信号の波形エンベロープの大きさを示す
変数ENV、ピッチ抽出の結果得られたピッチに対応する
ノートナンバーを保持する変数PIT 、現在発音中のノー
トナンバーを保持する変数ON NOW、第1、第2、第3の
3個のカウンタのそれぞれのカウント値を保持する変数
COUNT 1,COUNT 2,COUNT 3 、および1つ前のA/D変換
値を保持する変数ADMEM などの各内容がすべてクリアさ
れる(ステップS301)。なお、PIT やONNOW の値が0と
いうことは、それぞれピッチ抽出された音が無い、また
は現在発音中の音が無いことを示す。
In FIG. 3, first, an initial setting of the RAM 4 is performed. That is, a status flag (STATUS FLAG, see FIG. 2) indicating which state of the signal waveform corresponds to the time when the audio signal is read, a variable ENV indicating the size of the waveform envelope of the input audio signal, and a pitch. A variable PIT that holds the note number corresponding to the pitch obtained as a result of the extraction, a variable ON NOW that holds the currently sounding note number, and a count value of each of the first, second, and third counters. Variable to keep
All contents such as COUNT 1, COUNT 2, COUNT 3 and a variable ADMEM holding the previous A / D conversion value are cleared (step S301). When the values of PIT and ONNOW are 0, it indicates that there is no pitch-extracted sound or no currently sounding sound.

【0036】つづいて、入力音声信号の1サンプリング
分のA/D変換の終了を待って(S302)、つぎのステップ
S303に進み、CPU3内のレジスタreg1にA/D変換し
たデータがセットされる。
Then, after completion of A / D conversion for one sampling of the input audio signal (S302), the next step
Proceeding to S303, the A / D converted data is set in the register reg1 in the CPU 3.

【0037】そのあと、ステータス・フラグによって処
理が3つに分岐される(ステップS304)。最初は、図2
のステータス・フラグ=0の状態であるので、ステップ
S305に進む。ステータス・フラグ=0の状態では、入力
波形の負側から正側へのゼロクロスの点Z1を検出するた
めに、1つ前のA/D変換値ADMEM が負で、かつ現在の
A/D変換値が格納されているreg1が、正であるか否か
が判定される。
Thereafter, the process branches into three depending on the status flag (step S304). First, Figure 2
Since the status flag of is 0, the step
Proceed to S305. When the status flag is 0, in order to detect the zero-crossing point Z1 from the negative side to the positive side of the input waveform, the previous A / D conversion value ADMEM is negative and the current A / D conversion is performed. It is determined whether or not reg1 in which the value is stored is positive.

【0038】今の場合、ステップS305の判定はNOであ
り、ステップS307に進む。そして、今回A/D変換値が
セットされたreg1の値が変数ADMEM に移され(ステップ
S307)、エンベロープ抽出(ステップS308)、楽音のノ
ートオン/ノートオフ処理(発音/消音処理、ステップ
S309)と進み、再びA/D変換終了待ちとなる(ステッ
プS302)。
In this case, the determination in step S305 is NO, and the process proceeds to step S307. Then, the value of reg1 in which the A / D conversion value is set this time is moved to the variable ADMEM (step
S307), envelope extraction (step S308), note-on / note-off processing of sound (sound generation / mute processing, step
The process proceeds to S309) and waits for the end of A / D conversion again (step S302).

【0039】上記エンベロープ抽出(ステップS308)と
楽音のノートオン/ノートオフ(ステップS309)に関す
る処理は、図5、図6のそれぞれの動作フローチャート
に示されている。
The processes relating to the above-described envelope extraction (step S308) and musical note note-on / note-off (step S309) are shown in the respective operation flowcharts of FIGS.

【0040】図5において、まず、現在のA/D変換値
(reg1の内容)の絶対値が演算され(ステップS501)、
そのあとローパスフィルタを通されて(デジタルフィル
タリング演算の実行による)、入力波形が整形される
(ステップS502)。そしてその結果得られた値が変数EN
V に格納される(ステップS503)。
In FIG. 5, first, the absolute value of the current A / D conversion value (the contents of reg1) is calculated (step S501).
Then, the input waveform is shaped by passing through a low-pass filter (by executing a digital filtering operation) (step S502). And the resulting value is the variable EN
V (step S503).

【0041】図6のノートオン/ノートオフ処理では、
まず変数ENV の大きさが所定の閾値(THRESHOLD)を超
え、かつノートナンバーを保持する変数PIT の値が0よ
り大きいか否かが判定される(ステップS604)。
In the note-on / note-off process of FIG.
First, it is determined whether or not the value of the variable ENV exceeds a predetermined threshold (THRESHOLD) and the value of the variable PIT holding the note number is larger than 0 (step S604).

【0042】その判定がNOならば、第1図の音源5の
すべて発音中の音の消音が指示され、かつ発音中の音が
無いことを示すために、変数ON NOWがクリアされて(ス
テップS609)、メインルーチン(図3)に戻る。
If the determination is NO, the variable ON NOW is cleared in order to mute all sounds being sounded by the sound source 5 in FIG. 1 and to indicate that there is no sound being sounded (step S1). S609), and returns to the main routine (FIG. 3).

【0043】また、ステップS604の判定がYESなら
ば、ステップS605で現在発音中の音がないか否かが判定
され、その判定がYESならば、ステップS608に進む。
ステップS605の判定がNOならば、発音中のノートナン
バーを示す変数ON NOWと抽出されたノートナンバーを示
す変数PIT の各値が比較される(ステップS606)。比較
の結果、両者が一致すれば、再発音する必要がないので
メインルーチン(図3)に戻り、一致しなければ、発音
すべきノートナンバーが変化したことになり、現在発音
中の音の消音を音源5に指示し(ステップS607)、その
あとステップS608に進む。
If the determination in step S604 is YES, it is determined in step S605 whether there is any currently sounding sound. If the determination is YES, the flow advances to step S608.
If the determination in step S605 is NO, the variable ON NOW indicating the note number being sounded is compared with the value of the variable PIT indicating the extracted note number (step S606). As a result of the comparison, if the two match, there is no need to re-produce the sound, so the process returns to the main routine (FIG. 3). To the sound source 5 (step S607), and thereafter, the process proceeds to step S608.

【0044】ステップS608において、ノートナンバーを
示す変数PIT に応じた発音指示が行われるとともに、変
数ON NOWに変数PIT の値が代入されて、現在、変数PIT
に対応するピッチを有する楽音を発音中であることが示
される(ステップS608)。そのあとメインルーチン(図
3)に戻る。
In step S608, a sounding instruction is performed in accordance with the variable PIT indicating the note number, and the value of the variable PIT is substituted for the variable ON NOW.
It is shown that a tone having a pitch corresponding to is being produced (step S608). Then, the process returns to the main routine (FIG. 3).

【0045】以上の処理は、負側から正側へのゼロクロ
ス点(図2のZ1)に到達するまで繰り返され、やがて、
図3のステップS305の判定がYESとなり、ステータス
・フラグSTATUS FLAG が1にされる(ステップS306)。
ここで図2に示す区間の時間のカウント値COUNT 1 、
および時間、または、のカウント値COUNT 3 に初
期値の1がセットされ、さらにCOUNT 1 のカウントアッ
プ中の入力波形の振幅値のA/D変換値の累算を得るた
め、変数SUM 1 に現在のA/D変換値であるレジスタre
g 1 の値が書き込まれる。
The above processing is repeated until the zero cross point (Z1 in FIG. 2) from the negative side to the positive side is reached.
The determination in step S305 of FIG. 3 is YES, and the status flag STATUS FLAG is set to 1 (step S306).
Here, the count value COUNT 1 of the time of the section shown in FIG.
The initial value 1 is set to the count value COUNT 3 and the time or time, and the variable SUM 1 is set to the current value to obtain the accumulation of the A / D conversion value of the amplitude value of the input waveform being counted up in COUNT 1. Register re, which is the A / D conversion value of
The value of g 1 is written.

【0046】このあと前述と同様な動作が行われて、ふ
たたびステップS304に戻る。ここで、STATUS FLAG =1
の状態となったため、ステップS310に移る。この状態で
は、図2の区分に例示される時間をカウントするため
に、第1のカウンタとしての変数COUNT 1 (以下、第1
のカウンタCOUNT 1 と呼ぶ)のインクリメントが、ま
た、区分に例示される時間をカウントするために第3
のカウンタとしての変数COUNT 3 (以下、第3のカウン
タCOUNT 3 と呼ぶ)のインクリメントがそれぞれ開始さ
れる。
Thereafter, the same operation as described above is performed, and the process returns to step S304. Where STATUS FLAG = 1
Then, the process moves to step S310. In this state, in order to count the time exemplified in the section of FIG.
Incrementing the counter COUNT 1), also the third to count the time instantiated in the segment.
Of the variable COUNT 3 (hereinafter, referred to as a third counter COUNT 3) as the counter of the second counter is started.

【0047】まず、ステップS310において、入力波形の
正側から負側へのゼロクロス点、すなわち図2の区間
の終了点であるゼロクロス点Z2を検出するために、1つ
前のA/D変換値が書き込まれた変数ADMEM の値が正
で、かつ現在のA/D変換値が書き込まれたレジスタre
g 1 の値が負であるか否かが判定される。
First, in step S310, in order to detect a zero cross point from the positive side to the negative side of the input waveform, that is, a zero cross point Z2 which is the end point of the section in FIG. Is the value of the variable ADMEM where the value is written and the register A where the current A / D conversion value is written
It is determined whether the value of g 1 is negative.

【0048】その判定がNOであれば、第1のカウンタ
COUNT 1 の値が1増加させられ、また、変数SUM 1 に新
たな入力波形のA/D変換値が格納されているレジスタ
reg1の値が累算される(ステップS311)。さらに、第3
のカウンタCOUNT 3 の値が1増加させられる(ステップ
S313)。
If the determination is NO, the first counter
A register in which the value of COUNT 1 is increased by 1 and the A / D conversion value of the new input waveform is stored in the variable SUM 1
The value of reg1 is accumulated (step S311). In addition, the third
Counter COUNT 3 is incremented by 1 (step
S313).

【0049】以後、ステップS310→S311→S313→S307→
S308→S309→S302〜S304→S310・・・のループ処理が繰
り返され、その繰り返し処理毎に第1のカウンタCOUNT
1 および第3のカウンタCOUNT 3 の値が1づつ増加され
る。
Thereafter, steps S310 → S311 → S313 → S307 →
The loop processing of S308 → S309 → S302 to S304 → S310... Is repeated, and the first counter COUNT
The value of the first and third counter COUNT 3 is incremented by one.

【0050】そして、ステップS310の判定がYESにな
り、正側から負側へのゼロクロス点Z2に到達すると、ス
テータス・フラグが2にされる(ステップS312)。その
後、ステップS313に進み、COUNT 3 の値が1増加された
あと、ステップS307→S308→S309と進み、ステップS302
に戻る。
When the determination in step S310 is YES and the zero-cross point Z2 from the positive side to the negative side is reached, the status flag is set to 2 (step S312). Then, the process proceeds to step S313, and after the value of COUNT 3 is increased by 1, the process proceeds to step S307 → S308 → S309, and step S302.
Return to

【0051】以上のようなループ処理が行われて、図2
の区間の時間に相当するカウンタ値が第1のカウンタ
COUNT 1 に保持され、また、波形aの面積に相当するA
/D変換値の累算値が変数SUM 1 に保持される。
After the above-described loop processing is performed, FIG.
The counter value corresponding to the time of the section is the first counter
A, which is held in COUNT 1 and corresponds to the area of waveform a
The accumulated value of the / D conversion value is stored in the variable SUM 1.

【0052】つぎに、ステップS312でステータス・フラ
グは2にされているので、今回はステップS302〜S304か
ら、図4のステップS401→S402と進む。ステップS402で
は、負側から正側へのゼロクロス点(図4のZ3)を検出
するために、図3のステップS305と同じ処理、すなわ
ち、変数ADMEM の値(1つ前のA/D変換値)が負で、
かつレジスタreg1の値(現在のA/D変換値)が正であ
るか否かが判定される。
Next, since the status flag is set to 2 in step S312, the process proceeds from step S302 to S304 this time to step S401 → S402 in FIG. In step S402, in order to detect a zero crossing point (Z3 in FIG. 4) from the negative side to the positive side, the same processing as in step S305 in FIG. 3, that is, the value of the variable ADMEM (the previous A / D conversion value ) Is negative,
It is determined whether the value of the register reg1 (current A / D conversion value) is positive.

【0053】その判定がNOである間は、S402→S313
(図3)→S307〜S309→S302〜S304→S401(図4)→S4
02・・・のループ処理が繰り返され、各繰り返し毎に第
3のカウンタCOUNT 3 のカウント値が1づつ増加させら
れる(S313)。
While the determination is NO, S402 → S313
(Fig. 3) → S307 to S309 → S302 to S304 → S401 (Fig. 4) → S4
The loop processing of 02... Is repeated, and the count value of the third counter COUNT 3 is incremented by one at each repetition (S313).

【0054】そして、ステップS402の判定がYESにな
り、負側から正側へのゼロクロス点Z3に到達すると、ス
テータス・フラグが3にされ、このときのCOUNT 3 の値
(図2の時間に相当)が変数PITCOUNTER に保存され
る(ステップS403)。このPITCOUNTERの値は、抽出すべ
きピッチに対応する周期の候補、すなわち、図2の区間
のカウント値になる可能性を有するものとして、保持
される。また、第2のカウンタCOUNT2の値が1に設定さ
れる。
When the determination in step S402 is YES and the zero-cross point Z3 from the negative side to the positive side is reached, the status flag is set to 3 and the value of COUNT 3 at this time (corresponding to the time in FIG. 2). ) Is stored in the variable PITCOUNTER (step S403). The value of this PITCOUNTER 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. Further, the value of the second counter COUNT2 is set to 1.

【0055】その後、ステップS403→S313(図3)〜S3
09→S302〜S304→S401(図4)と進む。今回はSTATUS F
LAG =3 の状態となったため、ステップS401からステッ
プS404に進む。ここでは、入力波形の正側から負側への
ゼロクロス点、すなわち図2の区間の終了点に相当す
るゼロクロス点Z4を検出するために、変数ADEMの値(1
つ前のA/D 変換値)が正で、かつレジスタreg1の値(現
在のA/D 変換値)が負であるか否かが判定される(ステ
ップS404)。
Thereafter, steps S403 → S313 (FIG. 3) to S3
The process proceeds from 09 → S302 to S304 → S401 (FIG. 4). This time STATUS F
Since LAG = 3, the process proceeds from step S401 to step S404. Here, in order to detect a zero cross point from the positive side to the negative side of the input waveform, that is, a zero cross point Z4 corresponding to the end point of the section in FIG. 2, the value of the variable ADEM (1
It is determined whether the previous A / D conversion value is positive and the value of the register reg1 (current A / D conversion value) is negative (step S404).

【0056】この判定がNOの間は、ステップS404→S4
05→S313(図3)〜S309→S302〜S304→S401(図4)→
S404のループ処理が繰り返され、各繰り返しにおいてス
テップS405の処理が行われる毎に、第2のカウンタCOUN
T 2に値1が加えられるとともに、変数SUM 2 に、レジ
スタreg 1 に格納されているA/D変換値が累算され
る。これにより今回は、図2の入力波形の区間の時間
と波形bの面積(A/D変換値の累算値)が求められる
ことになる。また、上述の各繰り返し毎に第3のカウン
タCOUNT 3 の値も1づつ増加される(S313)。
While this determination is NO, step S404 → S4
05-> S313 (Fig. 3)-S309->S302-S304-> S401 (Fig. 4)->
The loop processing of S404 is repeated, and each time the processing of step S405 is performed in each repetition, the second counter COUN
The value 1 is added to T2, and the A / D conversion value stored in the register reg1 is accumulated in the variable SUM2. Thus, this time, the time of the section of the input waveform in FIG. 2 and the area of the waveform b (accumulated value of the A / D conversion value) are obtained. In addition, the value of the third counter COUNT 3 is also incremented by one for each repetition described above (S313).

【0057】ステップS404の判定がYESになると、ゼ
ロクロス点Z4が検出されたことになり、ここでステータ
ス・フラグが4に変えられる(ステップS406)。その
後、図3のステップS313に進み、COUNT 3 が値1増加さ
れたあと、ステップS307→S308→S309〜S401(図4)と
進む。
If the determination in step S404 is YES, it means that the zero crossing point Z4 has been detected, and the status flag is changed to 4 here (step S406). Thereafter, the process proceeds to step S313 in FIG. 3, and after COUNT 3 is increased by 1, the process proceeds to steps S307 → S308 → S309 to S401 (FIG. 4).

【0058】今回はSTATUS FLAG =4 の状態となったた
め、ステップS401からステップS407に進む。この状態で
は、図2の区分に対して区分、、が順次比較さ
れ、区分とほぼ等しい時間を有する区分が見出され
たとき、さらに、区間、のそれぞれに対応する波形
aとdの面積に相当する各入力波形のA/D変換値の累
算値であるSUM 1とSUM 2 の値が比較され、これらがほ
ぼ等しくなることを判別することによって、図2の区分
の時間を入力波形のピッチ周期と定める処理動作が行
われる。
This time, since STATUS FLAG = 4, the process proceeds from step S401 to step S407. In this state, the sections and are sequentially compared with the section in FIG. 2, and when a section having a time substantially equal to the section is found, the areas of the waveforms a and d corresponding to each of the sections are further added. The values of SUM1 and SUM2, which are the accumulated values of the A / D converted values of the corresponding input waveforms, are compared, and by judging that they are substantially equal, the time of the division of FIG. A processing operation determined as a pitch cycle is performed.

【0059】まず、いままでに得られた第1のカウンタ
COUNT 1 と第2のカウンタCOUNT 2のそれぞれの値がほ
ぼ等しいか否か、すなわち、COUNT 1 とCOUNT 2 のそれ
ぞれの値の差の絶対値が、許容誤差範囲内にあるか否か
が判定される(ステップS407)。この許容誤差範囲は、
入力信号のサンプリング周波数とピッチ周波数に依存す
るが、経験的に決定される。
First, the first counter obtained so far
It is determined whether or not the respective values of COUNT 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 S407). This tolerance range is
It depends on the sampling frequency and pitch frequency of the input signal, but is determined empirically.

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

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

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

【0063】ステップS408の判定がYESの場合、すな
わち異常状態の場合は、図3のステップS314に進み、図
2の音源5に対して、すべての発音中の音を消音する指
示がなされるとともに、変数ON NOWがクリアされる。そ
のあと、ステップS301に戻って、ふたたび上述のピッチ
抽出の処理動作が実行し直される。
If the determination in step S408 is YES, that is, if the state is abnormal, the flow advances to step S314 in FIG. 3 to instruct the sound source 5 in FIG. 2 to mute all sounds being generated. , The variable ON NOW is cleared. Thereafter, the process returns to step S301, and the above-described pitch extraction processing operation is performed again.

【0064】ステップS408の判定がNOの場合は、ステ
ップS409に進んで、第2のカウンタCOUNT 2 の値がクリ
アされ、ステータス・フラグは2に戻される。そして、
ふたたび、つぎのゼロクロスを求めるための処理に入
る。このとき変数PIT COUNTERに保持された値は無効と
なるが、第3のカウンタCOUNT 3 は依然カウントアップ
をつづけており、また、第1のカウンタCOUNT 1 も図2
の区間のカウント値を保持している。
If the determination in step S408 is NO, the process proceeds to step S409, 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 crossing is started again. 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 is also shown in FIG.
The count value of the section is held.

【0065】上述のようにしてステータス・フラグの2
の状態に戻された後は、前回と同様にステータス・フラ
グの3の状態、4の状態と進み、第2のカウンタCOUNT
2 には図2の区間のカウント値、変数PIT COUNTER に
は同図の区間の始まりから区間のゼロクロス点Z5ま
でのカウント値(図2の)が保持される。また、変数
SUM 2 に書き込まれたA/D変換値の累算値はクリアさ
れ、あらたに波形cの各A/D変換値 reg 1がSUM 2 に
順次累算される。
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. 2, and the variable PIT COUNTER holds the count value (of FIG. 2) from the start of the section to the zero crossing point Z5 of the section. Also, the variable
The accumulated value of the A / D converted value written in SUM 2 is cleared, and each A / D converted value reg 1 of waveform c is sequentially accumulated in SUM 2.

【0066】しかし、今回もCOUNT 1 の値(区分の時
間に対応)とCOUNT 2 の値(区分の時間に対応)が一
致しないため、ステップS407の判定がNOとなる。その
ためステップS408を介してステップS409に進み、ふたた
びステータス・フラグが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, so the determination in step S407 is NO. Therefore, the process proceeds to step S409 via step S408, and the status flag is re-executed from the state of 2.

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

【0068】ステップS410では、さらに、変数SUM 1 に
保持されている波形aの面積に相当するA/D変換値の
累算値と、変数SUM 2に保持されている波形dの面積に
相当するA/D変換値の累算値がほぼ一致するか否かが
判定される。
In step S410, the accumulated value of the A / D conversion value corresponding to the area of the waveform a held in the variable SUM 1 and the area of the waveform d held in the variable SUM 2 are further obtained. It is determined whether or not the accumulated values of the A / D conversion values substantially match.

【0069】この判定がNOとされたときには、正しい
ピッチ周期に対応する波形ではないと判定されて、ステ
ップS408に進み、STATUS FLAG =2 の状態から処理が実
行し直されて新たな波形が検索される。
If this determination is NO, it is determined that the waveform does not correspond to the correct pitch period, and the flow advances to step S408 to execute the process again from the state of STATUS FLAG = 2 and search for a new waveform. Is done.

【0070】一方、ステップS410の判定がYESとされ
た場合には、正しいピッチ周期に対応する波形が求まっ
たと判定されて、ステップS411に進む。このときの入力
波形のピッチ周期の正しい値は、PIT COUNTER に保持さ
れている第3のカウンタCOUNT 3 の値(図2の)とな
る。そして、この値に対応するノートナンバーが図1の
ROM9内のテーブルから読み出され、変数PIT に移さ
れる(ステップS410)。
On the other hand, if the determination in step S410 is YES, it is determined that a waveform corresponding to a correct pitch period has been obtained, and the flow advances to step S411. The correct value of the pitch cycle of the input waveform at this time is the value of the third counter COUNT 3 (FIG. 2) held in PIT COUNTER. Then, the note number corresponding to this value is read from the table in the ROM 9 of FIG. 1, and is moved to the variable PIT (step S410).

【0071】つぎに、ステータス・フラグと、すべての
カウンタと、変数SUM 1 及びSUM 2の各内容がクリアさ
れ、初期状態にリセットされる(ステップS412)。その
あと、図3のステップS307〜S309のノートオン/オフ処
理に進み、この処理において、上述の入力音声信号のピ
ッチ(音高)に対応するノートナンバーを有する楽音の
新たな発音指示がなされる。
Next, the status flag, all the counters, and the contents of the variables SUM 1 and SUM 2 are cleared and reset to the initial state (step S412). Thereafter, the process proceeds to the note on / off processing of steps S307 to S309 in FIG. 3, in which a new tone generation instruction of a musical tone having a note number corresponding to the pitch (pitch) of the input audio signal is performed. .

【0072】すなわち、ステップS309に対応する図6の
フローで、ステップS604の判定がYESとなった後、ス
テップS605で現在発音中の音がない(YES)と判定さ
れたら、前述したように、ステップS608で、ノートナン
バーを示す変数PIT に応じた発音指示が行われる。ま
た、ステップS605で現在発音中の音がある(NO)と判
定されたら、前述したように、ステップS606で、発音中
のノートナンバーを示す変数ON NOWと抽出されたノート
ナンバーを示す変数PIT の各値が比較される。その比較
の結果、両者が一致すれば、再発音する必要がないので
メインルーチン(図3)に戻り、一致しなければ、発音
すべきノートナンバーが変化したことになり、現在発音
中の音の消音が音源5に指示され(ステップS607)、そ
のあとステップS608で、新たなノートナンバーが格納さ
れた変数PIT に応じた新たな発音指示が行われる。
That is, in the flow of FIG. 6 corresponding to step S309, after the determination in step S604 is YES, if it is determined in step S605 that there is no currently sounding sound (YES), as described above, In step S608, a sound generation instruction is performed according to the variable PIT indicating the note number. If it is determined in step S605 that there is a currently sounding sound (NO), as described above, in step S606, the variable ON NOW indicating the sounding note number and the variable PIT indicating the extracted note number are used. Each value is compared. As a result of the comparison, if the two match, there is no need to re-sound, so the process returns to the main routine (FIG. 3). If the two do not match, the note number to be sounded has changed. The mute is instructed to the sound source 5 (step S607), and then in step S608, a new sounding instruction is performed according to the variable PIT in which the new note number is stored.

【0073】以上の発音指示の後、図3のステップS307
〜S302〜S304へ進み、STATUS FLAG=0 の状態から、い
ままでと同様な動作が繰り返される。以上説明した実施
例では、波形の振幅値0の基準レベルに対して、正側の
波形部分(例えば、図2の波形a、b、c、d・・・)
について、それぞれの区分の時間とA/D変換値の累算
値を比較してピッチを抽出したが、本発明はこれに限ら
れることなく、負側の波形部分を用いてもまったく同様
ピッチ抽出動作を行うことができる。
After the above sound generation instruction, step S307 in FIG.
The process proceeds to S302 to S304, and the same operation as before is repeated from the state of STATUS FLAG = 0. In the embodiment described above, the waveform portion on the positive side (for example, waveforms a, b, c, d... In FIG. 2) with respect to the reference level of the amplitude value 0 of the waveform.
The pitch was extracted by comparing the time of each section with the accumulated value of the A / D conversion value. However, the present invention is not limited to this. Actions can be taken.

【0074】さらに、基準レベルに対して正側と負側の
それぞれの波形について、並行して上述のピッチ抽出動
作を行い、それぞれの第3のカウンタCOUNT 3 の値が所
定の誤差を許容して一致した場合に、例えば2つのCOUN
T 3 の値の平均値を入力波形のピッチ周期として求めれ
ば、より精度の高いピッチ抽出が可能である。
Further, the above-described pitch extraction operation is performed in parallel with respect to each of the waveforms on the positive side and the negative side with respect to the reference level, and the value of each third counter COUNT 3 allows a predetermined error. If they match, for example, two COUNs
If the average value of the values of T 3 is obtained as the pitch cycle of the input waveform, more accurate pitch extraction is possible.

【0075】また、図6のノートオン/オフの処理で
は、発音中の楽音のピッチが変化した場合には、一度、
消音してから発音し直すような処理を行っているが、こ
の場合に、例えばエンベロープがそれほど変化してなけ
れば消音はせずに音高のみを変化させるように、図2の
音源5に対して指示を行うことも可能である。
In the note on / off processing of FIG. 6, if the pitch of the musical tone being produced changes,
In this case, the sound is re-produced after the sound is muted. In this case, for example, if the envelope does not change so much, the sound source 5 of FIG. It is also possible to give instructions.

【0076】[0076]

【発明の効果】本発明によれば、ゼロクロス点間の間隔
がほぼ等しく波形の山が相似であると判別される時点を
抽出することによって、倍音成分による影響に関わら
ず、入力波形のピッチを安定して抽出することが可能と
なる。この場合、特に、ゼロクロス点間の間隔だけでな
く、波形の山の面積に相当する振幅累算値も判定要素と
することで、より正確なピッチ抽出が可能となる。
According to the present invention, by extracting the time points at which the intervals between the zero-cross points are substantially equal and the peaks of the waveform are determined to be similar, the pitch of the input waveform can be reduced irrespective of the influence of harmonic components. It is possible to extract stably. In this case, in particular, not only the interval between the zero-cross points but also the accumulated amplitude value corresponding to the area of the peak of the waveform is used as the determination element, thereby enabling more accurate pitch extraction.

【0077】これにより、例えば倍音を含む歌声や楽音
などの音声波形から、その音高を示すピッチを確実に抽
出することが可能となる。
As a result, it is possible to reliably extract the pitch indicating the pitch from a voice waveform such as a singing voice or a musical tone including harmonics.

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

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

【図2】入力音声信号の波形図である。FIG. 2 is a waveform diagram of an input audio signal.

【図3】本実施例の動作フローチャート(その1)であ
る。
FIG. 3 is an operation flowchart (part 1) of the embodiment.

【図4】本実施例の動作フローチャート(その2)であ
る。
FIG. 4 is an operation flowchart (part 2) of the present embodiment.

【図5】本実施例のエンベロープ検出に関する動作フロ
ーチャートである。
FIG. 5 is an operation flowchart relating to envelope detection according to the present embodiment.

【図6】本実施例のノートオン/オフに関する動作フロ
ーチャートである。
FIG. 6 is an operation flowchart relating to note on / off according to the present embodiment.

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

1 キャパシタ 2 A/D変換器 3 CPU 4 RAM 5 音源 6 D/A変換器 7 増幅器 8 スピーカ 9 ROM Reference Signs List 1 capacitor 2 A / D converter 3 CPU 4 RAM 5 sound source 6 D / A converter 7 amplifier 8 speaker 9 ROM

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G10L 11/00 - 21/06 JICSTファイル(JOIS)──────────────────────────────────────────────────続 き Continued on the front page (58) Fields surveyed (Int. Cl. 7 , DB name) G10L 11/00-21/06 JICST file (JOIS)

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】入力波形が負又は正の第1の極性から他方
の第2の極性へゼロクロスするゼロクロス点からつぎに
前記第2の極性から前記第1の極性へゼロクロスするゼ
ロクロス点までの間隔を第1の間隔として計測する第1
の間隔計測手段と、該第1の間隔計測手段が前記第1の
間隔の計測を行っている間の前記入力波形の各振幅の絶
対値の累算値を第1の振幅累算値として計測する第1の
振幅累算値計測手段と、前記第1の間隔計測手段による
計測の終了後、前記入力波形が前記第1の極性から前記
第2の極性へゼロクロスするゼロクロス点からつぎに前
記第2の極性から前記第1の極性へゼロクロスするゼロ
クロス点までのそれぞれの区間の間隔を第2の間隔とし
て順次計測する第2の間隔計測手段と、該第2の間隔計
測手段が前記各第2の間隔の計測を順次行っているそれ
ぞれの区間において前記入力波形の各振幅の絶対値の累
算値を第2の振幅累算値として順次計測する第2の振幅
累算値計測手段と、前記第1の間隔計測手段による計測
が開始されたゼロクロス点からの間隔を逐次計測する第
3の間隔計測手段と、前記第2の計測手段が前記各第2
の間隔の計測を開始した各時点において前記第3の間隔
計測手段が計測している間隔を周期情報として順次更新
しながら記憶する間隔記憶手段と、前記第1の間隔計測
手段が計測した前記第1の間隔と前記第2の間隔計測手
段が順次計測した前記各第2の間隔が所定の許容誤差範
囲内で一致し、かつ前記第1の振幅累算値計測手段が計
測した前記第1の振幅累算値と前記第2の振幅累算値計
測手段が順次計測した前記各第2の振幅累算値が所定の
許容誤差範囲内で一致したか否かを順次判定する判定手
段と、該判定手段が前記一致を検出した時点で前記時間
記憶手段に記憶されている前記周期情報を前記入力波形
のピッチ情報として出力し、その後、前記第1の間隔計
測手段による計測処理から順に前記各処理を繰り返させ
ることにより前記入力波形からピッチ情報を順次抽出す
る繰り返し制御手段と、を有することを特徴とするピッ
チ抽出装置。
An interval from a zero-cross point at which the input waveform zero-crosses from a negative or positive first polarity to another second polarity to a zero-cross point at which the input waveform zero-crosses from the second polarity to the first polarity. To measure the first interval as the first interval
Measuring the accumulated value of the absolute value of each amplitude of the input waveform as the first amplitude accumulated value while the first interval measuring means measures the first interval. After completion of the measurement by the first amplitude accumulated value measuring means and the first interval measuring means, the zero-crossing point at which the input waveform zero-crosses from the first polarity to the second polarity is used. A second interval measuring means for sequentially measuring an interval of each section from the second polarity to the zero-cross point at which the first polarity crosses to the first polarity as a second interval, and the second interval measuring means comprising: A second amplitude accumulated value measuring means for sequentially measuring the accumulated value of the absolute value of each amplitude of the input waveform as a second amplitude accumulated value in each section in which the measurement of the interval is sequentially performed; Zero at which measurement by the first interval measuring means is started A third interval measuring means for sequentially measuring the distance from Ross point, the said second measuring means each second
At each time point when the measurement of the interval is started, an interval storage unit that stores the interval measured by the third interval measuring unit while sequentially updating the interval information as cycle information, and the second unit that is measured by the first interval measuring unit. The first interval and the second intervals sequentially measured by the second interval measuring means coincide with each other within a predetermined allowable error range, and the first amplitude measured by the first amplitude accumulated value measuring means. Determining means for sequentially determining whether or not the accumulated amplitude value and each of the second accumulated amplitude values sequentially measured by the second accumulated amplitude value measuring means coincide with each other within a predetermined allowable error range; When the determination unit detects the coincidence, the period information stored in the time storage unit is output as pitch information of the input waveform. By repeating the above Pitch extraction apparatus characterized by comprising: a repetition control means for sequentially extracting pitch information from the force waveform, a.
【請求項2】前記判定手段が前記一致を検出しなかった
時点において、前記第3の間隔計測手段が計測している
間隔が予め設定された最低音のピッチ周期に対応する間
隔を越えたか否かを判定し、越えたと判定した場合に、
前記第1の間隔計測手段による計測処理から前記各処理
をやり直させる制限手段を、更に有することを特徴とす
る請求項1に記載のピッチ抽出装置。
2. The method according to claim 1, wherein the time interval measured by the third interval measuring means exceeds an interval corresponding to a preset pitch cycle of the lowest note at the time when the determining means does not detect the coincidence. And if it is determined that it has exceeded,
2. The pitch extracting device according to claim 1, further comprising a limiter that restarts each of the processes from the measurement process by the first interval measuring device.
JP10098691A 1991-05-02 1991-05-02 Pitch extraction device Expired - Fee Related JP3092198B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP10098691A JP3092198B2 (en) 1991-05-02 1991-05-02 Pitch extraction device
US08/154,157 US5349130A (en) 1991-05-02 1993-11-17 Pitch extracting apparatus having means for measuring interval between zero-crossing points of a waveform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10098691A JP3092198B2 (en) 1991-05-02 1991-05-02 Pitch extraction device

Publications (2)

Publication Number Publication Date
JPH04330500A JPH04330500A (en) 1992-11-18
JP3092198B2 true JP3092198B2 (en) 2000-09-25

Family

ID=14288647

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10098691A Expired - Fee Related JP3092198B2 (en) 1991-05-02 1991-05-02 Pitch extraction device

Country Status (1)

Country Link
JP (1) JP3092198B2 (en)

Also Published As

Publication number Publication date
JPH04330500A (en) 1992-11-18

Similar Documents

Publication Publication Date Title
US5780759A (en) Method for pitch recognition, in particular for musical instruments which are excited by plucking or striking
JP4672474B2 (en) Automatic musical transcription device and program
Puckette Score following using the sung voice
JP2006227452A (en) Tuning device and method of controlling the same
JP3092197B2 (en) Pitch extraction device
JP3092198B2 (en) Pitch extraction device
JPH0519792A (en) Pitch extraction device
Alcabasa et al. Automatic guitar music transcription
EP0264955B1 (en) Apparatus for determining the pitch of a substantially periodic input signal
JP4360527B2 (en) Pitch detection method
KR100406655B1 (en) Pitch Detection Device
Filip Envelope periodicity detection
Maula et al. Spectrum identification of peking as a part of traditional instrument of gamelan
JP3707121B2 (en) Pitch detection device
JPH06202627A (en) Sound signal pitch extracting device
JP3996221B2 (en) Pitch detection device
JP2604414B2 (en) Automatic music transcription method and device
JPH0476120B2 (en)
JP3707120B2 (en) Pitch detection device
JP2002073015A (en) Tuning auxiliary equipment, tuning method and storage medium
JP3996222B2 (en) Pitch detection device
JP2604403B2 (en) Automatic music transcription method and device
JPH0648556Y2 (en) Input control device for electronic musical instruments
JP2733938B2 (en) Melody analyzer
Satar-Boroujeni et al. Tracking of partials in music signals using Kalman filtering: modeling and analysis

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

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

Free format text: PAYMENT UNTIL: 20070728

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20080728

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20080728

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090728

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20090728

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20100728

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees