The invention pertains to signal processing, and particularly to reconstructive signal processing.
The invention is a system for reading high-frequency pulses through a low-pass filter.
The present invention is an approach for using an analog input from which a pulse count may be obtained indirectly. The input signal to a low-pass filter of the present approach cannot realistically be used for the count in absence of additional hardware to pick up the signal. Additional hardware means undesired expense. In the present approach, pulse counting of the input may be achieved without adding any hardware specific to counting, like a second path for the input signal, which could be a high frequency path around the filter. In the present approach, the input signal may be reconstructed after the filter. This approach appears to work even if there is a resistor-capacitor (RC) filter in the analog input hardware that severely attenuates frequencies in the range of which pulses are to be counted. The present approach may essentially include reading high frequency pulses coming through a strong low-pass filter.
Pulse counting hardware may be different from analog input hardware partially because the bandwidth needed for pulse counting appears to be in conflict with the low-pass filtering requirements of an analog input.
At a highest level, the present approach may operate by nearly exactly reconstructing the original signal being input to the RC filter. This approach may appear workable in a manner contrary to normal intuition. Further, it may be done more simply than intuition would suggest. The present approach may be done without accumulating any state information except for a previous sample value. This may eliminate the possibility of long term round off, drift, or instability. It also means that the present approach may work accurately at arbitrarily low frequencies.
Other approaches may include specific inputs that count pulses, but are not capable of doing any analog-to-digital conversion, and do not share terminals with analog input hardware. This generally adds costs to the product because more hardware appears to be required.
Still other approaches may include sharing the same input terminals between an analog input and pulse-counting input, but ultimately have the signal go through two different paths. This appears to be basically the same as having dedicated pulse-counting hardware, except that the terminals are shared with analog input hardware. Once again, these approaches may involve added costs for the pulse counting capability.
The present pulse counting approach may include an input block for providing biasing and filtering. The present counting approach may be shown with an example which involves re-engineering a pulse counting algorithm using a low-pass RC filter on the input.
It may be noted that by doing a computation on the differences between consecutive A/D readings, pulses through an RC filter could be counted. But there may be some difficulties with using a fixed threshold; however, it appears that some sort of relatively simple incremental state-maintaining algorithm might accomplish the task of counting pulses. Whatever algorithm is to be used, it should be simple, run at about 640 Hz, and do computations for up to three channels for certain product needs, but there may be more or less channels.
One may consider the following example, in which a 100 Hz square wave is presented at the input immediately following the tail end of a very long square wave. If one were to set a fixed threshold at 512 Hz, the system would miss the first two pulses following the long pulse. However, this could possibly be alleviated by having a moving threshold. For instance, the threshold may simply be the output of a low-pass IIR (infinite impulse response) filter with a lower frequency than the RC filter itself (but not so low that the threshold would fail to keep up with the special case shown herein). However, if the threshold reacts fast enough for such case, one's intuition may indicate that it would not function properly over the other extreme case of a ten minute long square wave (i.e., it would tend to follow such a long square wave too closely).
Ultimately, one thing that may indicate having the wrong solution is a situation where the input is a ten minute line sine wave. Then the slowly-moving-threshold approach would appear to simply follow the sine wave and not provide a useful threshold point at all. One might argue that responding to a sine wave is not needed, but one may have to admit that certain designs do respond to a sine wave.
A goal is to cancel out the effects of the RC filter. If one designed a system that accomplished a cancellation of such effects, it might be unstable (which is often a concern with IIR filters) or require too much computation if done at 640 Hz. However, it may be noted that not only can such design be safely done with integer-only math; it may be implemented without any feedback (meaning that it would not get out of sync or become unstable). The only state variable in this designed system would be a previous A/D reading.
The design of the system may begin with a characterization the low-pass RC filter as an IIR filter in order to get its constants. A form of a single-pole IIR filter may be:
yn=a0xn+b1yn−1. (1)
The constants for this equation may be computed as:
b1=e−2πf
a0=1−b1
where fc is expressed as a fraction of the sample rate of the analog-to-digital converter, i.e., fc=(−3 dB point)/(sample rate). The RC filter of the input block 12 may have a −3 dB point of 1/(2*π*τ*C)=1/(2*π*34000*0.00000047)≅10 Hz, where τ is the time constant of the filter. Thus, fc=10/640. At a sample rate of 640 Hz, this may be simulated as
b1=e−2π(10/640)=0.9064905
a0=0.0935095
By solving the equation (1) for xn, one may get
xn=(1/a0)yn−(b1/a0)yn−1=10.694yn−9.694yn−1.
It may be noted that the computation of xn seems to just depend on two consecutive A/D readings. Since there appears to be no possibility of accumulated errors, the following equation is nearly as good.
xn=11yn−10yn−1 (2)
A critical thing here is that the two constants are different from each other by virtually exactly one (in this instance, 11−10=1). Since the xn is a reconstruction of the original waveform, ranging from 0 to 1023 (in a 10-bit A/D case); an absolute threshold (e.g., around 512) for the 10-bit A/D may be used. It may be noted that the xn resulting from equation (2) is specific to the parameters of the filter and the sample rate. The 640 Hz sampling rate, which can be optional, may be regarded as integral to the 50/60 Hz of common power lines, and thus helpful in rejecting 50/60 Hz noise at the input side of the A/D converter.
The low-pass filter may be a multiple-pole filter and a corresponding characterization may be provided and implemented in a similar manner as the characterization provided herein for the single-pole low-pass filter.
The frequency response of the RC filter 12 plus the response of reconstruction filter (using 10 and 11 as constants—equation (2)) in the processor 14 is shown as curve 32 in the graph of
Relative to the 640 Hz sampling scenario, one concern may be that there is a high response around 920 Hz, with the overall attenuation being only about 13 dB. 920 Hz may be aliased to 280 Hz. The next such high response point may be near 1575 Hz, at about 17 dB attenuation. 1575 Hz may alias to 295 Hz. Both of these aliased frequencies appear outside the 0 to 100 Hz range. Such high-frequency noise could occur due to contact bouncing, making this a legitimate concern.
The situation might be improved with a 100 Hz low pass filter after the reconstruction filter, but a single-pole low pass filter seems not strong enough (in that 100 Hz appears too close to the middle of the 640 Hz spectrum). A higher order filter could be probably too CPU intensive to implement at such a high rate.
A solution may be to set hysteresis or threshold points at ¾-full-scale and ¼-full-scale, so that a full-amplitude signal with 13 dB of attenuation (i.e., about one quarter amplitude) gets rejected.
Test or simulation results may be noted. An input test using random noise may be done to see if the reconstruction IIR filter is unstable in the face of noise. Such test was done before it was realized that the filter appeared not to be an IIR filter, but rather an FIR (finite impulse response) filter of a length 2, and thus would not become unstable. A distinguishing aspect of the FIR filter may be a lack of xn−1 in equation (1).
Noise rejection may be noted. The graph of
Another realistic simulation may be provided in a graph of
In the present specification, some of the matter may be of a hypothetical or prophetic nature although stated in another manner or tense.
Although the invention has been described with respect to at least one illustrative example, many variations and modifications will become apparent to those skilled in the art upon reading the present specification. It is therefore the intention that the appended claims be interpreted as broadly as possible in view of the prior art to include all such variations and modifications.
| Number | Name | Date | Kind |
|---|---|---|---|
| 3671876 | Oshiro | Jun 1972 | A |
| 3984773 | Oda | Oct 1976 | A |
| 4180777 | Yamada et al. | Dec 1979 | A |
| 4236253 | Onishi et al. | Nov 1980 | A |
| 4763207 | Podolak et al. | Aug 1988 | A |
| 4970582 | Scott | Nov 1990 | A |
| 5355136 | Katagiri | Oct 1994 | A |
| 5848040 | Tanaka | Dec 1998 | A |
| 5887244 | Aldridge et al. | Mar 1999 | A |
| 6084837 | Miyanabe et al. | Jul 2000 | A |
| 6225936 | Silver et al. | May 2001 | B1 |
| 6285979 | Ginzburg et al. | Sep 2001 | B1 |
| 6473369 | Quan et al. | Oct 2002 | B1 |
| 6631341 | Kameda et al. | Oct 2003 | B2 |
| 6725248 | Hasegawa et al. | Apr 2004 | B1 |
| 6781938 | Nanba et al. | Aug 2004 | B2 |
| 6812875 | Shimizu | Nov 2004 | B2 |
| 7095803 | Gazsi et al. | Aug 2006 | B2 |
| 7200187 | O'Brien | Apr 2007 | B2 |
| 7424066 | Montalvo et al. | Sep 2008 | B2 |
| 7479907 | Lazar | Jan 2009 | B2 |
| 7623053 | Terry et al. | Nov 2009 | B2 |
| 20030112733 | Nanba et al. | Jun 2003 | A1 |
| 20040252044 | Mathis et al. | Dec 2004 | A1 |
| 20090079607 | Denison et al. | Mar 2009 | A1 |
| Number | Date | Country | |
|---|---|---|---|
| 20090212986 A1 | Aug 2009 | US |