JP2020137043A - Digital filter - Google Patents
Digital filter Download PDFInfo
- Publication number
- JP2020137043A JP2020137043A JP2019031484A JP2019031484A JP2020137043A JP 2020137043 A JP2020137043 A JP 2020137043A JP 2019031484 A JP2019031484 A JP 2019031484A JP 2019031484 A JP2019031484 A JP 2019031484A JP 2020137043 A JP2020137043 A JP 2020137043A
- Authority
- JP
- Japan
- Prior art keywords
- input
- level
- digital filter
- sampling
- detection
- 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
Links
Images
Landscapes
- Manipulation Of Pulses (AREA)
Abstract
Description
本発明は、デジタルフィルタに関する。 The present invention relates to a digital filter.
マイコン等の半導体装置では、入力信号にノイズが乗る場合がある。ノイズは誤動作の原因となり得るため、半導体装置には、ノイズをフィルタリングするフィルタ回路が設けられている。例えば、特許文献1には、デジタル処理により入力信号のノイズを除去するデジタルフィルタが開示されている。
In semiconductor devices such as microcomputers, noise may be added to the input signal. Since noise can cause malfunction, the semiconductor device is provided with a filter circuit for filtering noise. For example,
まず、従来のフィルタリング処理について説明する。なお、ここでは、割り込み端子の入力信号を例にしてフィルタリング処理の説明を行う。図13は、従来のフィルタリング処理の一例を説明するタイミング図である。図13には、サンプリングクロック、IRQ(割り込み)端子の端子電圧レベル、及び割り込み検出信号の波形がそれぞれ示されている。 First, the conventional filtering process will be described. Here, the filtering process will be described using the input signal of the interrupt terminal as an example. FIG. 13 is a timing diagram illustrating an example of the conventional filtering process. FIG. 13 shows the sampling clock, the terminal voltage level of the IRQ (interrupt) terminal, and the waveform of the interrupt detection signal, respectively.
サンプリングクロックは、入力端子の端子電圧のサンプリングのタイミングを規定するクロックである。ここでは、デジタルフィルタは、例えばサンプリングクロックの立ち上がり時に、端子電圧の電圧レベルを判定するものとする。図13に示すように、サンプリングクロックは、時刻t0〜t16のそれぞれにおいて、ローレベルからハイレベルに立ち上がっており、このタイミングで端子電圧の電圧レベルが判定される。もちろん、これ以外にもクロックの立ち下りのタイミングで端子電圧の電圧レベルが判定されてもよい。 The sampling clock is a clock that defines the sampling timing of the terminal voltage of the input terminal. Here, it is assumed that the digital filter determines the voltage level of the terminal voltage, for example, at the rising edge of the sampling clock. As shown in FIG. 13, the sampling clock rises from the low level to the high level at each of the times t0 to t16, and the voltage level of the terminal voltage is determined at this timing. Of course, in addition to this, the voltage level of the terminal voltage may be determined at the timing of the falling edge of the clock.
例えば、3回連続で端子電圧の電圧レベルがハイレベルであると判定されると、デジタルフィルタは、端子電圧の真の電圧レベルがハイレベルであり、割り込みが発生したと判定する。そして、デジタルフィルタは、ハイレベルの割り込み検出信号を出力する。図13では、時刻t12〜t14にかけて、3回連続で端子電圧の電圧レベルがハイレベルとなっており、このタイミングで割り込み検出信号が出力される。 For example, if it is determined that the voltage level of the terminal voltage is high level three times in a row, the digital filter determines that the true voltage level of the terminal voltage is high level and an interrupt has occurred. Then, the digital filter outputs a high-level interrupt detection signal. In FIG. 13, the voltage level of the terminal voltage is high three times in a row from time t12 to t14, and the interrupt detection signal is output at this timing.
一方、図14は、従来のフィルタリング処理の他の例を説明するタイミング図である。図14は、図13と類似しているが、端子電圧の電圧レベルが3回連続でローレベルと判定されたとき、割り込みが発生したものと判定される。図14に示すように、時刻t8〜t10にかけて、3回連続で端子電圧の電圧レベルがローレベルとなっており、このタイミングで割り込み検出信号が出力される。 On the other hand, FIG. 14 is a timing diagram for explaining another example of the conventional filtering process. FIG. 14 is similar to FIG. 13, but when the voltage level of the terminal voltage is determined to be low level three times in a row, it is determined that an interrupt has occurred. As shown in FIG. 14, from time t8 to t10, the voltage level of the terminal voltage becomes low level three times in a row, and the interrupt detection signal is output at this timing.
しかし、図13、図14の例では、サンプリング時にたまたまノイズが発生することにより、電圧レベルが3回続けてハイレベル又はローレベルであると判定されれば、割り込みが発生したしたものと判定されてしまう。このように、従来の方式では、ノイズの影響の大きい環境において、本来割り込みが発生していない状況であっても、割り込みが発生したものと判定されるおそれがある。 However, in the examples of FIGS. 13 and 14, if it happens that noise occurs during sampling and the voltage level is determined to be high level or low level three times in a row, it is determined that an interrupt has occurred. It ends up. As described above, in the conventional method, in an environment where the influence of noise is large, it may be determined that an interrupt has occurred even in a situation where an interrupt has not originally occurred.
その他の課題と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。 Other challenges and novel features will become apparent from the description and accompanying drawings herein.
本明細書には、複数の実施の形態のデジタルフィルタが記載されているが、一実施の形態のデジタルフィルタを述べると、次の通りである。デジタルフィルタは、入力端子の端子電圧のサンプリングにおいて、電圧レベルごとに端子電圧のサンプリング回数をカウントするサンプリングカウンタと、電圧レベルごとの前記サンプリング回数を用いて端子電圧の統計処理を行う統計処理部と、統計処理結果を用いて入力信号の検出を行い、入力信号を検出すると入力検出信号を出力する判定処理部と、を備えている。 Although the digital filters of a plurality of embodiments are described in the present specification, the digital filters of one embodiment are described as follows. The digital filter includes a sampling counter that counts the number of times the terminal voltage is sampled for each voltage level in sampling the terminal voltage of the input terminal, and a statistical processing unit that performs statistical processing of the terminal voltage using the number of times of sampling for each voltage level. It is provided with a determination processing unit that detects an input signal using the statistical processing result and outputs an input detection signal when the input signal is detected.
一実施の形態によれば、ノイズが発生する状況においても端子電圧の電圧レベルを正確に判定することが可能となる。 According to one embodiment, it is possible to accurately determine the voltage level of the terminal voltage even in a situation where noise is generated.
以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、実施の形態を説明するためのすべての図において、同一部分には原則として同一の符号を付し、その繰り返しの説明は省略する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In addition, in all the figures for demonstrating the embodiment, in principle, the same reference numerals are given to the same parts, and the repeated description thereof will be omitted.
(実施の形態1)
本実施の形態に係るデジタルフィルタは、入力端子の端子電圧のサンプリングを行い、電圧レベルごとにサンプリング回数をカウントし、電圧レベルごとのサンプリング回数を用いて統計処理を行い、統計処理結果を用いて入力信号の検出を行う。図1は、本発明の実施の形態1に係るデジタルフィルタの一例を示す回路図である。図1に示すように、デジタルフィルタ1は、サンプリング回路11、サンプリングカウンタ10、統計処理部20、判定処理部30、判定条件設定レジスタ40等を備えている。
(Embodiment 1)
The digital filter according to the present embodiment samples the terminal voltage of the input terminal, counts the number of samplings for each voltage level, performs statistical processing using the number of samplings for each voltage level, and uses the statistical processing result. Detects the input signal. FIG. 1 is a circuit diagram showing an example of a digital filter according to the first embodiment of the present invention. As shown in FIG. 1, the
<サンプリング回路>
サンプリング回路11は、入力端子P1の端子電圧のサンプリングを行う回路である。サンプリング回路11の入力側は、入力端子P1と接続されている。サンプリング回路11の出力側は、後述するサンプリングカウンタ10の第1加算器13aの入力側、インバータ17の入力側と接続されている。
<Sampling circuit>
The
サンプリング回路11には、外部からサンプリングのタイミングを規定するサンプリングクロックが入力される。サンプリング回路11は、サンプリングクロックに従い、入力端子P1の端子電圧をサンプリングし、端子電圧の電圧レベルに応じたサンプリングデータを出力する。例えば、ハイレベルの端子電圧をサンプリングしたとき、サンプリング回路11は、ハイレベルのサンプリングデータを出力する。また、ローレベルの端子電圧をサンプリングしたとき、サンプリング回路11は、ローレベルのサンプリングデータを出力する。ただし、サンプリングデータの電圧レベルは、これに限定されるものではない。
A sampling clock that defines the sampling timing is input to the
<サンプリングカウンタ>
サンプリングカウンタ10は、入力端子P1の端子電圧のサンプリングに際し、電圧レベルごとにサンプリング回数をカウントする機能ブロックである。サンプリングカウンタ10は、第1加算器13a、第2加算器13b、第1サンプリング回数レジスタ15a、第2サンプリング回数レジスタ15b、インバータ17を備えている。
<Sampling counter>
The
第1加算器13aの出力側は、第1サンプリング回数レジスタ15aの入力側と接続されている。第1サンプリング回数レジスタ15aの出力側は、第1加算器13aの入力側及び統計処理部20と接続されている。第2加算器13bの出力側は、第2サンプリング回数レジスタ15bの入力側と接続されている。第2サンプリング回数レジスタ15bの出力側は、第2加算器13bの入力側及び統計処理部20と接続されている。第2加算器13bの入力側は、インバータ17の出力側とも接続されている。インバータ17は、論理反転させたサンプリングデータを生成する回路である。
The output side of the
第1加算器13aは、例えば、サンプリングデータを用いてハイレベルの端子電圧のサンプリング回数(以下、αと表記する場合がある)をカウントする回路であり、第2加算器13bは、論理反転されたサンプリングデータを用いてローレベルの端子電圧のサンプリング回数(以下、βと表記する場合がある)をカウントする回路である。第1サンプリング回数レジスタ15aは、第1加算器13aでカウントされたハイレベルのサンプリング回数(α)を格納する記憶装置であり、第2サンプリング回数レジスタ15bは、第2加算器13bでカウントされたローレベルのサンプリング回数(β)を格納する記憶回路である。
The
<統計処理部>
統計処理部20は、サンプリングカウンタ10でカウントされた、電圧レベルごとのサンプリング回数を用いて端子電圧の統計処理を行う機能ブロックである。図1に示すように、統計処理部20は、μ値演算回路21及びσ値演算回路23を備えている。μ値演算回路21は、所定期間における端子電圧の電圧レベルの期待値(μ値)を算出する回路である。σ値演算回路23は、所定期間における端子電圧の電圧レベルの標準偏差(σ値)を算出する回路である。このように、統計処理部20は、統計処理結果として、端子電圧の電圧レベルの期待値及び標準偏差を算出する。統計処理部20は、例えば統計処理結果として算出した期待値μ及び標準偏差σを用いたベイズ統計により統計処理を行う。また、統計処理部20は、ベイズ統計以外の統計を用いて統計処理を行ってもよい。
<Statistical processing unit>
The
μ値演算回路21の入力側は、第1サンプリング回数レジスタ15aの出力側及び第2サンプリング回数レジスタ15bの出力側と接続されている。μ値演算回路21の出力側は、後述する判定処理部30のμ値判定回路31の入力側と接続されている。σ値演算回路23の入力側は、第1サンプリング回数レジスタ15aの出力側及び第2サンプリング回数レジスタ15bの出力側と接続されている。σ値演算回路23の出力側は、判定処理部30のσ値判定回路33の入力側と接続されている。
The input side of the μ
<判定条件設定レジスタ>
判定条件設定レジスタ40は、入力信号の検出に関する判定条件を格納する記憶装置である。図1に示すように、判定条件設定レジスタ40は、入力検出レベル設定レジスタ41、第1閾値設定レジスタ43、第2閾値設定レジスタ45を備えている。入力検出レベル設定レジスタ41及び第1閾値設定レジスタ43の出力側は、後述するμ値判定回路31の入力側と接続されている。第2閾値設定レジスタ45の出力側は、後述するσ値判定回路33の入力側と接続されている。
<Judgment condition setting register>
The determination
入力検出レベル設定レジスタ41は、入力信号の電圧レベルを示す入力検出レベルを格納するレジスタである。図1では、入力検出レベルの設定値は、「a」と表記されている。例えば、a=1に設定されていれば、入力検出レベルはハイレベルであり、a=0に設定されていれば、入力検出レベルはローレベルである。入力検出レベル設定レジスタ41は、設定値をμ値判定回路31へ出力する。
The input detection
第1閾値設定レジスタ43は、端子電圧の真の電圧レベルの判定に用いられる第1閾値を格納するレジスタである。第1閾値は、入力信号の検出を行う際に参照される検知期待値である。図1では、第1閾値は、「b」と表記されている。第1閾値bは、例えば、入力検出レベルがハイレベルの場合に対応した値が設定されてもよいし、ローレベルに対応した値が設定されてもよい。また、第1閾値bは、入力検出レベルを切り換える際に、再設定されてもよい。第1閾値設定レジスタ43は、第1閾値をμ値判定回路31へ出力する。
The first threshold
第2閾値設定レジスタ45は、端子電圧の電圧レベルのばらつきの判定に用いられる第2閾値を格納するレジスタである。第2閾値は、入力信号の検出を行う際に参照される検出誤差である。図1では、第2閾値は、「c」と表記されている。第2閾値設定レジスタ45は、第2閾値をσ値判定回路33へ出力する。
The second threshold
これらの判定条件(入力検出レベルの設定値a、第1閾値b、第2閾値c)は、例えば、判定条件設定レジスタ40へアクセス可能な外部装置から設定される。
These determination conditions (input detection level setting value a, first threshold value b, second threshold value c) are set, for example, from an external device that can access the determination
<判定処理部>
判定処理部30は、統計処理結果と判定条件設定レジスタ40に格納された判定条件を用いて入力信号の検出を行う機能ブロックである。また、判定処理部30は、入力信号を検出すると入力検出信号を出力する。図1に示すように、判定処理部30は、μ値判定回路31、σ値判定回路33、入力判定回路35、入力判定結果レジスタ37、入力検出信号発生回路39を備えている。
<Judgment processing unit>
The
μ値判定回路31の入力側は、μ値演算回路21の出力側、入力検出レベル設定レジスタ41の出力側、及び第1閾値設定レジスタ43の出力側と接続されている。μ値判定回路31の出力側は、入力判定回路35の入力側と接続されている。μ値判定回路31は、端子電圧の電圧レベルの期待値と、第1閾値設定レジスタ43から出力される第1閾値とを比較し、判定結果を第1判定信号として入力判定回路35へ出力する。
The input side of the μ
例えば、入力検出レベルがハイレベルに設定され、端子電圧の電圧レベルの期待値(μ)が第1閾値より大きい場合、μ値判定回路31は、端子電圧の真の電圧レベルが入力検知レベルであると判定し、ハイレベルの第1判定信号を出力する。具体的には、入力検出レベル設定レジスタ41の設定値がハイレベル(a=1)に設定され、検知期待値がb=95に設定されているとする。そして、サンプリングにより、ハイレベルが95%より高い割合で検出されると、μ値判定回路31は、端子電圧の真の電圧レベルがハイレベル(入力検出レベル)であると判定する。そして、μ値判定回路31は、ハイレベルの第1判定信号を出力する。
For example, when the input detection level is set to a high level and the expected value (μ) of the voltage level of the terminal voltage is larger than the first threshold value, the μ
また、例えば、入力検出レベルがローレベルに設定され、端子電圧の電圧レベルの期待値(μ)が第1閾値より小さい場合、μ値判定回路31は、端子電圧の真の電圧レベルが入力検知レベルであると判定し、ハイレベルの第1判定信号を出力する。具体的には、入力検出レベル設定レジスタ41の設定値がローレベル(a=0)に設定され、検知期待値がb=95に設定されているとする。そして、サンプリングにより、ローレベルが95%より高い割合で検出されると、μ値判定回路31は、端子電圧の真の電圧レベルがローレベル(入力検出レベル)であると判定する。そして、μ値判定回路31は、ハイレベルの第1判定信号を出力する。
Further, for example, when the input detection level is set to a low level and the expected value (μ) of the voltage level of the terminal voltage is smaller than the first threshold value, the μ
σ値判定回路33の入力側は、σ値演算回路23の出力側、及び第2閾値設定レジスタ45の出力側と接続されている。σ値判定回路33の出力側は、入力判定回路35の入力側と接続されている。σ値判定回路33は、端子電圧の電圧レベルの標準偏差と、第2閾値設定レジスタ45から出力される第2閾値とを比較し、端子電圧の電圧レベルの検出誤差を判定し、判定結果を第2判定信号として入力判定回路35へ出力する回路である。
The input side of the σ
例えば、端子電圧の電圧レベルの標準偏差が第2閾値未満である場合、σ値判定回路33は、端子電圧の電圧レベルの検出誤差は小さいと判定し、ハイレベルの第2判定信号を出力する。
For example, when the standard deviation of the voltage level of the terminal voltage is less than the second threshold value, the σ
具体的には、検知誤差がc=5に設定されているとする。そして、サンプリングによる端子電圧の電圧レベルの標準偏差(σ)が5%より小さいと、σ値判定回路33は、端子電圧の電圧レベルの検出誤差が小さいと判定する。 言い換えれば、σ値判定回路33は、入力信号の電圧レベルは、ハイレベル又はローレベルで安定していると判定する。そして、σ値判定回路33は、ハイレベルの第2判定信号を出力する。
Specifically, it is assumed that the detection error is set to c = 5. Then, when the standard deviation (σ) of the voltage level of the terminal voltage by sampling is smaller than 5%, the σ
入力判定回路35は、μ値判定回路31の判定結果、及びσ値判定回路33の判定結果を用いて入力端子P1に入力される入力信号の検出を行う回路である。入力判定回路35は、例えば、図1に示す2入力のAND回路で構成される。入力判定回路35の第1入力端は、μ値判定回路31の出力側と接続されている。入力判定回路35の第2入力端は、σ値判定回路33の出力側と接続されている。入力判定回路の出力端は、入力判定結果レジスタ37の入力側と接続されている。
The
例えば、μ値判定回路31からハイレベルの第1判定信号が入力され、σ値判定回路33からハイレベルの第2判定信号が入力された場合、入力判定回路35は、入力信号を検出したと判定し、ハイレベルの入力判定信号を入力判定結果として出力する。それ以外の場合、入力判定回路35は、ローレベルの入力判定信号を入力判定結果として出力する。
For example, when a high-level first determination signal is input from the μ
入力判定結果レジスタ37は、入力判定回路35から出力される入力判定結果を格納するレジスタである。入力判定結果レジスタ37の出力側は、入力検出信号発生回路39の入力側と接続されている。入力判定結果レジスタ37は、入力判定結果を入力検出信号発生回路39へ出力する。
The input determination result register 37 is a register that stores the input determination result output from the
入力検出信号発生回路39は、入力判定回路35における入力判定結果に応じて、入力検出信号を生成し出力する回路である。入力信号が検出された場合、入力検出信号発生回路39は、例えばハイレベルの信号を入力検出信号として出力する。これに対し、入力信号が検出されていない場合、入力検出信号発生回路39は、例えばローレベルの入力検出信号を出力する。
The input detection
入力検出信号発生回路39の出力側、すなわち、デジタルフィルタ1の出力は、例えば、CPU(Central Processing Unit)等を含むデバイスと接続される。入力端子P1に入力される入力信号が割り込み信号の場合、割り込み信号が検出されると、入力検出信号発生回路39は、例えばハイレベルの割り込み検出信号をデバイスへ出力する。デバイスは、入力される割り込み検出信号に基づき、所定の割り込み処理を行うこととなる。
The output side of the input detection
<ハイレベルの入力信号の検出処理>
次に、本実施の形態における入力信号の検出処理について説明する。図2は、本発明の実施の形態1に係る入力信号の検出処理の一例を示すフロー図である。具体的に述べると、図2は、入力端子P1のハイレベル検知に関わるフローである。図2のフローは、ステップS11〜S19を含む。
<High-level input signal detection processing>
Next, the input signal detection process in the present embodiment will be described. FIG. 2 is a flow chart showing an example of an input signal detection process according to the first embodiment of the present invention. Specifically, FIG. 2 is a flow related to high level detection of the input terminal P1. The flow of FIG. 2 includes steps S11 to S19.
ステップS11では、第1サンプリング回数レジスタ15a、第2サンプリング回数レジスタ15bの初期化が行われる。具体的に述べると、第1サンプリング回数レジスタ15aには、α=1がハイレベルのサンプリング回数の初期値として設定される。同様に、第2サンプリング回数レジスタ15bには、β=1がローレベルのサンプリング回数の初期値として設定される。
In step S11, the first
なお、判定条件設定レジスタ40に含まれる各レジスタの値(判定条件)a、b、cは、ステップS11に先立って設定されてもよいし、サンプリング回数α、βと併せて設定されてもよい。入力信号をハイレベルとすれば、例えば入力検出レベルの設定値は、a=1に設定される。また、第1閾値b、第2閾値cの値は、所望の判定精度に応じて設定される。なお、判定条件設定レジスタ40に含まれる各レジスタの値a、b、cの設定は、CPUを含むデバイスや、外部装置から行われる。
The values (determination conditions) a, b, and c of each register included in the determination
なお、第1サンプリング回数レジスタ15aのサンプリング回数α、及び第2サンプリング回数レジスタ15bに格納されるサンプリング回数βは、所定の期間ごとに初期化される。
The sampling number α of the first
ステップS12では、第1サンプリング回数レジスタ15a、第2サンプリング回数レジスタ15bの初期値を用いた期待値の初期値及び標準偏差の初期値が算出される。信号レベルの期待値μ及び標準偏差σは、α、βを用いて次の式(1)、(2)により算出される。したがって、期待値の初期値μ0=1/2、標準偏差の初期値σ0=(1/12)1/2と算出される。
In step S12, the initial value of the expected value and the initial value of the standard deviation using the initial values of the first
μ=α/(α+β) ・・・(1)
σ=[αβ/((α+β)2(α+β+1))]1/2 ・・・(2)
ステップS13において、入力端子P1の端子電圧のサンプリングが行われる。サンプリング回路11には、ハイレベルとローレベルとを周期的に繰り返す所定のサンプリングクロックが入力される。サンプリング回路11は、例えば、サンプリングクロックの立ち上がりのタイミングで入力端子P1の端子電圧をサンプリングする。サンプリング回路11は、サンプリングした端子電圧の信号レベルに応じた所定のサンプリングデータをサンプリングカウンタ10へ出力する。なお、以下では、説明を容易にするため、ハイレベルの端子電圧は、ハイレベルのサンプリングデータに対応し、ローレベルの端子電圧は、ローレベルのサンプリングデータに対応するものとする。
μ = α / (α + β) ・ ・ ・ (1)
σ = [αβ / ((α + β) 2 (α + β + 1))] 1/2 ... (2)
In step S13, the terminal voltage of the input terminal P1 is sampled. A predetermined sampling clock that periodically repeats high level and low level is input to the
ステップS14では、サンプリングされた端子電圧の信号レベルが判定される。サンプリングされた端子電圧がハイレベルであると判定された場合、ステップS15の処理が実行される。この場合、例えば、第1加算器13aには、ハイレベルのサンプリングデータが入力され、第2加算器13bには、論理反転されたローレベルのサンプリングデータが入力される。
In step S14, the signal level of the sampled terminal voltage is determined. If it is determined that the sampled terminal voltage is at a high level, the process of step S15 is executed. In this case, for example, high-level sampling data is input to the
ステップS15において、ハイレベルのサンプリングデータが入力されると、第1加算器13aは、ハイレベルの端子電圧のサンプリング回数を更新する。具体的に述べると、第1加算器13aは、直前のサンプリング回数αに対し1を加算し、サンプリング回数をαからα+1に更新する。一方、論理反転されたローレベルのサンプリングデータが入力された第2加算器13bは、ローレベルの端子電圧のサンプリング回数を更新しない。すなわち、第2加算器13bは、直前のサンプリング回数βに対する加算を行わず、サンプリング回数はβのままである。
When the high level sampling data is input in step S15, the
第1加算器13aは、更新されたサンプリング回数(α+1)を第1サンプリング回数レジスタ15aへ出力する。更新されたサンプリング回数(α+1)は、第1サンプリング回数レジスタ15aに格納される。一方、第2加算器13bは、更新されなかったサンプリング回数(β)を、引き続き、第2サンプリング回数レジスタ15bへ出力する。
The
これに対し、ステップS14において、サンプリングされた端子電圧がローレベルであると判定された場合、ステップS16の処理が実行される。この場合、例えば、第1加算器13aには、ローレベルのサンプリングデータが入力され、第2加算器13bには、論理反転されたハイレベルのサンプリングデータが入力される。
On the other hand, if it is determined in step S14 that the sampled terminal voltage is at a low level, the process of step S16 is executed. In this case, for example, low-level sampling data is input to the
ステップS16において、ローレベルのサンプリングデータが入力された第1加算器13aは、ハイレベルの端子電圧のサンプリング回数を更新しない。すなわち、第1加算器13aは、直前のサンプリング回数αに対する加算を行わず、サンプリング回数はαのままである。一方、論理反転されたハイレベルのサンプリングデータが入力された第2加算器13bは、ローレベルの端子電圧のサンプリング回数を更新する。具体的に述べると、第2加算器13bは、直前のサンプリング回数βに対し1を加算し、サンプリング回数をβからβ+1に更新する。
In step S16, the
第1加算器13aは、更新されなかったサンプリング回数(α)を、引き続き、第1サンプリング回数レジスタ15aへ出力する。一方、第2加算器13bは、更新されたサンプリング回数(β+1)を第2サンプリング回数レジスタ15bへ出力する。更新されたサンプリング回数(β+1)は、第2サンプリング回数レジスタ15bに格納される。
The
ステップS15、S16に続いて、ステップS17の処理が行われる。ステップS17では、電圧レベルごとのサンプリング回数(α、β)を用いて端子電圧の期待値及び標準偏差が算出される。μ値演算回路21は、第1サンプリング回数レジスタ15aから出力されたハイレベルのサンプリング回数(α)、第2サンプリング回数レジスタ15bから出力されたローレベルのサンプリング回数(β)及び式(1)を用いて、入力端子P1の端子電圧の期待値μを算出する。算出された期待値μは、μ値判定回路31へ出力される。
Following steps S15 and S16, the process of step S17 is performed. In step S17, the expected value and standard deviation of the terminal voltage are calculated using the number of samplings (α, β) for each voltage level. The μ-
また、σ値演算回路23は、第1サンプリング回数レジスタ15aに格納されたハイレベルのサンプリング回数(α)、第2サンプリング回数レジスタ15bに格納されたローレベルのサンプリング回数(β)及び式(2)を用いて、入力端子P1の端子電圧の標準偏差σを算出する。算出された標準偏差σは、σ値判定回路33へ出力される。
Further, the σ
ステップS18では、ステップS17で算出された期待値μ、標準偏差σを用いた入力信号の検出が行われる。μ値判定回路31は、入力検出レベル設定レジスタ41から出力される入力検出レベルの設定値a、第1閾値設定レジスタ43から出力される検知期待値(第1閾値)b、μ値演算回路21から出力される期待値μを用いて入力信号の検出を行う。具体的に述べると、入力検出レベルの設定値aがハイレベルに対応する値(a=1)に設定されている場合、期待値μが検知期待値bより大きければ(μ>b)、μ値判定回路31は、端子電圧の真の電圧レベルがハイレベルであると判定する。そして、μ値判定回路31は、ハイレベルの第1判定信号を出力する。一方、期待値μが検知期待値b以下であれば(μ≦b)、μ値判定回路31は、端子電圧の真の電圧レベルがハイレベルではない、すなわちローレベルであると判定する。そして、μ値判定回路31は、ローレベルの第1判定信号を出力する。
In step S18, the input signal is detected using the expected value μ and the standard deviation σ calculated in step S17. The μ
σ値判定回路33は、第2閾値設定レジスタ45から出力される検知誤差(第2閾値)c、σ値演算回路23から出力される標準偏差σを用いて入力信号の検出を行う。具体的に述べると、標準偏差σが検知誤差c未満であれば(σ<c)、σ値判定回路33は、端子電圧の電圧レベルの検出誤差は小さく、すなわち端子電圧のばらつきがほとんどなく、端子電圧は安定していると判定する。そして、σ値判定回路33は、ハイレベルの第2判定信号を出力する。一方、標準偏差σが検知誤差c以上であれば(σ≧c)、σ値判定回路33は、端子電圧の電圧レベルの検出誤差が大きく、すなわち端子電圧のばらつきが大きく、端子電圧は安定していないと判定する。そして、σ値判定回路33は、ローレベルの第2判定信号を出力する。
The σ
入力判定回路35は、μ値判定回路31から出力される第1判定信号及びσ値判定回路33から出力される第2判定信号を用いて入力信号の検出を行う。具体的に述べると、入力判定回路35は、ハイレベルの第1判定信号及びハイレベルの第2判定信号が入力されたとき入力信号を検出したと判定する(Yes)。すなわち、入力判定回路35は、端子電圧の真の電圧レベルが入力検出レベル(ここではハイレベル)であり、かつ、標準偏差σが検知誤差c未満であると判定したとき(Yes)、入力信号を検出したと判定する。そして、入力判定回路35は、例えばハイレベルの入力判定信号を出力する。入力判定結果レジスタ37は、入力判定信号に応じた入力判定結果(例えばハイレベル)を格納し、入力検出信号発生回路39へ出力する。ハイレベルの検出条件は、式(3)で表される。
The
μ>b、かつ、σ<c ・・・(3)
ステップS19では、所定の入力検出信号が生成、出力される。具体的に述べると、入力検出信号発生回路39は、入力判定結果レジスタ37から出力されるハイレベルの入力判定結果に応じて、入力検出レベル(ハイレベル)の入力信号が検出されたものとして、例えばハイレベルの入力検出信号を生成し出力する。その後、入力信号の検出処理が終了する。
μ> b and σ <c ... (3)
In step S19, a predetermined input detection signal is generated and output. Specifically, the input detection
なお、入力検出信号発生回路39から出力される入力検出信号は、制御回路等に入力される。例えば、入力信号が割り込み信号である場合、入力検出信号は割り込み検出信号である。割り込み信号が検出されると、割り込み検出信号が制御回路等に入力され、割り込み信号に応じた所定の処理が実行される。
The input detection signal output from the input detection
一方、ステップS18において、式(3)を満たさない場合(No)、入力判定回路35は、ハイレベルの入力信号は検出されていないと判定し、例えばローレベルの入力判定信号を出力する。入力判定結果レジスタ37は、入力判定信号に応じた入力判定結果(例えばローレベル)を格納し、入力検出信号発生回路39へ出力する。入力検出信号発生回路39は、入力判定結果レジスタ37から出力されるローレベルの入力判定結果に応じて、例えばローレベルの信号を生成し出力する。そして、ステップS13に戻り、ステップS13〜S18の処理が再び実行される。
On the other hand, in step S18, if the equation (3) is not satisfied (No), the
<<ハイレベルの入力信号検出の具体例>>
図3は、ハイレベルの入力信号を検出する際の確率密度分布の変化を例示する図である。具体的に述べると、図3は、初期状態から4回連続でハイレベルの信号がサンプリングされた場合の確率密度分布の変化を示している。図3の横軸は、入力信号の信号レベルがハイレベルである期待値を示し、図3の縦軸は確率密度分布を示している。図3(a)は、初期状態、すなわち図2のステップS11直後の状態を示している。初期状態の確率密度分布は、入力端子の端子電圧の電圧レベルがハイレベルであるかローレベルであるか不明であり、各期待値に対する確率密度分布が一定となっている。初期状態における期待値μは1/2であり、横軸の中央に位置する。この場合、入力信号の電圧レベルがハイレベルである確率は、50%である。
<< Specific example of high-level input signal detection >>
FIG. 3 is a diagram illustrating a change in the probability density distribution when detecting a high-level input signal. Specifically, FIG. 3 shows the change in the probability density distribution when a high-level signal is sampled four times in a row from the initial state. The horizontal axis of FIG. 3 shows the expected value at which the signal level of the input signal is high, and the vertical axis of FIG. 3 shows the probability density distribution. FIG. 3A shows an initial state, that is, a state immediately after step S11 in FIG. Regarding the probability density distribution in the initial state, it is unknown whether the voltage level of the terminal voltage of the input terminal is high level or low level, and the probability density distribution for each expected value is constant. The expected value μ in the initial state is 1/2, and is located in the center of the horizontal axis. In this case, the probability that the voltage level of the input signal is high is 50%.
次に、1回目にハイレベルがサンプリングされると、図3(b)に示すように、確率密度分布は、50%から右側(「1」側)に少し偏った分布となる。確率密度分布のピーク付近が期待値である。したがって、この場合の期待値は、50%からやや大きい値となる。一方、確率密度分布の標準偏差は、初期状態よりもやや小さい値となる。 Next, when the high level is sampled for the first time, as shown in FIG. 3 (b), the probability density distribution becomes a distribution slightly biased from 50% to the right side (“1” side). The expected value is near the peak of the probability density distribution. Therefore, the expected value in this case is a value slightly larger than 50%. On the other hand, the standard deviation of the probability density distribution is slightly smaller than the initial state.
そして、2回目もハイレベルがサンプリングされると、図3(c)に示すように、確率密度分布は、図3(b)よりもさらに右側に偏った分布となる。期待値は、図3(b)の状態よりも大きくなり、標準偏差は、図3(b)の状態よりもさらに小さい値となる。3回目、4回目も続けてハイレベルがサンプリングされると、図3(d)、(e)に示すように、確率密度分布はさらに右側に偏った分布となる。期待値は、図3(d)、(e)へシフトするにつれて大きくなり、横軸の「1」、すなわち100%に近くなる。また、標準偏差は、図3(d)、(e)へシフトするにつれて小さい値となる。 Then, when the high level is sampled the second time, the probability density distribution becomes a distribution biased to the right side of FIG. 3 (b) as shown in FIG. 3 (c). The expected value is larger than the state of FIG. 3 (b), and the standard deviation is even smaller than the state of FIG. 3 (b). When the high level is sampled continuously for the third and fourth times, the probability density distribution becomes a distribution biased to the right side as shown in FIGS. 3 (d) and 3 (e). The expected value increases as it shifts to FIGS. 3 (d) and 3 (e), and becomes close to "1" on the horizontal axis, that is, 100%. Further, the standard deviation becomes smaller as it shifts to FIGS. 3 (d) and 3 (e).
一方、ローレベルがサンプリングされると、確率密度分布は、左側(「0」側)に少しシフトする。このように、サンプリングごとに、確率密度分布のピークは、右側又は左側へシフトする。そして、式(3)の条件を満たすと、ハイレベルの入力信号の検出処理が完了し、例えば割り込みが発生することとなる。 On the other hand, when the low level is sampled, the probability density distribution shifts slightly to the left (“0” side). Thus, with each sampling, the peak of the probability density distribution shifts to the right or left. Then, when the condition of the equation (3) is satisfied, the high-level input signal detection process is completed, and an interrupt is generated, for example.
<ローレベルの入力信号の検出処理>
次に、ローレベルの入力信号の検出処理について説明する。図4は、本発明の実施の形態1に係る入力信号の検出処理の一例を示すフロー図である。図4は、入力端子P1のローレベル検知に関わるフローである。図4のフローは、ステップS11〜S17、S28〜S29を含む。ステップS11〜S17の処理は、図2で説明したハイレベル検知と同様であるので、説明は省略する。
<Low-level input signal detection processing>
Next, the low-level input signal detection process will be described. FIG. 4 is a flow chart showing an example of an input signal detection process according to the first embodiment of the present invention. FIG. 4 is a flow related to low level detection of the input terminal P1. The flow of FIG. 4 includes steps S11 to S17 and S28 to S29. Since the processing of steps S11 to S17 is the same as the high level detection described with reference to FIG. 2, the description thereof will be omitted.
ステップS28では、ステップS18とは異なる条件で入力信号の検出が行われる。具体的に述べると、入力検出レベルの設定値aがローレベルに対応する値(a=0)に設定されている場合、期待値μが検知期待値bに対する所定の値(1−b)より小さければ(μ<1−b)、μ値判定回路31は、端子電圧の真の電圧レベルがローレベルであると判定する。ここで示す値μがハイレベルの入力信号に対応する値であるため、ローレベル検知における期待値μの比較対象が値(1−b)となっている。ただし、ローレベルに対応する検知期待値が、別途設定されてもよい。
In step S28, the input signal is detected under conditions different from those in step S18. Specifically, when the input detection level setting value a is set to a value (a = 0) corresponding to the low level, the expected value μ is more than a predetermined value (1-b) with respect to the detection expected value b. If it is small (μ <1-b), the μ
そして、μ値判定回路31は、ハイレベルの第1判定信号を出力する。一方、期待値μが検知期待値1−b以上であれば(μ≧1−b)、μ値判定回路31は、端子電圧の真の電圧レベルがローレベルではない、すなわちハイレベルであると判定する。そして、μ値判定回路31は、ローレベルの第1判定信号を出力する。
Then, the μ
σ値判定回路33の動作は、ステップS18と同様である。標準偏差σが検知誤差c未満であれば(σ<c)、σ値判定回路33は、ハイレベルの第2判定信号を出力する。一方、標準偏差σが検知誤差c以上であれば(σ≧c)、σ値判定回路33は、ローレベルの第2判定信号を出力する。
The operation of the σ
入力判定回路35は、端子電圧の真の電圧レベルがローレベルであり、かつ、標準偏差σが検知誤差c未満であると判定したとき(Yes)、入力信号を検出したと判定する。そして、入力判定回路35は、例えばハイレベルの入力判定信号を出力する。入力判定結果レジスタ37は、入力判定信号に応じた入力判定結果(例えばハイレベル)を格納し、入力検出信号発生回路39へ出力する。ローレベルの検出条件は、式(4)で表される。
When the
μ<1−b、かつ、σ<c ・・・(4)
ステップS29では、入力検出信号発生回路39は、入力判定結果レジスタ37から出力されるハイレベルの入力判定結果に応じて、ローレベルの入力信号が検出されたものとして、例えばハイレベルの入力検出信号を生成し出力する。その後、入力信号の検出処理が終了する。
μ <1-b and σ <c ... (4)
In step S29, the input detection
一方、ステップS28において、式(4)を満たさない場合(No)、入力判定回路35は、ローレベルの入力信号は検出されていないと判定し、例えばローレベルの入力判定信号を出力する。そして、ステップS13に戻り、ステップS13〜S28の処理が再び実行される。
On the other hand, in step S28, if the equation (4) is not satisfied (No), the
<<ローレベルの入力信号検出の具体例>>
図5は、ローレベルの入力信号を検出する際の確率密度分布の変化を例示する図である。図5は、初期状態から4回連続でローレベルの信号がサンプリングされた場合の確率密度分布の変化を示している。図5に示す各状態における確率密度分布は、ハイレベルの入力信号の検出に係る図3の対応する各状態における確率密度分布と対称になっている。
<< Specific example of low-level input signal detection >>
FIG. 5 is a diagram illustrating a change in the probability density distribution when detecting a low-level input signal. FIG. 5 shows the change in the probability density distribution when a low-level signal is sampled four times in a row from the initial state. The probability density distribution in each state shown in FIG. 5 is symmetrical with the probability density distribution in each corresponding state of FIG. 3 related to the detection of a high-level input signal.
図5(a)は、初期状態、すなわち図4のステップS11直後の状態を示している。初期状態の確率密度分布は、図3(a)と同様である。次に、1回目にローレベルがサンプリングされると、図5(b)に示すように、確率密度分布は、50%から左側(「0」側)に少し偏った分布となる。確率密度分布のピーク付近が期待値である。したがって、この場合の期待値は、50%からやや小さい値となる。一方、確率密度分布の標準偏差は、初期状態よりもやや小さい値となる。 FIG. 5A shows an initial state, that is, a state immediately after step S11 in FIG. The probability density distribution in the initial state is the same as in FIG. 3A. Next, when the low level is sampled for the first time, the probability density distribution becomes slightly biased from 50% to the left side (“0” side) as shown in FIG. 5 (b). The expected value is near the peak of the probability density distribution. Therefore, the expected value in this case is a value slightly smaller than 50%. On the other hand, the standard deviation of the probability density distribution is slightly smaller than the initial state.
そして、2〜4回目もローレベルがサンプリングされると、図5(c)から図5(e)の順に、確率密度分布は、さらに左側に偏った分布となる。また、標準偏差は、図5(c)から図5(e)の順に、小さい値となる。 Then, when the low level is sampled 2 to 4 times, the probability density distribution is further biased to the left in the order of FIGS. 5 (c) to 5 (e). Further, the standard deviation becomes smaller in the order of FIGS. 5 (c) to 5 (e).
一方、ハイレベルがサンプリングされると、確率密度分布は、左側(「1」側)に少しシフトする。このように、サンプリングごとに、確率密度分布のピークは、右側又は左側へシフトする。そして、式(4)の条件を満たすと、ローレベルの入力信号の検出処理が完了し、例えば割り込みが発生することとなる。 On the other hand, when the high level is sampled, the probability density distribution shifts slightly to the left (“1” side). Thus, with each sampling, the peak of the probability density distribution shifts to the right or left. Then, when the condition of the equation (4) is satisfied, the low-level input signal detection process is completed, and an interrupt is generated, for example.
<本実施の形態による主な効果>
本実施の形態によれば、電圧レベルごとのサンプリング回数を用いて入力端子P1の端子電圧の統計処理が行われる。この構成によれば、複数回のサンプリングにより端子電圧の信号レベルの判定が行われるので、ノイズが発生する状況においても端子電圧の電圧レベルを正確に判定することが可能となる。これにより、入力端子P1に入力される入力信号を正確に検出することが可能となる。また、これにより、割り込み信号が入力信号として規定されている場合、割り込み信号の検出が正確に行われ、半導体装置の動作を安定させることが可能となる。
<Main effects of this embodiment>
According to this embodiment, statistical processing of the terminal voltage of the input terminal P1 is performed using the number of samplings for each voltage level. According to this configuration, since the signal level of the terminal voltage is determined by sampling a plurality of times, it is possible to accurately determine the voltage level of the terminal voltage even in a situation where noise is generated. This makes it possible to accurately detect the input signal input to the input terminal P1. Further, as a result, when the interrupt signal is defined as an input signal, the interrupt signal is accurately detected, and the operation of the semiconductor device can be stabilized.
また、本実施の形態によれば、統計処理部は、算出した期待値及び標準偏差を用いたベイズ統計により統計処理を行う。この構成によれば、入力端子P1の端子電圧の電圧レベルの期待値が所定の条件を満たしても、電圧レベルのばらつき(標準偏差)が所定の条件を満たさない場合には、入力信号を検出したと判定されないので、入力信号の検出が確実に行われる。 Further, according to the present embodiment, the statistical processing unit performs statistical processing by Bayesian statistics using the calculated expected value and standard deviation. According to this configuration, even if the expected value of the voltage level of the terminal voltage of the input terminal P1 satisfies the predetermined condition, the input signal is detected when the variation (standard deviation) of the voltage level does not satisfy the predetermined condition. Since it is not determined that the input signal has been detected, the input signal is reliably detected.
(実施の形態2)
次に、実施の形態2について説明する。すでに述べた実施の形態1では、判定条件設定レジスタ40に格納される判定条件(例えば、検知期待値b、検知誤差c)が、ユーザにより任意の値に設定される。すなわち、実施の形態1のデジタルフィルタには、判定条件をシステム環境に最適な値に設定できるという自由度があった。しかし、初心者がデジタルフィルタや半導体装置(例えばマイコン等)を含むシステムを扱う場合や、検出対象の信号が受けるノイズの影響がはっきりしない状況においては、ユーザ側で検知期待値や検知誤差等の判定条件を決められない場合もあり得る。そこで、本実施の形態では、検知期待値や検知誤差等の判定条件を自動設定することが可能なデジタルフィルタについて説明する。
(Embodiment 2)
Next, the second embodiment will be described. In the first embodiment described above, the determination condition (for example, the expected detection value b and the detection error c) stored in the determination
図6は、本発明の実施の形態2に係るデジタルフィルタの構成の一例を示す回路図である。図6のデジタルフィルタ101は、図1のデジタルフィルタ1に判定条件設定回路140が追加されている。判定条件設定回路140は、判定条件設定レジスタに格納される判定条件を自動設定する機能ブロックである。具体的に述べると、判定条件設定回路140は、第1閾値設定レジスタ43に格納される検知期待値、第2閾値設定レジスタ45に格納される検知誤差を算出し、算出した検知期待値及び検知誤差をそれぞれのレジスタに格納する。
FIG. 6 is a circuit diagram showing an example of the configuration of the digital filter according to the second embodiment of the present invention. In the digital filter 101 of FIG. 6, a determination
判定条件設定回路140は、検知反応時間レジスタ141、演算回路143、145、147、149を備えている。検知反応時間レジスタ141の出力側は、演算回路143の入力側と接続されている。演算回路143の出力側は、演算回路145の入力側と接続されている。演算回路145の出力側は、演算回路147、149のそれぞれの入力側と接続されている。演算回路147の出力側は、第1閾値設定レジスタ43の入力側と接続されている。演算回路149の出力側は、第2閾値設定レジスタ45の入力側と接続されている。
The determination
検知反応時間レジスタ141は、検出対象信号(入力信号)に対する検知反応時間を設定するレジスタである。ユーザは、ハイレベル検知又はローレベル検知において許容できる応答時間を検知反応時間「d」として設定し、検知反応時間レジスタ141に格納する。検知反応時間とは、システム上これ以上反応が遅れるとシステムの動作に問題が生じる時間のことをいう。言い換えると、検知反応時間以内に検出対象信号が検出できれば、システムにおいて許容され、検出された入力信号に基づく処理が実行可能である。
The detection
検知反応時間レジスタ141に格納された検知反応時間dに基づき、演算回路143〜149において検知期待値、検知誤差の設定値が算出される。演算回路143は、入力信号の検知期間「e」を演算する回路である。なお、以下では、検知期間をリフレッシュ期間と呼ぶ場合がある。演算回路145は、検知期間eにおけるサンプリング回数「f」を演算する回路である。演算回路147は、サンプリング回数fを用い、所定の回数連続で同一の電圧レベルがサンプリングされたときの期待値「x」を演算する回路である。演算回路149は、サンプリング回数fを用い、所定の回数連続で同一の電圧レベルがサンプリングされたときの標準偏差「y」を演算する回路である。
Based on the detection reaction time d stored in the detection
図7は、本発明の実施の形態2に係る検知期待値及び検知誤差を自動で設定する方法の一例を示すフロー図である。検知期待値及び検知誤差の自動設定に際し、例えば図7のステップS31〜S35が実行される。 FIG. 7 is a flow chart showing an example of a method of automatically setting the expected detection value and the detection error according to the second embodiment of the present invention. For example, steps S31 to S35 of FIG. 7 are executed when the expected detection value and the detection error are automatically set.
まず、ステップS311において、ユーザは、検知反応時間レジスタ141に、所定の検知反応時間dを設定する。検知反応時間dは、例えば、外部の入力端末等から入力される(S31)。検知反応時間レジスタ141は、設定された検知反応時間dを演算回路143へ出力する。ステップS32において、演算回路143は、例えば、以下に示す式(5)により検知反応時間dを用いてリフレッシュ期間eを演算する。ステップS33において、演算回路145は、ステップS32で算出されたリフレッシュ期間e、及びサンプリング周期Tsから、以下に式(6)を用いてリフレッシュ期間eにおけるサンプリング回数fを演算する。なお、サンプリング周期Tsとは、図13に示すように、サンプリングクロックの立ち上がりごとに入力端子P1の電圧レベルをサンプリングする間隔のことをいう。
First, in step S311 the user sets a predetermined detection reaction time d in the detection
次に、ステップS34について説明する。演算回路147は、サンプリング回数fを用い、以下に式(7)により、f/2回連続で同一の電圧レベルがサンプリングされたときの期待値「x」を演算する。また、これと並行して、演算回路149は、サンプリング回数fを用い、以下に式(8)により、f/2回連続で同一の電圧レベルがサンプリングされたときの標準偏差「y」を演算する。
Next, step S34 will be described. Using the number of samplings f, the
e=d/10 ・・・(5)
f=e/(サンプリング周期) ・・・(6)
x=(f+2)/(f+4) ・・・(7)
y=((4f+8)/(((f+4)^2)(f+6)))^1/2 ・・・(8)
ステップS35では、演算回路147で算出された期待値xは、検知期待値(第1閾値)bとして、第1閾値設定レジスタ43へ格納される。また、演算回路149で算出された標準偏差yは、検知誤差(第2閾値)cとして、第2閾値設定レジスタ45へ格納される。なお、ここで算出される期待値xは、例えば、ハイレベルが連続でサンプリングされた場合の値を示している。なお、ここでは、判定条件として、検知期待値及び検知誤差が自動で設定される場合について説明したが、これ以外の判定条件が自動で設定されてもよい。
e = d / 10 ... (5)
f = e / (sampling cycle) ・ ・ ・ (6)
x = (f + 2) / (f + 4) ... (7)
y = ((4f + 8) / (((f + 4) ^ 2) (f + 6))) ^ 1/2 ... (8)
In step S35, the expected value x calculated by the
なお、本実施の形態に係るデジタルフィルタ101では、例えばf回のサンプリングごとに、第1サンプリング回数レジスタ15aのサンプリング回数α、及び第2サンプリング回数レジスタ15bに格納されるサンプリング回数βが初期化される。これは、ステップS33において算出されるリフレッシュ期間eと、サンプリング回数α、βが初期化される期間とを整合させるためである。ステップS32〜S35は、ハードウェアにより自動的に処理される。すなわち、ステップS31において、ユーザにより検知反応時間dが設定されると、式(5)〜(8)の演算と、x、yの格納が自動的に行われる。
In the digital filter 101 according to the present embodiment, for example, the sampling number α of the first
ユーザは、自動設定された検知期待値b及び検知誤差cを確認し、問題がないと判断すれば、これら設定値を用いた入力信号の検出処理を実行させる。一方、ユーザは、これらの設定値に問題があると判断すれば、検知期待値b及び検知誤差cを手動で再設定し、再設定された値を用いて入力信号の検出処理を実行させる。 The user confirms the automatically set detection expected value b and the detection error c, and if it is determined that there is no problem, causes the user to execute the input signal detection process using these set values. On the other hand, if the user determines that there is a problem with these set values, the expected detection value b and the detection error c are manually reset, and the input signal detection process is executed using the reset values.
本実施の形態によれば、検知期待値b及び検知誤差cを自動で設定することが可能となる。これにより、初心者がデジタルフィルタや半導体装置を含むシステムを扱う場合や、検出対象の信号が受けるノイズの影響がはっきりしない状況においても判定条件の設定が自動で行われる。また、自動設定後においても、ユーザは、検知期待値b及び検知誤差cを手動で設定可能であり、システム環境に適切な値に設定することが可能となる。 According to this embodiment, the expected detection value b and the detection error c can be automatically set. As a result, the determination conditions are automatically set even when a beginner handles a system including a digital filter or a semiconductor device, or when the influence of noise on the signal to be detected is not clear. Further, even after the automatic setting, the user can manually set the expected detection value b and the detection error c, and can set the values appropriate for the system environment.
(実施の形態3)
次に、実施の形態3について説明する。本実施の形態では、入力端子P1の端子電圧の電圧レベルのサンプリング状況に応じて、周波数(サンプリング周期)の異なるサンプリングクロックを切り換えながら入力信号の検出を行うデジタルフィルタについて説明する。
(Embodiment 3)
Next, the third embodiment will be described. In the present embodiment, a digital filter that detects an input signal while switching sampling clocks having different frequencies (sampling cycles) according to the sampling status of the voltage level of the terminal voltage of the input terminal P1 will be described.
図8は、本発明の実施の形態3に係るデジタルフィルタの構成の一例を示す回路図である。図8のデジタルフィルタ201は、図1のデジタルフィルタ1にサンプリングクロック選択回路210が追加されている。サンプリングクロック選択回路210は、入力端子P1の端子電圧の電圧レベルのサンプリング状況に応じて、サンプリングクロックを選択する機能ブロックである。図8に示すように、サンプリングクロック選択回路210は、分周回路211、判定回路213、選択スイッチ215を備えている。
FIG. 8 is a circuit diagram showing an example of the configuration of the digital filter according to the third embodiment of the present invention. In the digital filter 201 of FIG. 8, a sampling
分周回路211の入力側には、基準サンプリングクロックが入力される。分周回路211は、基準サンプリングクロックを分周し、基準サンプリングクロックとは異なる周波数のサンプリングクロックを生成する。また、分周回路211は、それぞれ周波数が異なる複数のサンプリングクロックを生成してもよい。分周回路211の出力側は、選択スイッチ215の入力側と接続されており、生成したサンプリングクロックを選択スイッチ215へ出力する。
A reference sampling clock is input to the input side of the
判定回路213は、入力端子P1の端子電圧の電圧レベルのサンプリング状況を判定する回路である。判定回路213の入力側は、第1閾値設定レジスタ43の出力側と、μ値演算回路21の出力側と接続されている。すなわち、判定回路213には、検知期待値b、及びサンプリングによる入力端子の電圧レベルの期待値μが入力される。判定回路213の出力側は、選択スイッチ215の入力側と接続されている。判定回路213は、検知期待値b及び期待値μを用いて、端子電圧の電圧レベルのサンプリング状況を判定し、判定結果を選択スイッチ215へ出力する。判定回路213における判定処理については、後述する。
The
選択スイッチ215は、サンプリング回路11へ出力するサンプリングクロックを選択する回路である。判定回路213における判定結果に応じてサンプリングクロックを切り換える回路である。選択スイッチ215の入力側には、基準サンプリングクロックと、分周回路211から出力されるサンプリングクロックとが入力される。選択スイッチ215の出力側は、サンプリング回路11と接続されている。選択スイッチ215は、判定回路213における判定結果に応じて、これらのサンプリングクロックからサンプリング回路11へ出力するサンプリングクロックを選択する。
The
<サンプリングクロックの選択>
次に、サンプリングクロックの選択方法について説明する。図9は、サンプリングクロックの切り換え動作を説明する図である。図9には、ハイレベル検知の例が示されている。図9(a)は、サンプリングクロックの切り換えを行わない場合のサンプリング動作を示す図である。具体的には、図9(a)は、実施の形態1〜2のデジタルフィルタ1、101における処理を示している。図9(b)は、サンプリングクロックの切り換えを行う場合のサンプリング動作を示す図である。すなわち、図9(b)は、本実施の形態のデジタルフィルタ201における処理を示している。
<Selection of sampling clock>
Next, a method of selecting a sampling clock will be described. FIG. 9 is a diagram illustrating a sampling clock switching operation. FIG. 9 shows an example of high level detection. FIG. 9A is a diagram showing a sampling operation when the sampling clock is not switched. Specifically, FIG. 9A shows the processing in the
図9の縦軸は、サンプリングした電圧レベルを示し、図9の横軸は、時間を示している。また、図9(a)、(b)に示すそれぞれの矢印は、サンプリングされたタイミングを示している。隣り合う矢印の時間差は、サンプリング周期を示す。 The vertical axis of FIG. 9 shows the sampled voltage level, and the horizontal axis of FIG. 9 shows the time. Further, the respective arrows shown in FIGS. 9A and 9B indicate the sampling timing. The time difference between the adjacent arrows indicates the sampling period.
図9(a)、(b)では、時刻t0でサンプリングが開始されたのち、時刻t1でハイレベルがサンプリングされるまで、ローレベルが連続してサンプリングされている。そして、時刻t1以降は、連続してハイレベルが連続してサンプリングされている。 In FIGS. 9A and 9B, after the sampling is started at time t0, the low level is continuously sampled until the high level is sampled at time t1. Then, after the time t1, the high level is continuously sampled.
図9(a)は、同一のサンプリングクロックを用いてサンプリングされている。すなわち、等間隔のタイミングでサンプリングが行われている。時刻t1以降はハイレベルが検出され、時刻t2において、端子電圧の電圧レベルの期待値及び標準偏差が式(3)の条件を満たし、ハイレベル検知が完了する。 FIG. 9A is sampled using the same sampling clock. That is, sampling is performed at equal intervals. The high level is detected after the time t1, and at the time t2, the expected value and the standard deviation of the voltage level of the terminal voltage satisfy the condition of the equation (3), and the high level detection is completed.
一方、本実施の形態では、図9(b)に示すように、ローレベルが検出されている期間、及び時刻t1においてハイレベルが検出されてからも、ある程度の期間、続けてハイレベルがサンプリングされる時刻t3まで、図9(a)よりも周波数が低いサンプリングクロック(分周されたサンプリングクロック)が用いられる。そして、時刻t3以降は、これまでより周波数が高いサンプリングクロック(基準サンプリングクロック)が選択され、選択されたサンプリングクロックによりサンプリングが行われる。そして、時刻t4において、端子電圧の電圧レベルの期待値及び標準偏差が式(3)の条件を満たし、ハイレベル検知が完了する。すなわち、本実施の形態では、ハイレベルが検出されてからもある程度、ハイレベルの比率が高まるまでは、周波数を抑えたサンプリングクロックによりサンプリングが行われ、ハイレベルが所定の比率まで高まると、周波数を高くしたサンプリングクロックによりサンプリングが行われる。 On the other hand, in the present embodiment, as shown in FIG. 9B, the high level is continuously sampled for a certain period after the low level is detected and the high level is detected at time t1. Until the time t3, a sampling clock (divided sampling clock) having a frequency lower than that in FIG. 9A is used. Then, after time t3, a sampling clock (reference sampling clock) having a higher frequency than before is selected, and sampling is performed by the selected sampling clock. Then, at time t4, the expected value and standard deviation of the voltage level of the terminal voltage satisfy the condition of the equation (3), and the high level detection is completed. That is, in the present embodiment, sampling is performed by a sampling clock that suppresses the frequency until the high level ratio increases to some extent even after the high level is detected, and when the high level increases to a predetermined ratio, the frequency Sampling is performed by a sampling clock with a higher frequency.
判定回路213の動作を具体的に説明する。判定回路213は、第1閾値設定レジスタ43に設定された検知期待値bと、μ値演算回路21において算出された端子電圧の電圧レベルの期待値μとを用い、例えば次に示す式(9)、(10)を用いて、サンプリングクロックの切り換え判定を行う。
The operation of the
μ<(50+b)/2 ・・・(9)
μ≧(50+b)/2 ・・・(10)
例えば、検出期待値bが95%に設定されているとする。ハイレベルの割合が(50+95)/2=72.5%未満のとき、期待値μは式(9)を満たすが、式(10)を満たしていない。これは、図9(b)の時刻t0からt3までの状態を示している。この場合、判定回路213は、期待値μが高まっていないと判定し、判定結果を選択スイッチ215へ出力する。選択スイッチ215は、この判定結果を受けて、サンプリングクロックの切り換えを行わず、例えば分周されたサンプリングクロックを継続して出力する。
μ <(50 + b) / 2 ... (9)
μ ≧ (50 + b) / 2 ・ ・ ・ (10)
For example, it is assumed that the expected detection value b is set to 95%. When the high level ratio is less than (50 + 95) / 2 = 72.5%, the expected value μ satisfies equation (9) but not equation (10). This shows the state from time t0 to t3 in FIG. 9B. In this case, the
一方、ハイレベルの割合が(50+95)/2=72.5%以上のとき、期待値μは、式(10)を満たす。これは、図9(b)の時刻t3以降の状態を示している。この場合、判定回路213は、期待値μが十分高まったと判定し、判定結果を選択スイッチ215へ出力する。選択スイッチ215は、この判定結果を受けて、周波数が高いサンプリングクロック(例えば、基準サンプリングクロック)を選択し、選択したサンプリングクロックをサンプリング回路11へ出力する。そして、サンプリングを高速化して入力信号の検出処理が行われる。
On the other hand, when the high level ratio is (50 + 95) / 2 = 72.5% or more, the expected value μ satisfies the equation (10). This shows the state after the time t3 in FIG. 9B. In this case, the
ここでは、サンプリングクロックの切り換え判定の基準となる判定基準が(50+b)/2のみであったが、判定基準を細分化し、各判定基準に応じたサンプリングクロックが選択されてもよい。 Here, the criterion for switching the sampling clock is only (50 + b) / 2, but the criterion may be subdivided and a sampling clock corresponding to each criterion may be selected.
なお、ローレベル検知では、電圧レベルが反転するだけであり、動作内容はハイレベル検知と同様である。 In low level detection, only the voltage level is inverted, and the operation content is the same as in high level detection.
本実施の形態によれば、入力端子P1の端子電圧の電圧レベルのサンプリング状況に応じて、周波数の異なるサンプリングクロックを切り換える。この構成によれば、入力検出レベルがサンプリングされる割合が高まるまでは、サンプリングクロックの周波数が抑えられるので、入力信号の検出に関わる消費電力が低減される。例えば、分周回路211における分周比が2分周であり、時刻t0から時刻t1までの期間が、時刻t1から入力信号が検出されるまでの期間と比べて十分に長い場合には、入力信号の検出に関わる消費電力は、実施の形態1、2の約2分の1程度にまで抑えられる。
According to this embodiment, sampling clocks having different frequencies are switched according to the sampling status of the voltage level of the terminal voltage of the input terminal P1. According to this configuration, the frequency of the sampling clock is suppressed until the rate at which the input detection level is sampled increases, so that the power consumption related to the detection of the input signal is reduced. For example, when the frequency division ratio in the
また、本実施の形態によれば、分周回路211は、それぞれ周波数が異なる複数のサンプリングクロックを生成し、判定回路213は、期待値μの判定基準を細分化する。この構成によれば、期待値μの値に応じて、サンプリングクロックをこまめに切り換えることが可能となる。これにより、消費電力を抑えつつ、入力信号の検出を短時間で行うことが可能となる。
Further, according to the present embodiment, the
(実施の形態4)
次に、実施の形態4について説明する。実施の形態4では、実施の形態1〜3のようなベイズ統計を用いた統計処理を行うことなく、入力信号の検出を行うデジタルフィルタについて説明する。
(Embodiment 4)
Next, the fourth embodiment will be described. In the fourth embodiment, a digital filter that detects an input signal without performing statistical processing using Bayesian statistics as in the first to third embodiments will be described.
図10は、本発明の実施の形態4に係るデジタルフィルタの構成の一例を示す回路図である。図10のデジタルフィル301は、サンプリング回路11、サンプリングカウンタ310、判定処理部330、判定条件設定レジスタ340等を備えている。
FIG. 10 is a circuit diagram showing an example of the configuration of the digital filter according to the fourth embodiment of the present invention. The digital fill 301 of FIG. 10 includes a
サンプリングカウンタ310は、インバータ17、選択スイッチ319、第3加算器313、第3サンプリング回数レジスタ315を有する。インバータ17の入力側は、サンプリング回路11の出力側と接続されている。選択スイッチ319の入力側は、サンプリング回路11の出力側及びインバータ17の出力側と接続されている。また、選択スイッチ319の入力側は、入力検出レベル設定レジスタ41の出力側と接続されている。
選択スイッチ319の出力側は、第3加算器313の入力側と接続されている。第3加算器313の出力側は、第3サンプリング回数レジスタ315の入力側と接続されている。第3サンプリング回数レジスタ315の出力側は、第3加算器313の入力側及び判定処理部330のz値判定回路331と接続されている。
The
The output side of the selection switch 319 is connected to the input side of the
インバータ17は、論理反転させたサンプリングデータを生成し、選択スイッチ319へ出力する。選択スイッチ319は、サンプリングデータ、及び入力検出レベル設定レジスタ41に設定された入力検出レベルの設定値aに基づく所定の信号を出力する回路である。選択スイッチ319は、例えば、設定値aに対応するサンプリングデータが入力されると、ハイレベルの信号を出力し、設定値aに対応しないサンプリングデータが入力されるとローレベルの信号を出力する。なお、入力検出レベルの設定値aが、ハイレベル及びローレベルのいずれに対応する値であっても、設定値aに対応するサンプリングデータが入力されれば、選択スイッチ319はハイレベルの信号を出力する。
The
第3加算器313は、設定値aに対応する電圧レベルのサンプリング回数(以下、zと表記する場合がある)をカウントする回路である。第3サンプリング回数レジスタ315は、設定値aに対応する電圧レベルのサンプリング回数zを格納するレジスタである。具体的に述べると、第3加算器313は、選択スイッチ319からハイレベルの信号が出力されると、直前のサンプリング回数zに1を加算し、サンプリング回数zの値を更新する。一方、第3加算器313は、選択スイッチ319からローレベルの信号が出力されると、直前のサンプリング回数zを更新しない。第3サンプリング回数レジスタ315は、格納しているサンプリング回数zをz値判定回路331へ出力する。
The
判定処理部330は、z値判定回路331、入力判定結果レジスタ37、入力検出信号発生回路39を備えている。z値判定回路331は、入力信号に対応する電圧レベルのサンプリング回数zと、第1閾値bと、検知期間eにおけるサンプリング回数fとを用いて入力信号の検出を行う回路である。
The
z値判定回路331の入力側は、第3サンプリング回数レジスタ315の出力側、第1閾値設定レジスタ43の出力側、サンプリング回数設定レジスタ347の出力側と接続されている。z値判定回路331の出力側は、入力判定結果レジスタ37の入力側と接続されている。入力判定結果レジスタ37の出力側は、入力検出信号発生回路39の入力側と接続されている。z値判定回路331による判定処理については、後述する。
The input side of the z-
判定条件設定レジスタ340は、入力検出レベル設定レジスタ41、第1閾値設定レジスタ43、検知反応時間レジスタ141、演算回路143、145、サンプリング回数設定レジスタ347を備えている。なお、演算回路143、145は、接続関係を考慮し、判定条件設定レジスタ340に設けられているが、判定条件設定レジスタ340の外に設けられてもよい。入力検出レベル設定レジスタ41、第1閾値設定レジスタ43、検知反応時間レジスタ141、演算回路143、145については、すでに述べているので、接続関係の相違点についてのみ説明する。演算回路145の出力側は、サンプリング回数設定レジスタ347の入力側と接続されている。したがって、演算回路145は、算出したサンプリング回数fをサンプリング回数設定レジスタ347へ出力する。サンプリング回数設定レジスタ347は、演算回路145で算出されたサンプリング回数fを格納し、z値判定回路331へ出力する。
The determination
<ハイレベルの入力信号の検出処理>
次に、本実施の形態における入力信号の検出処理について説明する。図11は、本発明の実施の形態4に係る入力信号の検出処理の一例を示すフロー図である。なお、図11は、入力検出レベルがハイレベルであるハイレベル検知に関わるフローである。図11のフローは、ステップS41〜S51を含む。
<High-level input signal detection processing>
Next, the input signal detection process in the present embodiment will be described. FIG. 11 is a flow chart showing an example of an input signal detection process according to the fourth embodiment of the present invention. Note that FIG. 11 is a flow related to high level detection in which the input detection level is high. The flow of FIG. 11 includes steps S41-S51.
ステップS41では、入力検出レベル設定レジスタ41の設定値a、第1閾値設定レジスタ43の検知期待値bが設定される。例えば、入力検出レベル設定レジスタ41の設定値は、ハイレベルに対応する値(a=1)に設定される。ステップS42では、検知反応時間レジスタ141の検知反応時間dがユーザにより設定される。なお、ステップS42の処理は、ステップS41において行われてもよい。
In step S41, the set value a of the input detection
ステップS43では、サンプリング回数設定レジスタ347にサンプリング回数fが設定される。検知反応時間レジスタ141に検知反応時間dが設定されると、演算回路143は、実施の形態2の式(5)を用いて入力信号の検知期間eを算出する。そして、演算回路145は、演算回路143で算出された検知期間eを用いて実施の形態2と同様にサンプリング回数fを算出し、サンプリング回数設定レジスタ347に格納する。
In step S43, the sampling number f is set in the sampling
ステップS44では、第3サンプリング回数レジスタ315に格納されるサンプリング回数zが初期化される。ステップS45では、入力端子P1の端子電圧のサンプリングが行われる。ステップS45は、図2のステップS13と同様である。また、ステップS45では、検知期間eにおけるサンプリング回数をカウントする。カウントしたサンプリング回数は、例えば図示しないレジスタに格納されてもよいし、ラッチ回路等で保持されてもよい。
In step S44, the sampling number z stored in the third
ステップS46では、サンプリングされた端子電圧の信号レベルが判定される。サンプリングされた端子電圧が、入力検出レベルであるハイレベルであると判定された場合、ステップS47の処理が実行される。ステップS47では、選択スイッチ319は、ハイレベルの信号を出力する。第3加算器313は、選択スイッチ319から出力されたハイレベルの信号に対応して、入力検出レベルのサンプリング回数をzからz+1に更新し、更新したサンプリング回数を第3サンプリング回数レジスタ315に格納する。
In step S46, the signal level of the sampled terminal voltage is determined. When it is determined that the sampled terminal voltage is a high level which is an input detection level, the process of step S47 is executed. In step S47, the selection switch 319 outputs a high level signal. The
ステップS49では、z値判定回路331は、入力信号に対応する電圧レベル、すなわち入力検出レベルのサンプリング回数zと、検知期待値bと、検知期間eにおけるサンプリング回数fとを用いて入力信号の検出を行う。具体的に述べると、z値判定回路331は、まず、検知期間eにおけるサンプリング回数fと検知期待値bとの積(fb)を算出する。そして、z値判定回路331は、入力検出レベルのサンプリング回数zと積fbとを比較する。これらの値が、次に示す式(11)の条件を満たす場合、z値判定回路331は、端子電圧の真の電圧レベルが入力検出レベル(ハイレベル)であると判定し、例えば、ハイレベルの入力検出信号を出力する。
In step S49, the z-
z>bf ・・・(11)
式(11)は、検知期間eにおけるf回のサンプリングのうち、入力検出レベル(ハイレベル)のサンプリング回数zが、b%より高い確率でサンプリングされた場合には、入力信号が検出されたと判定されることを示している。
z> bf ・ ・ ・ (11)
Equation (11) determines that the input signal has been detected when the sampling frequency z of the input detection level (high level) is sampled with a probability higher than b% among the f samplings in the detection period e. It shows that it will be done.
そして、ステップS50の処理が実行される。ステップS50は、図2のステップS19と同様であるので、説明は省略する。そして、入力信号の検出処理は終了する。 Then, the process of step S50 is executed. Since step S50 is the same as step S19 of FIG. 2, the description thereof will be omitted. Then, the input signal detection process ends.
ステップS49において、入力検出レベルのサンプリング回数z及び積fbが式(11)の条件を満たさない場合、z値判定回路331は、端子電圧の真の電圧レベルが入力検出レベル(ハイレベル)ではないと判定し、例えば、ローレベルの入力検出信号を出力する。
In step S49, when the number of samplings z and the product fb of the input detection level do not satisfy the condition of the equation (11), the z
そして、ステップS51の処理が行われる。ステップS51では、検知期間eにおけるサンプリング回数がf回に達したかどうかが判定される。サンプリング回数がf回に達していなければ、ステップS45の処理が再度行われる。これに対し、サンプリング回数がf回に達していれば、ステップS44に戻り、第3サンプリング回数レジスタに格納された値が0に初期化される。また、検知期間eにおけるサンプリング回数も0に初期化される。 Then, the process of step S51 is performed. In step S51, it is determined whether or not the number of samplings in the detection period e has reached f times. If the number of samplings has not reached f, the process of step S45 is repeated. On the other hand, if the number of samplings reaches f, the process returns to step S44, and the value stored in the third sampling number register is initialized to 0. Further, the number of samplings in the detection period e is also initialized to 0.
一方、ステップS46において、サンプリングされた端子電圧が、入力検出レベルであるハイレベルではないと判定された場合、ステップS48の処理が実行される。ステップS48では、選択スイッチ319は、ローレベルの信号を出力する。この場合、第3加算器313は、入力検出レベルのサンプリング回数の更新を行わない。すなわち、サンプリング回数はzのままである。そして、ステップS51の処理が行われる。
On the other hand, in step S46, when it is determined that the sampled terminal voltage is not the high level which is the input detection level, the process of step S48 is executed. In step S48, the selection switch 319 outputs a low level signal. In this case, the
<ローレベルの入力信号の検出処理>
次に、入力検出レベルがローレベルであるローレベル検知について説明する。図12は、本発明の実施の形態4に係るローレベルの入力信号の検出処理の一例を示すフロー図である。なお、図12は、図11と類似しているため、図11との相違点を中心に説明する。
<Low-level input signal detection processing>
Next, low level detection in which the input detection level is low level will be described. FIG. 12 is a flow chart showing an example of low-level input signal detection processing according to the fourth embodiment of the present invention. Since FIG. 12 is similar to FIG. 11, the differences from FIG. 11 will be mainly described.
ステップS41では、例えば、入力検出レベル設定レジスタ41の設定値は、ローレベルに対応する値(a=0)に設定される。なお、ここでは、第1閾値設定レジスタ43に設定される検知期待値bは、入力検出レベルであるローレベルの検知期待値であるとする。
In step S41, for example, the set value of the input detection
ステップS46では、サンプリングされた端子電圧が、入力検出レベルであるローレベルであるかどうかが判定される。サンプリングされた端子電圧が、ローレベルであると判定された場合、ステップS47の処理が実行される。一方、サンプリングされた端子電圧が、入力検出レベルでないハイレベルであると判定された場合、ステップS48の処理が実行される。 In step S46, it is determined whether or not the sampled terminal voltage is at the low level, which is the input detection level. If it is determined that the sampled terminal voltage is low level, the process of step S47 is executed. On the other hand, when it is determined that the sampled terminal voltage is a high level other than the input detection level, the process of step S48 is executed.
本実施の形態によれば、z値判定回路331は、入力信号に対応する電圧レベルのサンプリング回数zと、検知期待値bと、検知期間eにおけるサンプリング回数fと、を用いて入力信号の検出を行う。この構成によれば、電圧レベルごとのサンプリング回数を用いた統計処理行う必要がなくなり、回路構成が簡略化される。また、この構成によれば、ユーザが理解しやすい判定条件を用いた入力信号の検出を行うことが可能となる。
According to the present embodiment, the z
以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。 Although the invention made by the present inventor has been specifically described above based on the embodiment, the present invention is not limited to the embodiment and can be variously modified without departing from the gist thereof. Needless to say.
1、101、201、301…デジタルフィルタ、10、310…サンプリングカウンタ、11…サンプリング回路、20…統計処理部、30、330…判定処理部、40、340…判定条件設定レジスタ、140…判定条件設定回路、210…サンプリングクロック選択回路、P1…入力端子 1, 101, 201, 301 ... Digital filter, 10, 310 ... Sampling counter, 11 ... Sampling circuit, 20 ... Statistical processing unit, 30, 330 ... Judgment processing unit, 40, 340 ... Judgment condition setting register, 140 ... Judgment condition Setting circuit, 210 ... Sampling clock selection circuit, P1 ... Input terminal
Claims (18)
前記電圧レベルごとの前記サンプリング回数を用いて前記端子電圧の統計処理を行う統計処理部と、
統計処理結果を用いて入力信号の検出を行い、前記入力信号を検出すると入力検出信号を出力する判定処理部と、
を備えている、
デジタルフィルタ。 In sampling the terminal voltage of the input terminal, a sampling counter that counts the number of samplings of the terminal voltage for each voltage level and
A statistical processing unit that performs statistical processing of the terminal voltage using the number of samplings for each voltage level, and
A judgment processing unit that detects an input signal using the statistical processing result and outputs an input detection signal when the input signal is detected.
Is equipped with
Digital filter.
前記統計処理部は、前記統計処理結果として、前記端子電圧の前記電圧レベルの期待値及び標準偏差を算出する、
デジタルフィルタ。 In the digital filter according to claim 1,
The statistical processing unit calculates the expected value and standard deviation of the voltage level of the terminal voltage as the statistical processing result.
Digital filter.
前記統計処理部は、算出した前記期待値及び前記標準偏差を用いたベイズ統計により前記統計処理を行う、
デジタルフィルタ。 In the digital filter according to claim 2,
The statistical processing unit performs the statistical processing by Bayesian statistics using the calculated expected value and the standard deviation.
Digital filter.
前記入力信号の検出に関する判定条件を格納する判定条件設定レジスタを備え、
前記判定処理部は、前記統計処理結果と前記判定条件とを用いて前記入力信号を検出する、
デジタルフィルタ。 In the digital filter according to claim 2,
A judgment condition setting register for storing a judgment condition related to the detection of the input signal is provided.
The determination processing unit detects the input signal using the statistical processing result and the determination condition.
Digital filter.
前記判定条件は、前記入力信号の電圧レベルを示す入力検出レベルと、前記端子電圧の真の電圧レベルの判定に用いられる第1閾値と、前記端子電圧の前記電圧レベルのばらつきの判定に用いられる第2閾値と、を含む、
デジタルフィルタ。 In the digital filter according to claim 4,
The determination conditions are used for determining an input detection level indicating the voltage level of the input signal, a first threshold value used for determining the true voltage level of the terminal voltage, and a variation in the voltage level of the terminal voltage. Including the second threshold,
Digital filter.
前記判定処理部は、前記端子電圧の前記電圧レベルの前記期待値と前記第1閾値とを比較し、前記端子電圧の前記真の電圧レベルが前記入力検出レベルであると判定し、かつ、前記端子電圧の前記電圧レベルの前記標準偏差が前記第2閾値未満であると判定したとき、前記入力検出信号を出力する、
デジタルフィルタ。 In the digital filter according to claim 5,
The determination processing unit compares the expected value of the voltage level of the terminal voltage with the first threshold value, determines that the true voltage level of the terminal voltage is the input detection level, and said When it is determined that the standard deviation of the voltage level of the terminal voltage is less than the second threshold value, the input detection signal is output.
Digital filter.
前記判定条件設定レジスタに格納される前記判定条件を設定する判定条件設定回路を備えている、
デジタルフィルタ。 In the digital filter according to claim 4,
A judgment condition setting circuit for setting the judgment condition stored in the judgment condition setting register is provided.
Digital filter.
前記判定条件設定回路は、前記入力信号の電圧レベルを示す入力検出レベルと、前記端子電圧の真の電圧レベルの判定に用いられる第1閾値と、前記端子電圧の前記電圧レベルのばらつきの判定に用いられる第2閾値と、を設定する、
デジタルフィルタ。 In the digital filter according to claim 7,
The determination condition setting circuit determines an input detection level indicating the voltage level of the input signal, a first threshold value used for determining the true voltage level of the terminal voltage, and a variation in the voltage level of the terminal voltage. Set the second threshold to be used,
Digital filter.
前記判定条件設定回路は、前記入力信号に対する検知反応時間を設定する検知反応時間レジスタを備えている、
デジタルフィルタ。 In the digital filter according to claim 7,
The determination condition setting circuit includes a detection reaction time register that sets a detection reaction time for the input signal.
Digital filter.
前記判定条件設定回路は、前記検知反応時間及び前記入力端子の前記端子電圧のサンプリング周期を用い、所定の回数連続で同一の電圧レベルがサンプリングされたときの期待値を前記端子電圧の真の電圧レベルの判定に用いられる第1閾値として算出し、所定の回数連続で同一の電圧レベルがサンプリングされたときの標準偏差を前記端子電圧の前記電圧レベルのばらつきの判定に用いられる第2閾値として算出する、
デジタルフィルタ。 In the digital filter according to claim 9,
The determination condition setting circuit uses the detection reaction time and the sampling cycle of the terminal voltage of the input terminal, and sets the expected value when the same voltage level is sampled a predetermined number of times in succession as the true voltage of the terminal voltage. Calculated as the first threshold used to determine the level, and the standard deviation when the same voltage level is sampled a predetermined number of times in succession is calculated as the second threshold used to determine the variation in the voltage level of the terminal voltage. To do,
Digital filter.
前記入力端子の前記端子電圧のサンプリングのタイミングを規定するサンプリングクロックを選択するサンプリングクロック選択回路を備えている、
デジタルフィルタ。 In the digital filter according to claim 1,
A sampling clock selection circuit for selecting a sampling clock that defines the sampling timing of the terminal voltage of the input terminal is provided.
Digital filter.
前記サンプリングクロック選択回路は、基準サンプリングクロックを分周し、前記基準サンプリングクロックとは異なる周波数のサンプリングクロックを生成する分周回路と、
前記入力端子の前記端子電圧の電圧レベルのサンプリング状況を判定する判定回路と、
前記判定回路における判定結果に応じてサンプリングクロックを切り換えるスイッチ回路と、
を備えている、
デジタルフィルタ。 In the digital filter according to claim 11,
The sampling clock selection circuit divides the reference sampling clock and generates a sampling clock having a frequency different from that of the reference sampling clock.
A determination circuit that determines the sampling status of the voltage level of the terminal voltage of the input terminal, and
A switch circuit that switches the sampling clock according to the judgment result in the judgment circuit, and
Is equipped with
Digital filter.
前記判定回路は、前記端子電圧の真の電圧レベルの判定に用いられる第1閾値と、前記入力端子の前記端子電圧の電圧レベルの期待値とを用いて、前記端子電圧の電圧レベルのサンプリング状況を判定する、
デジタルフィルタ。 In the digital filter according to claim 12,
The determination circuit uses the first threshold value used for determining the true voltage level of the terminal voltage and the expected value of the voltage level of the terminal voltage of the input terminal to sample the voltage level of the terminal voltage. To judge,
Digital filter.
前記分周回路は、それぞれ周波数が異なる複数の前記サンプリングクロックを生成する、
デジタルフィルタ。 In the digital filter according to claim 12,
The frequency divider circuit generates a plurality of the sampling clocks having different frequencies.
Digital filter.
前記入力信号に対応する電圧レベルのサンプリング回数を用いて入力信号の検出を行い、前記入力信号を検出すると入力検出信号を出力する判定処理部と、
を備えている、
デジタルフィルタ。 In sampling the terminal voltage of the input terminal, a sampling counter that counts the number of samplings of the voltage level corresponding to the input signal, and
A determination processing unit that detects the input signal using the number of samplings of the voltage level corresponding to the input signal and outputs the input detection signal when the input signal is detected.
Is equipped with
Digital filter.
前記入力信号の検出に関する判定条件を格納する判定条件設定レジスタを備え、
前記判定処理部は、前記入力信号に対応する電圧レベルのサンプリング回数と、前記判定条件と、を用いて前記入力信号を検出する、
デジタルフィルタ。 In the digital filter according to claim 15,
A judgment condition setting register for storing a judgment condition related to the detection of the input signal is provided.
The determination processing unit detects the input signal using the number of samplings of the voltage level corresponding to the input signal and the determination condition.
Digital filter.
前記判定条件設定レジスタは、前記入力信号の電圧レベルを示す入力検出レベルを設定する入力検出レベル設定レジスタと、前記端子電圧の真の電圧レベルの判定に用いられる第1閾値を設定する第1閾値設定レジスタと、前記入力信号に対する検知反応時間を設定する検知反応時間レジスタと、前記検知反応時間を用いて算出される、検知期間におけるサンプリング回数を設定するサンプリング回数設定レジスタと、を備え、
前記判定処理部は、前記入力信号に対応する電圧レベルのサンプリング回数と、前記第1閾値と、前記検知期間におけるサンプリング回数と、を用いて前記入力信号の検出を行う、
デジタルフィルタ。 In the digital filter according to claim 16,
The determination condition setting register includes an input detection level setting register that sets an input detection level indicating the voltage level of the input signal, and a first threshold that sets a first threshold used for determining the true voltage level of the terminal voltage. It includes a setting register, a detection reaction time register that sets the detection reaction time for the input signal, and a sampling number setting register that sets the number of samplings in the detection period, which is calculated using the detection reaction time.
The determination processing unit detects the input signal using the number of samplings of the voltage level corresponding to the input signal, the first threshold value, and the number of samplings in the detection period.
Digital filter.
前記入力信号は、割り込み信号である、
デジタルフィルタ。 In the digital filter according to claim 1,
The input signal is an interrupt signal.
Digital filter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019031484A JP2020137043A (en) | 2019-02-25 | 2019-02-25 | Digital filter |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019031484A JP2020137043A (en) | 2019-02-25 | 2019-02-25 | Digital filter |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2020137043A true JP2020137043A (en) | 2020-08-31 |
Family
ID=72263678
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2019031484A Pending JP2020137043A (en) | 2019-02-25 | 2019-02-25 | Digital filter |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2020137043A (en) |
-
2019
- 2019-02-25 JP JP2019031484A patent/JP2020137043A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6038649A (en) | Address generating circuit for block repeat addressing for a pipelined processor | |
JP6812781B2 (en) | Delay circuit, count value generation circuit and physical quantity sensor | |
US8874978B2 (en) | Information processing apparatus, information processing system, controlling method for information processing apparatus and program | |
WO1994012983A1 (en) | Look ahead flag for fifo | |
US9673794B2 (en) | Noise analysis apparatus, electronic device, and noise-source identification system | |
KR20030017527A (en) | Baud rate generator with fractional devider | |
US20020008548A1 (en) | Device for detecting abnormality of clock signal | |
JP2020137043A (en) | Digital filter | |
KR20190107431A (en) | Pwm apparatus with improved resolution | |
JP4686420B2 (en) | Sampling data averaging circuit | |
JP2006318002A (en) | Clock frequency-dividing circuit | |
CN107247819B (en) | Filtering method and filter for sensor | |
US10756716B2 (en) | Electronic device and noise removal system | |
CN115632653A (en) | Phase discrimination method, phase discriminator, clock recovery module, ethernet chip and vehicle | |
CN113346877B (en) | Clock period detection method and circuit based on dichotomy | |
US10802656B2 (en) | Touch sensor circuit | |
US7743272B1 (en) | Methods and apparatus for generating precise timing information using progressive block averaging | |
EP4329196A1 (en) | Entropy source circuit and entropy value generation method | |
JP4215748B2 (en) | Digital signal output apparatus and digital signal output method | |
JP2010206603A (en) | Delay generator and ic tester | |
JPH06104741A (en) | Didital pll device | |
KR200431691Y1 (en) | The pulse generation time comparator | |
KR0174707B1 (en) | Clock generator | |
JP2021007224A (en) | Delay circuit, count value generation circuit and physical quantity sensor | |
CN114297968A (en) | Signal de-bouncing method and device, electronic equipment and readable storage medium |