JP2006113416A - The frequency counting method and device - Google Patents

The frequency counting method and device Download PDF

Info

Publication number
JP2006113416A
JP2006113416A JP2004302417A JP2004302417A JP2006113416A JP 2006113416 A JP2006113416 A JP 2006113416A JP 2004302417 A JP2004302417 A JP 2004302417A JP 2004302417 A JP2004302417 A JP 2004302417A JP 2006113416 A JP2006113416 A JP 2006113416A
Authority
JP
Japan
Prior art keywords
samples
total number
period
relative error
periods
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.)
Pending
Application number
JP2004302417A
Other languages
Japanese (ja)
Inventor
Kazuaki Ouchi
一哲 大内
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.)
New Japan Radio Co Ltd
Original Assignee
New Japan Radio 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 New Japan Radio Co Ltd filed Critical New Japan Radio Co Ltd
Priority to JP2004302417A priority Critical patent/JP2006113416A/en
Publication of JP2006113416A publication Critical patent/JP2006113416A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Measuring Frequencies, Analyzing Spectra (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce the relative errors in the detected cycles to a certain limit, reduce the cycle detecting time, and reduce the influence of the cycle variation errors generated in the detecting time. <P>SOLUTION: The total number of the samples a1 is obtained for one cycle of the inputted discrete signals in a zero crossing system, and the number of the cycles N to measure is obtained from the total number of the samples a1 and the relative error tolerance E set up in advance, and the total number of the samples a for the number of the cycles N is obtained, then the frequency f is obtained based on the above number of the cycles N and the total number of the samples of the above cycles N. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、周期性を持つアナログ信号(電磁波、音声)をサンプリングし量子化した離散信号(デジタル信号)からその周期を求めて周波数を検出する周波数検出方法および装置に関するものである。   The present invention relates to a frequency detection method and apparatus for detecting a frequency by obtaining a period from a discrete signal (digital signal) obtained by sampling and quantizing a periodic analog signal (electromagnetic wave, sound).

周期性信号の周期または周波数を求める方式として、従来から、周期性信号がゼロ点をクロスする性質を利用するゼロクロス方式が用いられてきた(例えば、特許文献1、2参照)。ここで、周期性信号とは、その0Hzの振幅成分(直流振幅成分)が振幅の最大値と比べて十分に小さく、ゆえに、振幅の平均値が限りなくゼロであるような性質、つまり直流バイアス成分が限りなく0であるような交流信号をいう。   As a method for obtaining the period or frequency of a periodic signal, a zero-crossing method that utilizes the property that a periodic signal crosses a zero point has been conventionally used (see, for example, Patent Documents 1 and 2). Here, the periodic signal has a property that its amplitude component (DC amplitude component) at 0 Hz is sufficiently smaller than the maximum value of the amplitude, and therefore the average value of the amplitude is infinitely zero, that is, DC bias. An AC signal whose component is zero infinite.

ゼロクロス点は、周期性信号がゼロを通過する点(座標)である。たとえば、
y(t)=sin(2πt) (t>0) (1)
で表される信号y(t)のゼロクロス点、すなわち、y(t)がゼロになるtの値は、0.5、1.0、1.5、・・・である。この例のように、信号が一定の周期性を持つことが自明であれば、隣り合う2つのゼロクロス点から当該信号の半周期の時間を得、これを基に周波数を求めることができる。
The zero cross point is a point (coordinate) where the periodic signal passes through zero. For example,
y (t) = sin (2πt) (t> 0) (1)
The y-cross point of the signal y (t) expressed by the following equation, that is, the value of t at which y (t) becomes zero is 0.5, 1.0, 1.5,. If it is obvious that the signal has a certain periodicity as in this example, the half-cycle time of the signal can be obtained from two adjacent zero-cross points, and the frequency can be obtained based on this.

上記のようなゼロクロス方式を用いた従来の周波数検出のフローチャートを図4に示す。この図4の処理は、当該フローチャートで表されるプログラムが記憶されたアドレッシング可能な外部記憶装置と、算術論理演算機能を有する演算装置と、上記外部記憶装置と比べて高速アクセスが可能なレジスタおよび内部記憶装置と、命令レジスタおよび命令デコーダで構成される制御装置と、これら装置が電気的に接続されたデータバスおよびアドレスバスを具備したデジタル信号処理装置を用いて実現できる。   FIG. 4 shows a flowchart of conventional frequency detection using the zero cross method as described above. The processing of FIG. 4 includes an addressable external storage device storing the program represented by the flowchart, an arithmetic device having an arithmetic logic operation function, a register that can be accessed at a higher speed than the external storage device, and This can be realized by using a digital signal processing device including an internal storage device, a control device including an instruction register and an instruction decoder, and a data bus and an address bus to which these devices are electrically connected.

図4のステップS44で表される信号Y(n)は、前記したような性質を有する周期性信号を、A/D変換回路によってサンプリングし、該A/D変換回路の構成で決まるビット幅で量子化した離散信号である。この信号Y(n)はリングバッファ等の記憶装置に格納され、該記憶装置は制御装置を用いて読み書き可能である。信号Y(n)の引数nは離散量(サンプリング番号)を表し、隣接2点間の離散信号の時間間隔はサンプリング周期Tsとなる。Zs,Zeはそれぞれ、ゼロクロス点を表す変数(サンプリング番号)であり、内部記憶装置の特定の番地かレジスタに一時的に格納される。後記する変数nも同様の変数(サンプリング番号)である。n1、n2は離散信号の値(レベルと極性をもつ)であり、同様に記憶装置に格納される。図4の処理の流れは以下のとおりである。   The signal Y (n) represented in step S44 in FIG. 4 is a bit width determined by sampling the periodic signal having the above-described properties by the A / D conversion circuit and the configuration of the A / D conversion circuit. It is a quantized discrete signal. The signal Y (n) is stored in a storage device such as a ring buffer, and the storage device can be read and written using a control device. The argument n of the signal Y (n) represents a discrete amount (sampling number), and the time interval of the discrete signal between two adjacent points is the sampling period Ts. Zs and Ze are variables (sampling numbers) representing zero-cross points, and are temporarily stored in specific addresses or registers of the internal storage device. The variable n described later is a similar variable (sampling number). n1 and n2 are discrete signal values (having a level and a polarity), and are similarly stored in the storage device. The process flow of FIG. 4 is as follows.

ステップS41で信号Y(n)の読み出しサンプリング点の開始位置を初期化(n=0)する。ステップS42でゼロクロス点を保持する第1番目の変数Zsを初期化(Zs=0)する。ステップS43でゼロクロス点を保持する第2番目の変数Ze’を初期化(Ze’=0)する。ステップS44で記憶装置から信号Y(n)の値n1を読み出して、変数n1に格納する。ステップS45で記憶装置から信号Y(n+1)の値n2を読み出して、変数n2に格納する。S46で変数nを1増分しておく。ステップS47でn1×n2を算出し、もし(n1×n2)≦0の場合は、n1の値とn2の値の極性が異なることを示すのでゼロクロス点を横切ったとしてステップS48に進み、そのときの変数n(=n+1)をゼロクロス点Zsとして変数Zsに格納する。(n1×n2)>0の場合はゼロクロス点を横切っていないのでステップS44に戻り、ステップS47までの処理を再度繰り返す。ゼロクロス点Zsが検出された後は、同様にして、ステップS49〜S53の処理により、次のゼロクロス点Ze’を検出する。ゼロクロス点ZsとZe’の間隔は半周期分を示すので、ステップS54で、周期Tsおよび上記より得られたゼロクロス点Zs,Ze’から周波数fを、
f=1/2Ts(Ze’−Zs) (2)
により求める。ただし、上記信号Y(n)は、その最大周波数がナイキスト周波数以下に帯域制限されていること、および周期の変動がないことの前提条件を満たすものとする。
In step S41, the start position of the read sampling point of the signal Y (n) is initialized (n = 0). In step S42, the first variable Zs holding the zero cross point is initialized (Zs = 0). In step S43, the second variable Ze ′ holding the zero cross point is initialized (Ze ′ = 0). In step S44, the value n1 of the signal Y (n) is read from the storage device and stored in the variable n1. In step S45, the value n2 of the signal Y (n + 1) is read from the storage device and stored in the variable n2. In S46, the variable n is incremented by one. In step S47, n1 × n2 is calculated. If (n1 × n2) ≦ 0, it indicates that the polarities of the values of n1 and n2 are different from each other. Variable n (= n + 1) is stored in the variable Zs as the zero cross point Zs. If (n1 × n2)> 0, the zero cross point has not been crossed, so the process returns to step S44 and the process up to step S47 is repeated again. After the zero cross point Zs is detected, the next zero cross point Ze ′ is detected in the same manner by the processing of steps S49 to S53. Since the interval between the zero cross points Zs and Ze ′ represents a half cycle, in step S54, the frequency f is calculated from the cycle Ts and the zero cross points Zs and Ze ′ obtained as described above.
f = 1 / 2Ts (Ze′−Zs) (2)
Ask for. However, the signal Y (n) satisfies the preconditions that the maximum frequency is band-limited to the Nyquist frequency or less and that there is no period variation.

具体例として、図5に示す離散信号のサンプリング周期Tsが0.1ミリ秒であるとし、これを図4に示したフローチャートにより処理すると、ゼロクロス点Zs,Ze’はそれぞれ10,20になる。したがって、検出周期Tは
T=2×0.1×(20−10)=2ミリ秒 (3)
となる。よって、検出周波数は500Hzとなる。このように、被測定信号が上記前提条件を備えた離散信号であるならば、ゼロクロス方式を用いることで当該信号の周期および周波数を求めることができる。
特開平10−049148号公報 特開平11−118846号公報
As a specific example, if the sampling period Ts of the discrete signal shown in FIG. 5 is 0.1 milliseconds, and this is processed according to the flowchart shown in FIG. Therefore, the detection period T is T = 2 × 0.1 × (20−10) = 2 milliseconds (3)
It becomes. Therefore, the detection frequency is 500 Hz. Thus, if the signal under measurement is a discrete signal having the above preconditions, the period and frequency of the signal can be obtained by using the zero cross method.
Japanese Patent Laid-Open No. 10-049148 JP-A-11-118846

ところが、図4に示す手法では、信号の周期が短くなるほど、サンプリング周期Tsに対する当該周期の割合が小さくなるので、相対誤差が大きくなる。たとえば、サンプリング周期Tsが0.1ミリ秒で4kHzの周期性をもった離散信号の周期を検出する場合、ゼロクロス検出の最小単位はサンプリング周期Tsであるため、たとえゼロクロス検出区間を半周期でなく1周期に長くしたとしても、4kHz、つまり0.25ミリ秒周期の信号は0.2ミリ秒(5KHz)または0.3ミリ秒(3.3KHz)のいずれか一方でゼロクロス点が認識される。相対誤差eは検出周期をT、真の周期をToとすると、次の(4)式
e=(|T−To|/To)×100(%) (4)
で表されるので、このときの相対誤差eは
e=(0.3−0.25)/0.25=0.2
つまり20%になる。
However, in the method shown in FIG. 4, the shorter the signal period, the smaller the ratio of the period to the sampling period Ts, so the relative error increases. For example, when the period of a discrete signal having a sampling period Ts of 0.1 milliseconds and a periodicity of 4 kHz is detected, the minimum unit of zero cross detection is the sampling period Ts, and therefore the zero cross detection interval is not a half period. Even if it is increased to one period, a zero cross point is recognized in either 0.2 millisecond (5 KHz) or 0.3 millisecond (3.3 KHz) for a signal with a period of 4 kHz, that is, 0.25 millisecond. . The relative error e is expressed by the following equation (4) when the detection cycle is T and the true cycle is To: e = (| T−To | / To) × 100 (%) (4)
Therefore, the relative error e at this time is e = (0.3−0.25) /0.25=0.2.
That is 20%.

そこで、相対誤差eを減らすためには、サンプリング周期Tsの長さに対してゼロクロス検出区間を長くすれば良いので、ゼロクロス検出の対象となる周期を2個以上にわたり加算すればよい。たとえば、0.25ミリ秒周期の信号を4周期分だけ加算すると、(4)式の|T−To|の最大値はサンプリング周期Tsである0.1ミリ秒であるのに対し、Toは0.25×4=1.0と大きくなるので、相対誤差eは
e=0.1/1.0=0.1
つまり10[%]に低減される。
Therefore, in order to reduce the relative error e, the zero cross detection section may be made longer than the length of the sampling period Ts. Therefore, two or more periods to be subjected to zero cross detection may be added. For example, when a signal having a period of 0.25 milliseconds is added by four periods, the maximum value of | T-To | in the equation (4) is 0.1 milliseconds which is the sampling period Ts, whereas To is Since 0.25 × 4 = 1.0, the relative error e is e = 0.1 / 1.0 = 0.1
That is, it is reduced to 10 [%].

しかしながら、上記方法によっても2つの問題点が新たに発生する。第1の問題点は、周期の検出中に信号の周期が何らかの原因によって変動すると、検出区間中から得られるゼロクロス点から周期および周波数を計算する際に誤差が発生することである。特に、計測対象外の周波数成分(雑音)が多く含まれやすい自然環境で計測した周期性信号は、その雑音により高い確率で検出中に周期が変動する。従って、高い演算精度が要求される計測の分野において、第1の問題点は、このゼロクロス方式を応用した技術や製品の品質を損なう結果となる。   However, two new problems also occur with the above method. The first problem is that if the period of the signal fluctuates for some reason during the period detection, an error occurs when calculating the period and frequency from the zero cross point obtained from the detection interval. In particular, a periodic signal measured in a natural environment that is likely to contain a lot of frequency components (noise) that are not to be measured has a high fluctuation probability during detection due to the noise. Therefore, in the field of measurement where high calculation accuracy is required, the first problem is the result of deteriorating the technology and product quality to which this zero cross method is applied.

第2の問題点は、信号の周期が長くなるほど、必要な個数の周期信号を検出するまでの時間が長くかかることである。通信分野のパケット伝送のように、処理上の遅延が発生することを前提とし、かつ、それが許される待機系システムのような場合においては問題ないものの、デジタル信号処理装置を用いたシステムのように処理時間の性能が要求される場合において、第2の問題点は、第1の問題点と同様に、このゼロクロス方式を応用した技術や製品の品質を損なう結果となる。   The second problem is that the longer the period of the signal, the longer it takes to detect the required number of periodic signals. As in the case of packet transmission in the communication field, there is no problem in the case of a standby system in which processing delay occurs and is allowed, but it is like a system using a digital signal processing device. When the processing time performance is required, the second problem is the same as the first problem, which results in the deterioration of the technology and product quality applying the zero cross method.

本発明は、上記2つの問題点を解消し、検出周期の相対誤差を一定の範囲内に低減し、かつ周期検出処理時間を低減するとともに、検出期間中に発生する周期変動誤差の影響を低減し、結果として検出精度を改善した周波数を検出することを目的とする。   The present invention eliminates the above two problems, reduces the relative error of the detection period within a certain range, reduces the period detection processing time, and reduces the influence of the period fluctuation error that occurs during the detection period. As a result, an object is to detect a frequency with improved detection accuracy.

請求項1にかかる発明の周波数検出方法は、ゼロクロス方式により入力デジタル信号の1周期分の合計サンプル数a1を求める第1のステップと、該第1のステップで求めた1周期分の合計サンプル数a1と予め設定した相対誤差許容値Eとから測定すべき周期個数Nを求める第2のステップと、前記第1のステップと同様な処理により前記第2のステップで求めた周期個数N分の合計サンプル数aを求める第3のステップと、前記第2のステップで求めた周期個数N分と前記第3のステップで求めた周期個数N分の合計サンプル数aとに基づき周波数を求める第4のステップと、を具備することを特徴とする。   The frequency detection method according to the first aspect of the present invention includes a first step of obtaining a total number of samples a1 for one cycle of an input digital signal by a zero cross method, and a total number of samples for one cycle obtained in the first step. a second step for obtaining the number of periods N to be measured from a1 and a preset relative error allowable value E, and a total for the number of periods N obtained in the second step by the same process as the first step. A fourth step for obtaining a frequency based on a third step for obtaining the number of samples a, the number N of the periods obtained in the second step, and the total number of samples a for the number of periods N obtained in the third step. And a step.

請求項2にかかる発明は、請求項1に記載の周波数検出方法において、前記第3のステップは、隣り合う2個の周期の各々の合計サンプル数から相対誤差eを求め、該相対誤差eが前記相対誤差許容値E又は別に設定した相対誤差許容値以上のとき、前記第2のステップに戻すことを特徴とする。   According to a second aspect of the present invention, in the frequency detection method according to the first aspect, in the third step, the relative error e is obtained from the total number of samples in each of two adjacent periods, and the relative error e is When the relative error allowable value E or the relative error allowable value set separately is equal to or larger, the process returns to the second step.

請求項3にかかる発明の周波数検出装置は、入力離散信号を格納する記憶手段と、該記憶手段に格納された離散信号からゼロクロス方式により該離散信号の1周期分の合計サンプル数a1を検出するゼロクロス検出手段と、該ゼロクロス検出手段で検出された1周期分の合計サンプル数a1と予め設定した相対誤差許容値Eとから測定すべき周期個数Nを算出する誤差低減係数算出手段と、該誤差低減係数算出手段で算出された周期個数N分の合計サンプル数aを得る周期検出手段と、該周期検出手段で得られた合計サンプル数aと前記周期個数Nとから周波数を算出する演算手段とを具備することを特徴とする。   According to a third aspect of the present invention, there is provided a frequency detecting device for storing an input discrete signal, and detecting the total number of samples a1 for one period of the discrete signal from the discrete signal stored in the storing means by a zero cross method. Zero-cross detection means, error reduction coefficient calculation means for calculating the number of periods N to be measured from the total number of samples a1 detected by the zero-cross detection means and a preset relative error tolerance E, and the error A period detecting means for obtaining a total number of samples a corresponding to the number of periods N calculated by the reduction coefficient calculating means; a calculating means for calculating a frequency from the total number of samples a obtained by the period detecting means and the number of periods N; It is characterized by comprising.

請求項4にかかる発明は、請求項3に記載の周波数検出装置において、前記周期検出回路は、上記ゼロクロス方式を用いて検出された隣接する2個の周期のそれぞれの合計サンプル数から求めた相対誤差eが前記相対誤差許容値E又は別に設定した相対誤差許容値以上になったとき周期個数N分の合計サンプル数aの検出を停止して、再度前記誤差低減係数算出手段による周期個数Nの算出処理に戻すことを特徴とする。   According to a fourth aspect of the present invention, in the frequency detection device according to the third aspect, the period detection circuit is a relative value obtained from the total number of samples of two adjacent periods detected by using the zero-cross method. When the error e becomes equal to or greater than the relative error allowable value E or a separately set relative error allowable value, the detection of the total number of samples a for the number of periods N is stopped, and the number of periods N by the error reduction coefficient calculation means is again determined. It returns to a calculation process, It is characterized by the above-mentioned.

請求項1,3にかかる発明によれば、必要となる周期個数Nが相対誤差許容値Eとの関係で必要最小限度の値として算出されるので、検出周期の相対誤差を一定の範囲内に低減しつつ、周期検出処理時間を低減することができる。また、請求項2,4にかかる発明によれば、1周期分の合計サンプル数を得る毎に、前回得た1周期分の合計サンプル数とによる相対誤差eを相対誤差許容値E又は別に設定した相対誤差許容値と比較し、相対誤差eが相対誤差許容値以上になったときは再度周期個数Nを得る処理に戻るので、周期変動の影響を低減することができる。したがって、周波数検出精度が向上し、計測対象となる信号以外の雑音が含まれやすい自然環境で計測した信号の周期を計測する計測システムへの応用に効果的である。   According to the first and third aspects of the invention, since the necessary number of periods N is calculated as a necessary minimum value in relation to the relative error allowable value E, the relative error of the detection period is within a certain range. The period detection processing time can be reduced while reducing. According to the inventions of claims 2 and 4, each time the total number of samples for one period is obtained, the relative error e based on the total number of samples for one period obtained last time is set as the relative error allowable value E or separately. Compared with the allowable relative error value, when the relative error e becomes equal to or larger than the allowable relative error value, the process returns to the process of obtaining the number of periods N again, so that the influence of the period fluctuation can be reduced. Therefore, the frequency detection accuracy is improved, and it is effective for application to a measurement system that measures the period of a signal measured in a natural environment where noise other than the signal to be measured is likely to be included.

図1は本発明の実施例の周波数検出装置の構成を示すブロック図である。本実施例の周波数検出装置は、アンチエリアジングフィルタ(AAF)1、A/D変換回路2、ローパスフィルタ(LPF)3、リングバッファ(記憶装置)4、ゼロクロス検出回路5、誤差低減係数算出回路6、周期検出回路7、除算回路8、および乗算回路9で構成される。   FIG. 1 is a block diagram showing the configuration of a frequency detection apparatus according to an embodiment of the present invention. The frequency detection apparatus of this embodiment includes an anti-aliasing filter (AAF) 1, an A / D conversion circuit 2, a low-pass filter (LPF) 3, a ring buffer (storage device) 4, a zero-cross detection circuit 5, and an error reduction coefficient calculation circuit. 6, a period detection circuit 7, a division circuit 8, and a multiplication circuit 9.

アンチエリアジングフィルタ1は、一般的には、演算増幅器および受動素子(抵抗、コンデンサ、コイル等)の組み合わせで構成されるN次ローパスフィルタであり、これにより、A/D変換回路2以降の処理で折り返し歪が発生するのを防ぐ。A/D変換回路2は、入力するアナログ信号を一定の時間間隔Tsでサンプリングし、サンプリングした全ての信号を、A/D変換回路の構成によって決まるビット幅で量子化する。ローパスフィルタ3はA/D変換された信号中のナイキスト周波数以下の周波数帯域成分を除去する。リングバッファ4は、ローパスフィルタ3から出力する各サンプリング点の信号やサンプル番号その他を格納するメモリであり、アクセスアドレスが単調増加する条件において、アドレスが最大を超えた場合に、最小アドレスに戻ることにより、無限大のアドレス空間を擬似的に実現する。ゼロクロス検出回路5は、後記する図3のフローチャートに示す処理により1周期分の2個のゼロクロス点Zs,Zeを検出する。誤差低減係数算出回路6は、ゼロクロス検出回路5で得た1周期分の合計サンプル数a1から、相対誤差eを予め設定した相対誤差許容値E未満に低減するのに必要な周期個数Nを算出する。周期検出回路7は誤差低減係数算出回路6で得た周期個数Nと、リングバッファ4に記憶された信号から図3のフローチャートに示す処理によりN周期分の合計サンプル数aを算出する。除算回路8は、周期検出回路7で得た合計サンプル数aの逆数(1/a)を得る。なお、除算機能を具備したデジタル信号処理装置があればこれを用い、除算機能がなければ加減算回路および乗算回路を用いて除算機能を実現する。乗算回路9は、除算回路8で得られた除数(1/a)と誤差低減係数算出回路6で得られた周期個数Nとから、周波数fを得る。この乗算回路9は、積和演算機能を有するデジタル信号処理装置には殆どの場合で具備されている。   The anti-aliasing filter 1 is generally an Nth-order low-pass filter composed of a combination of an operational amplifier and passive elements (resistors, capacitors, coils, etc.), whereby the processing after the A / D conversion circuit 2 is performed. Prevents the occurrence of folding distortion. The A / D conversion circuit 2 samples an input analog signal at a constant time interval Ts, and quantizes all the sampled signals with a bit width determined by the configuration of the A / D conversion circuit. The low-pass filter 3 removes frequency band components below the Nyquist frequency in the A / D converted signal. The ring buffer 4 is a memory for storing the signal, sample number, etc. of each sampling point output from the low-pass filter 3, and returns to the minimum address when the address exceeds the maximum under the condition that the access address monotonously increases. Thus, an infinite address space is realized in a pseudo manner. The zero-cross detection circuit 5 detects two zero-cross points Zs and Ze for one cycle by the process shown in the flowchart of FIG. 3 to be described later. The error reduction coefficient calculation circuit 6 calculates the number of periods N required to reduce the relative error e below a preset relative error allowable value E from the total number of samples a1 for one period obtained by the zero cross detection circuit 5. To do. The cycle detection circuit 7 calculates the total number of samples a for N cycles from the cycle number N obtained by the error reduction coefficient calculation circuit 6 and the signal stored in the ring buffer 4 by the process shown in the flowchart of FIG. The division circuit 8 obtains the reciprocal (1 / a) of the total sample number a obtained by the period detection circuit 7. If there is a digital signal processing apparatus having a division function, this is used, and if there is no division function, the division function is realized using an addition / subtraction circuit and a multiplication circuit. The multiplication circuit 9 obtains the frequency f from the divisor (1 / a) obtained by the division circuit 8 and the period number N obtained by the error reduction coefficient calculation circuit 6. This multiplication circuit 9 is provided in most cases in a digital signal processing apparatus having a product-sum operation function.

次に、本実施例の周波数検出装置の動作を図2および図3のフローチャートも参照して説明する。まず、計測対象となるアナログ信号をアンチエリアジングフィルタ1で処理する。アナログ信号には目的とする計測対象信号以外にノイズといわれる自然界の光、電磁波、音、熱等を要因とした雑音が必ず含まれる。特に、ノイズが白色雑音の性質を有するならば、その周波数帯域は無限大である。しかし、A/D変換回路2以降の離散信号処理を扱うデジタル信号処理システムにおいては、サンプリング定理によりサンプリング周波数の1/2(ナイキスト周波数)以上の周波数帯域は扱えない。そこで、A/D変換回路2で処理する前に、アンチエリアジングフィルタ1でナイキスト周波数以上の周波数成分を除去する。   Next, the operation of the frequency detection apparatus of this embodiment will be described with reference to the flowcharts of FIGS. First, the analog signal to be measured is processed by the anti-aliasing filter 1. Analog signals always include noise caused by natural light, electromagnetic waves, sound, heat, etc., which is called noise, in addition to the target measurement target signal. In particular, if the noise has the property of white noise, its frequency band is infinite. However, a digital signal processing system that handles discrete signal processing after the A / D conversion circuit 2 cannot handle a frequency band of 1/2 or more of the sampling frequency (Nyquist frequency) by the sampling theorem. Therefore, before processing by the A / D conversion circuit 2, the anti-aliasing filter 1 removes frequency components higher than the Nyquist frequency.

アンチエリアジングフィルタ1で処理したアナログ信号を、A/D変換回路2でサンプリングし、量子化して離散信号に変換し、これをローパスフィルタ3で帯域除去しリングバッファ4に格納する。   The analog signal processed by the anti-aliasing filter 1 is sampled by the A / D conversion circuit 2, quantized and converted into a discrete signal, the band is removed by the low-pass filter 3 and stored in the ring buffer 4.

次に、ゼロクロス検出回路5により信号の1周期分の合計サンプル数a1を検出する。この検出方法は従来技術とほぼ同じであり、図2のステップS1により処理される。なお、ステップS1の「ゼロクロスY(n)」は、変数nを処理の開始位置とした図3に示すゼロクロス点検出処理を実行することを意味する。この図3では図4で説明した半周期分の合計サンプル数(Ze’−Zs)ではなく、1周期分の合計サンプル数a1(=Ze−Zs)を得る。また、変数n(サンプル番号)はグローバル変数としての意味を持つため、ステップS1実行直後の変数nは、図3のステップS37の実行後の変数nと同じである。   Next, the zero cross detection circuit 5 detects the total number of samples a1 for one period of the signal. This detection method is almost the same as that of the prior art, and is processed by step S1 in FIG. Note that “zero cross Y (n)” in step S1 means that the zero cross point detection process shown in FIG. 3 is executed with the variable n as the process start position. In FIG. 3, the total number of samples a1 (= Ze−Zs) for one period is obtained instead of the total number of samples (Ze′−Zs) for the half period described in FIG. Since the variable n (sample number) has a meaning as a global variable, the variable n immediately after execution of step S1 is the same as the variable n after execution of step S37 in FIG.

誤差低減係数算出回路6は、図2のステップS2により処理される。Nは予め設定した相対誤差許容値E(%)以下にするために最低必要な周期個数である。相対誤差許容値Eは(4)式の考え方を踏襲すると、(4)式の「|T−To|」の最大値はサンプリング周期Tsであり、ToはN周期分の時間「a1×Ts×N」であるので、
E≧{Ts/(a1×Ts×N)}×100(%) (5)
となる。この(5)式を整理すると、周期個数Nは、
N≧{1/(a1×E)}×100(%) (6)
となる。ただし、この周期個数Nは小数点以下を切り上げた整数である。したがって、例えば、相対誤差許容値Eを10(%)とすると、周期個数Nは、
N={1/(a1×10)}×100(%)
=10/a1 (7)
となる。ここで、周期個数Nが小さくならないように、「a1」→「a1−1」に変形する。さらに、積算処理を開始する前に検出された1周期分を外すと、(7)式は、
N=[10/(a1−1)]−1 (8)
となる。ステップS2では、この(8)式により周期個数Nを検出する。そして、周期個数Nを算出した後は、周期検出回路7でN周期分の合計サンプル数aを積算検出する。この周期検出回路7による処理は、図2のステップS3〜S10により、以下のように行われる。
The error reduction coefficient calculation circuit 6 is processed in step S2 of FIG. N is the minimum number of periods required to make the relative error allowable value E (%) or less set in advance. When the relative error allowable value E follows the concept of the equation (4), the maximum value of “| T−To |” in the equation (4) is the sampling period Ts, and To is the time “a1 × Ts × N "
E ≧ {Ts / (a1 × Ts × N)} × 100 (%) (5)
It becomes. By organizing the equation (5), the number of periods N is
N ≧ {1 / (a1 × E)} × 100 (%) (6)
It becomes. However, this cycle number N is an integer obtained by rounding up the number after the decimal point. Therefore, for example, if the relative error tolerance E is 10 (%), the number of periods N is
N = {1 / (a1 × 10)} × 100 (%)
= 10 / a1 (7)
It becomes. Here, it is transformed from “a1” to “a1-1” so that the number of cycles N does not become small. Furthermore, when one cycle detected before starting the integration process is removed, the equation (7) is
N = [10 / (a1-1)]-1 (8)
It becomes. In step S2, the number of periods N is detected by the equation (8). After calculating the number of periods N, the period detection circuit 7 integrates and detects the total number of samples a for N periods. The processing by the cycle detection circuit 7 is performed as follows by steps S3 to S10 in FIG.

ステップS3においては、ステップS1で算出した1周期の合計サンプル数a1を変数aに格納する。ステップS4においては、ステップS10と対でステップS4〜S9の一連の処理をN回繰り返す。ステップS5は、ステップS1と同様(図3)のゼロクロス方式により得た次回の1周期分の合計サンプル数a2を格納する。ステップS6は隣接する1周期分の2つの合計サンプル数a1とa2の相対誤差eを得る。相対誤差eは、(4)式と同様に、
e={|a2−a1|/a1}×100(%) (9)
である。ステップS7は次のループ処理のための、変数の入れ換え処理である。ステップS8は相対誤差eが相対誤差許容値Eより小さければ、周期の変動はないと見なしステップS9に移行し、合計サンプル数aを更新する。以上により、ステップS4〜S10のループを脱出した時点において得られる合計サンプル数aは、ゼロクロスにより検出された連続したN周期分の合計サンプル数を示すことになる。ステップS11では、図1の除算回路8で算出した除数1/aと周期個数Nとの積を乗算回路9で求めることによって、相対誤差を低減した周波数fが、
f=1/[N・(1/a)]
=1/(N/a) (10)
により得られる。なお、ステップS8においてe≧Eのときは、周期検出中に周期変動があったと見なし、ステップS2に戻って、再び周期個数Nを算出して、N周期分の合計サンプル数aを求める同様な処理を繰り返し、周期変動の影響を低減する。
In step S3, the total number of samples a1 in one cycle calculated in step S1 is stored in the variable a. In step S4, the series of steps S4 to S9 is repeated N times in pairs with step S10. In step S5, the total number of samples a2 for the next one cycle obtained by the zero cross method similar to step S1 (FIG. 3) is stored. In step S6, a relative error e between two total sample numbers a1 and a2 for one adjacent period is obtained. The relative error e is equal to the equation (4),
e = {| a2-a1 | / a1} × 100 (%) (9)
It is. Step S7 is a variable replacement process for the next loop process. In step S8, if the relative error e is smaller than the relative error allowable value E, it is considered that there is no fluctuation of the cycle, and the process proceeds to step S9, where the total number of samples a is updated. As described above, the total sample number a obtained at the time of exiting the loop of steps S4 to S10 indicates the total number of samples for consecutive N periods detected by the zero crossing. In step S11, the multiplication circuit 9 obtains the product of the divisor 1 / a calculated by the division circuit 8 of FIG.
f = 1 / [N · (1 / a)]
= 1 / (N / a) (10)
Is obtained. Note that when e ≧ E in step S8, it is considered that there is a period variation during period detection, and the process returns to step S2, and the period number N is calculated again to obtain the total sample number a for N periods. The process is repeated to reduce the influence of periodic fluctuations.

本実施例ではこのように、1回目に検出した1周期分の合計サンプル数a1と予め設定した相対誤差許容値Eを基に周期個数Nを求め、2回目に検出した1周期分の合計サンプル数a2と1回目の合計サンプル数a1により相対誤差eを求め、この相対誤差eが相対誤差許容値E未満の場合にのみ以後に周期個数N分の合計サンプル数aを求めて周波数fを検出するものであり、サンプリング誤差を相対誤差許容値E未満に低減することができる。   In this embodiment, the number of periods N is obtained based on the total number of samples a1 for the first period detected in the first time and the relative error tolerance E set in advance, and the total number of samples for the first period detected for the second time. The relative error e is obtained from the number a2 and the first total sample number a1, and only when this relative error e is less than the relative error allowable value E, the total sample number a corresponding to the number of periods N is obtained to detect the frequency f. Thus, the sampling error can be reduced to less than the relative error allowable value E.

また、周期個数N分の合計サンプル数aを求める際には、個々の1周期分の合計サンプル数a2を検出する毎に前回検出した合計サンプル数a1との相対誤差eが相対誤差許容値E以上になると、次の処理を周期個数Nを算出のステップS2に戻すので、周期変動の影響を低減することができる。   Further, when the total number of samples a for the number of cycles N is obtained, the relative error e with respect to the total number of samples a1 detected last time is detected every time the total number of samples a2 for each cycle is detected. If it becomes above, since the next process will return to step S2 of calculation of the period number N, the influence of a period fluctuation | variation can be reduced.

なお、ステップS8の相対誤差許容値EはステップS2で周期個数Nの算出に用いた相対誤差許容値Eと同じでも、また別に設定した相対誤差許容値であっても良い。   The relative error allowable value E in step S8 may be the same as the relative error allowable value E used for calculating the number of periods N in step S2, or may be a relative error allowable value set separately.

本発明の実施例の周波数検出装置の構成を示すブロック図である。It is a block diagram which shows the structure of the frequency detection apparatus of the Example of this invention. 図1の周波数検出装置の動作のフローチャートである。It is a flowchart of operation | movement of the frequency detection apparatus of FIG. 本発明の実施例のゼロクロス方式による周期検出のフローチャートである。It is a flowchart of the period detection by the zero cross system of the Example of this invention. 従来のゼロクロス方式による半周期検出のフローチャートである。It is a flowchart of the half cycle detection by the conventional zero cross system. ゼロクロス方式による周波数検出の誤差の説明図である。It is explanatory drawing of the error of the frequency detection by a zero cross system.

符号の説明Explanation of symbols

1:アンチエリアジングフィルタ(AAF)
2:A/D変換回路
3:ローパスフィルタ(LPF)
4:リングバッファ(記憶装置)
5:ゼロクロス検出回路
6:誤差低減係数算出回路
7:周期検出回路
8:除算回路
9:乗算回路
1: Anti-aliasing filter (AAF)
2: A / D converter circuit 3: Low-pass filter (LPF)
4: Ring buffer (storage device)
5: Zero cross detection circuit 6: Error reduction coefficient calculation circuit 7: Period detection circuit 8: Division circuit 9: Multiplication circuit

Claims (4)

ゼロクロス方式により入力離散信号の1周期分の合計サンプル数a1を求める第1のステップと、
該第1のステップで求めた1周期分の合計サンプル数a1と予め設定した相対誤差許容値Eとから測定すべき周期個数Nを求める第2のステップと、
前記第1のステップと同様な処理の繰り返しにより前記第2のステップで求めた周期個数N分の合計サンプル数aを求める第3のステップと、
前記第2のステップで求めた周期個数Nと前記第3のステップで求めた周期個数N分の合計サンプル数aとに基づき周波数を求める第4のステップと、
を具備することを特徴とする周波数検出方法。
A first step of obtaining a total number of samples a1 for one period of an input discrete signal by a zero cross method;
A second step of obtaining the number of periods N to be measured from the total number of samples a1 for one period obtained in the first step and a preset relative error allowable value E;
A third step of obtaining a total number of samples a corresponding to the number of periods N obtained in the second step by repeating the same process as in the first step;
A fourth step of obtaining a frequency based on the number of periods N obtained in the second step and the total number of samples a corresponding to the number of periods N obtained in the third step;
A frequency detection method comprising:
請求項1に記載の周波数検出方法において、
前記第3のステップは、隣り合う2個の周期の各々の合計サンプル数から相対誤差eを求め、該相対誤差eが前記相対誤差許容値E又は別に設定した相対誤差許容値以上のとき、前記第2のステップに戻すことを特徴とする周波数検出方法。
The frequency detection method according to claim 1,
The third step obtains a relative error e from the total number of samples in each of the two adjacent periods, and when the relative error e is equal to or greater than the relative error allowable value E or a separately set relative error allowable value, Returning to the second step, a frequency detection method.
入力離散信号を格納する記憶手段と、該記憶手段に格納された離散信号からゼロクロス方式により該離散信号の1周期分の合計サンプル数a1を検出するゼロクロス検出手段と、該ゼロクロス検出手段で検出された1周期分の合計サンプル数a1と予め設定した相対誤差許容値Eとから測定すべき周期個数Nを算出する誤差低減係数算出手段と、該誤差低減係数算出手段で算出された周期個数N分の合計サンプル数aを得る周期検出手段と、該周期検出手段で得られた合計サンプル数aと前記周期個数Nとから周波数を算出する演算手段とを具備することを特徴とする周波数検出装置。   Storage means for storing the input discrete signal, zero-cross detection means for detecting the total number of samples a1 for one period of the discrete signal from the discrete signal stored in the storage means, and detected by the zero-cross detection means An error reduction coefficient calculating means for calculating the number of periods N to be measured from the total number of samples a1 for one period and a preset relative error allowable value E, and the number of periods N calculated by the error reduction coefficient calculating means. A frequency detection apparatus comprising: period detection means for obtaining a total number of samples a; and calculation means for calculating a frequency from the total number of samples a obtained by the period detection means and the number of periods N. 請求項3に記載の周波数検出装置において、
前記周期検出回路は、上記ゼロクロス方式を用いて検出された隣接する2個の周期のそれぞれの合計サンプル数から求めた相対誤差eが前記相対誤差許容値E又は別に設定した相対誤差許容値以上になったとき周期個数N分の合計サンプル数aの検出を停止して、再度前記誤差低減係数算出手段による周期個数Nの算出処理に戻すことを特徴とする周波数検出装置。
The frequency detection apparatus according to claim 3,
In the period detection circuit, the relative error e obtained from the total number of samples of two adjacent periods detected using the zero-cross method is equal to or greater than the relative error allowable value E or a separately set relative error allowable value. Then, the detection of the total number of samples a for the number of cycles N is stopped, and the frequency detection device returns to the processing for calculating the number of cycles N by the error reduction coefficient calculation means again.
JP2004302417A 2004-10-18 2004-10-18 The frequency counting method and device Pending JP2006113416A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004302417A JP2006113416A (en) 2004-10-18 2004-10-18 The frequency counting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004302417A JP2006113416A (en) 2004-10-18 2004-10-18 The frequency counting method and device

Publications (1)

Publication Number Publication Date
JP2006113416A true JP2006113416A (en) 2006-04-27

Family

ID=36381972

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004302417A Pending JP2006113416A (en) 2004-10-18 2004-10-18 The frequency counting method and device

Country Status (1)

Country Link
JP (1) JP2006113416A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0922298A (en) * 1995-01-12 1997-01-21 Blue Chip Music Gmbh Method and apparatus for recognition of pitch
JPH1049148A (en) * 1996-07-30 1998-02-20 Yamaha Corp Frequency detecting device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0922298A (en) * 1995-01-12 1997-01-21 Blue Chip Music Gmbh Method and apparatus for recognition of pitch
JPH1049148A (en) * 1996-07-30 1998-02-20 Yamaha Corp Frequency detecting device

Similar Documents

Publication Publication Date Title
Shi et al. Design of linear phase FIR filters with high probability of achieving minimum number of adders
EP0539116A2 (en) Method and apparatus for generating correction signals for forming low distortion analog signals
CN112580793B (en) Neural network accelerator based on time domain memory computing and acceleration method
JP2019165365A (en) Signal processing device
KR19980014906A (en) Accumulator
JP5035815B2 (en) Frequency measuring device
JP3918034B2 (en) Method and apparatus for determining mask limits
JP2600821B2 (en) Sampling frequency converter
JP2006113416A (en) The frequency counting method and device
KR100817692B1 (en) A method for estimating phase angle of time series data by discrete Fourier transform
CN113777394A (en) Software integration method, device, equipment and storage medium independent of external circuit
JPH10160507A (en) Peak detecting device
KR100840103B1 (en) A method for accurate estimation of the low frequency and the Fourier spectrum angle for real time analysis of dynamic systems
JP5470574B2 (en) Peak level detector
Roza Recursive bitstream conversion: The reverse mode
KR100706217B1 (en) Wave detection device, method, and recording medium
JP2600820B2 (en) Sampling frequency converter
Tiwari et al. Field programmable gate array-based measurement system for real-time estimation of single-phase electric power quantities
EP1444569A1 (en) Method and systeme for converting varying-radix numbers
JPH0946136A (en) Gauss noise generator and its method
JP2008158855A (en) Correlation computing element and correlation computing method
JP2773434B2 (en) Measurement data storage device
US7412370B2 (en) Modeling linear and non-linear system response to a pulse train
CN118413210A (en) Zero crossing point calculation processing method and system
KR20050084345A (en) Digital sampling frequency converter

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070807

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100212

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100217

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20100729