GB2248954A - Computer with adaptive bandwidth moving average filter - Google Patents
Computer with adaptive bandwidth moving average filter Download PDFInfo
- Publication number
- GB2248954A GB2248954A GB9120778A GB9120778A GB2248954A GB 2248954 A GB2248954 A GB 2248954A GB 9120778 A GB9120778 A GB 9120778A GB 9120778 A GB9120778 A GB 9120778A GB 2248954 A GB2248954 A GB 2248954A
- Authority
- GB
- United Kingdom
- Prior art keywords
- value
- filter
- moving average
- computer
- filter constant
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03H—IMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
- H03H17/00—Networks using digital techniques
- H03H17/02—Frequency selective networks
- H03H17/0248—Filters characterised by a particular frequency response or filtering method
- H03H17/026—Averaging filters
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/18—Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Pure & Applied Mathematics (AREA)
- Mathematical Optimization (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Operations Research (AREA)
- Probability & Statistics with Applications (AREA)
- Life Sciences & Earth Sciences (AREA)
- Algebra (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Evolutionary Biology (AREA)
- Computer Hardware Design (AREA)
- Complex Calculations (AREA)
- Filters That Use Time-Delay Elements (AREA)
- Feedback Control In General (AREA)
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
- Processing Of Color Television Signals (AREA)
- Picture Signal Circuits (AREA)
Abstract
A computer is programmed to provide a moving average filter process which designates, 50, an initial filter constant to control the filter response time; maintains a moving average signal value; finds, 54, a difference between the moving average and each new signal sample amplitude before the new amplitude is included in the moving average; updates, 66, the average by adding to it, at a time of each new signal sample, a value calculated by dividing the difference by the initial filter constant; and when a sequential plurality of the found difference values manifest an identical polarity, divides, 64, the initial filter constant by an integer factor which thereby reduces the filter response time. When, by contrast, a found difference value manifests a different polarity from an immediately preceding found difference value, the filter constant is multiplied, 68, by an integer factor so as to increase the response time. <IMAGE>
Description
2 243Q 54 COMPUTER WITH ADAPTIVE BANDWIDTH MOVING AVERAGE FILTER
FIELD OF THE INVENTION
This invention relates to digital filters, and more particularly, to an amplitude-averaging digital filter which exhibits a rapid response to received input values.
BACKGROUND OF THE INVENTION
Digital filters are well-known in the prior art. Such filters may be configured on general purpose computers such as shown at 10 in Fig. 1. Such a general purpose computer comprises an arithmetic logic unit (ALU) 12 that includes a portion reserved for filter software 14 (that has been previously loaded therein).
An analog to digital (A/D) converter 16 receives an analog signal input applied thereto via conductor 18. After the signal input is converted to digital values, those values are emplaced on bus 20 and from there transported to either random access memory (RAM) 22 or disk store 24. ALU 12, in combination with its filter software may then operate on the received digital va lues, either in real time or on a delayed basis. The filtered signal is then reimpressed on bus 20 and fed via input/output interface 26 to a receiving device.
A/D converter 16 periodically samples analog signal inputs appearing on conductor 18 and provides discrete digital amplitude values thereof. The rate at which 2 A/D converter 16 provides signals onto bus 20 is controlled by commands from ALU 12. The f ilter is updated once per sample.
one of the better known amplitude filtering software algorithms creates a f ilter function termed a "moving average filter". In such a filter, each input sample value is multiplied by a fraction hereinafter called the Ofilter factor" and is then added to the previously averaged reading values, multiplied by 1 the filter factor to produce a new average value. The operation of this filter is expressed as:
AVGi = (1 - x(AVG)i_l + X(RDG)i where:
AVG ith averaged value RDG ith reading value x = filter factor (less than 1) (1) The response of such a moving average filter is shown in Fig. 2. Waveform 30 occurs in response to a step input 32 which traverses from voltage E 1 to voltage E 2 Filter waveform 30 can be expressed as:
E (n) = (1-x) E (n-1) + xE2 (2) Equation 2 is the result of the application of equation 1 to the waveforms of Fig. 2, with n representing the number of the particular voltage sample provided to the filter.
k.
3 Using the moving average filter technique, the discrete signal amplitudes which result from the operation of equation 2 are as follows:
E (0) = E 1 E(1) = (1-x)E(O) + xE 2 E 2 - (E 2 -E 1)(1-x)2 E (2) = (1-x) E (1) + xE 2 E 2 - (E 2 -E,) (1-X)3 E(3) = (1-x)E(2) + XE 2 E 2 - (E 2 -El)(1-x) E (n) = E 2 - (E 2 -E 1) R-X) n (3) The inverse of the filter factor x, hereinafter called the "filter constant" is usually, but not limited to, an integer power of 2 for software efficiency.
It can be seen from equation 3 that, given a relatively modest filter constant, (e.g., 64 or 128), the time for the filter's output to reach 95% of its steady state value can require many readings - on the order of hundreds. This creates an unwanted delay in further processing of the filtered signal and is to be avoided.
Accordingly, it is an object of this invention to provide a moving average filter which reaches a steady state value more rapidly than prior art filters.
It is another object of this invention to provide a moving average filter which alters its bandwidth in accordance with input signal characteristics.
1 4 SUMMARY OF THE INVENTION
A computer is programmed with a software filter which operates the computer to perform a moving average filter method. The method comprises designating an initial filter constant to control the filter response time; maintaining a moving average signal value of signal ainplitude; finding a difference value between the moving average signal value and each new signal sample amplitude before the new signal sample amplitude is included in the moving average signal value; updating the moving average signal value by adding to it, at a time of each new signal sample, a value calculated by dividing the difference value found for a new signal sample by the initial filter constant; and determining when a sequential plurality of the found difference values manifest an identical polarity, and upon such determination dividing the initial filter constant by an integer factor to create a reduced filter constant which reduces the filter response time. When, by contrast, a found difference value manifests a different polarity from an immediately preceding found difference value the filter constant is multiplied by an integer factor to increase the filter response time.
DESCRIPTION OF THE DRAWINGS
Fig. 1 is a high level block diagram of a computer for performing filter operations on a signal input.
Fig. 2 shows a step input waveform and resulting output values from a moving average filter operating in accordance with the prior art.
Figs. 3a and 3b illustrate a high level flow diagram of the operation of the filter of this invention.
Fig. 4 is a set of waveforms which illustrates the response of a filter configured in accordance with this invention in response to a step input function.
Fig. 5 is a set of waveforms which illustrates the response of the filter of this invention in response to a pulse waveform.
DETAILED DESCRIPTION OF THE INVENTION
Referring back to Fig. 1, the method of this invention requires that within ALU 12, two registers exist which are operated during the operation of filter software 14. The first such register is an equal polarity counter 13 which has both count and reset inputs. The second such register filter is constant register 15. The functions of these registers will be further understood from the description below of the flow diagram of Figs. 3a AND 3b.
As shown in Fig. 3a, initially an input is provided which establishes the maximum filter constant N max (e.g. 64 or 128) (box 50). Next, the current voltage reading Rdgi is captured from A/D converter 16 (box 52).
The previous moving average value Avgj_1 is then subtracted from Rdgi to obtain a difference value DIFFi that is indicative of the difference of the newest voltage reading from the previously accumulated average voltage value (box 54). The value of DIFFi is 6 now tested to determine whether it is equal to 0 (box 56). If it is found not to be equal to o, the Diffi polarity is tested to determine whether it is equal to the polarity of DIFF i-1 (decision box 58). More specifically, it is determined whether the difference voltage achieved between the newest voltage sample and the previous average is of the same polarity as the difference voltage derived for the immediately preceding voltage sample.
If the difference voltages are found to be of the same polarity, then equal polarity counter 13 in ALU 12 is incremented by 1 (box 60), and the value of the counter is tested (decision box 62) to determine whether its count is equal to or greater than 5. That is, if there have been at least 5 or more equal polarity findings in the DIFF values, then it is assumed that the signal has changed in one direction and that the filter response time should be reduced to allow the moving average to reach the input value faster. The value of 5 is somewhat arbitrary and will depend, to some extent, on the expected character of the incoming signal. As a result, (see box 64) the filter constant register, which presently indicates a count of Ni, has its value decreased by dividing its count by an integer factor, preferably 2. Obviously, the count of the filter constant register cannot be decreased to less than a value of 1, so that is set in as a minimum limit.
At this stage. the software calculates a new value for Avgi by dividing the value of DIFFi by the new value of N il The result of this division is then added to Avgj_1 to obtain a new moving average value (box 66).
7 It is to be noted that by using the decreased value of Ni as the divisor, a larger portion of DIFFi is added to the previous moving average (Avgj_1) so that the input value is reached more rapidly.
Returning to decision box 62, if the "equal polarity" count is determined to be less than 5, then the filter constant register value N 1 is not decreased and the moving average value calculation shown in box 66 continues, with the latest filtei constant used as the divisor.
Returning now to decision box 56, if the value of DIFF i is f ound equal to 0, then the program immediately moves to box 68 where the N i value, as evidenced by filter constant register 15, is increased by an integer factor, preferably 2. Its value is limited so that N i does not exceed %ax The same action occurs if it is found that the polarity of DIFF i is not equal to the polarity of DIFF i-1 (box 58). Thus, in either case, it is assumed that there is a change in polarity occurring, and that the moving average is close to the input value and that the filter response time should be increased to reduce the noise amplitude. This is achieved by resetting equal polarity counter 13 to 0 (box 70) and then using the increased value of N i in filter constant register 15 in the calculation indicated in box 66.
Thus, using this greater value for the filter constant, the value of DIFF i/I1i is reduced and the filter response time is greater until the equal polarity count again evidences a count of either k 8 greater than or equal to 5. At such point, the filter constant is decreased by an integer factor.
Subsequent to each calculation of the moving average value Avgi, the program returns to box 52 to capture the new reading Rdgi+1 etc. and the program proceeds.
Referring now to Figs. 4 and 5, examples are shown which compare the action of the adaptive bandwidth control filter operating as shown in Figs. 3a and 3b with the prior art moving average filter.
In Figs. 4 and 5 it is assumed that the maximum filter constant N max is 128 and the reading rate is 2.5 readings per second (period = 400ms). Further, it is assumed that a step function signal 100 (see Fig. 4) is applied to the filter function. It can be seen that the values of Avgi will be as follows for each of specifically indicated reading number (as calculated by the equation shown in box 70, Fig. 3b).
(Avg), 100 + 50/128 = 100.39 (Avg) 2 100.39 + 49.61/128 100.78 (Avg 100.78 + 49.22/128 101.163 )3 (Avg)4 101.163 + 48.837/128 = 101.55 (Avg)5 101.55 + 48.45/64 = 102.30 (Avg)6 102.30 + 47.70/32 = 103.79 (Avg)11 = 135.78 + 14.22/1 = 150 It can be seen that the total number of readings f or the adaptive bandwidth f ilter of this invention to 11 9 reach its 100% of steady state value is 11. The total filtering time is then:
T = 11 # of reading/sec 4.4 second To find the time required for a prior art moving average filter to reach 95% of its steady state value, equation 3 indicates the following:
95E2 = E 2 - (E 2 - E1)(1-1/128)n) where: E 2 150 E, = 100 The solution of the above equation shows that n = 242 readings and the time required for the process is t 97 seconds As shown in Fig. 5, a pulse input 102, having a period less than 400 milliseconds (less than period of read rate) is applied to the filter with a given filter constant of 64 (N max = 64). Using the filter algorithm as shown in Figs. 3a and 3b, the individual Avgi readings are as follows:
(Avg) 1 = 100 + 50/64 = 100.781 (Avg) 2 = 100.78 + -.781/128 = 100.755 (Avg) 12 = 100.222 + -.222/1 = 100 It can be seen that 12 readings are required f or the filter to reach 100% of its steady. state value and 1 i that the time required for this process is 4.8 seconds.
Using the prior art moving average filter with filter constant = 64 the number of readings required for the filtered value to read 99.92% of the steady state value is approximately 144 and the time required is 58 seconds.
Appendix A is a source code listing of the invention as described hereinabove.
It should be understood that the foregoing description is only illustrative of the invention. various alternatives and modifications can be devised by those skilled in the art without departing from the invention. Accordingly, the present invention is intended to embrace all such alternatives, modifications and variances which fall within the scope of the appended claims.
1 11
Claims (1)
1 A computer programmed with a filter for performing a moving average filter method comprising:
designating an initial filter constant to control the filter response time; maintaining a moving average value of signal sample amplitudes; finding a difference value between said moving average value and each new signal sample amplitude, before said new signal sample amplitude is included in the moving average value; updating said moving average value by adding thereto, at a time of each new signal sample, a value calculated by dividing the difference value found for a said new signal sample by said initial filter constant; and determining when a sequential plurality of said found difference values manifest an identical polarity, and upon such determination dividing said initial filter constant, to thereby reduce the filter response time.
2 A computer as defined in claim 1, wherein each time said sequential plurality of found difference values manifests said identical polarity, dividing said reduced filter constant by an integer factor to further reduce said filter constant to a lesser value, but never less than a value of one.
3 A computer as defined in claim 2, further comprising the step of:
k 12 when a found difference value manifests a different polarity from an immediately preceding found difference value, multiplying said filter constant by a factor to increase its value, but never more than said initial filter constant.
4 A computer as defined in claim 3, comprising the additional step of:
when a found difference value is zero, multiplying said filter constant by a factor to increase its value, but never more than said initial filter constant.
A computer as defined in claim 2 or claim 3 wherein said integer factor is two.
6 A computer as defined in claim 4 wherein said factor is an integer.
7 A computer as defined in claim 6 wherein said integer factor is two.
8 A computer as defined in any of claims 5 to 7 wherein a sequential plurality of said found difference values is five.
9 A computer programmed substantially as described herein with reference to or as illustrated in the accompanying drawings.
A method of operating a computer to reduce further filter response time substantially as described herein.
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US59908790A | 1990-10-17 | 1990-10-17 |
Publications (3)
| Publication Number | Publication Date |
|---|---|
| GB9120778D0 GB9120778D0 (en) | 1991-11-13 |
| GB2248954A true GB2248954A (en) | 1992-04-22 |
| GB2248954B GB2248954B (en) | 1994-08-24 |
Family
ID=24398158
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| GB9120778A Expired - Lifetime GB2248954B (en) | 1990-10-17 | 1991-10-01 | Computer with adaptive bandwidth moving average filter |
Country Status (6)
| Country | Link |
|---|---|
| CA (1) | CA2052600C (en) |
| DE (1) | DE4134398C2 (en) |
| ES (1) | ES2048066B1 (en) |
| FR (1) | FR2668319B1 (en) |
| GB (1) | GB2248954B (en) |
| IT (1) | IT1250938B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0602780A3 (en) * | 1992-12-15 | 1995-08-09 | Int Control Automation Finance | Digital signal processing and filtering. |
| EP3197050A1 (en) * | 2016-01-19 | 2017-07-26 | LSIS Co., Ltd. | Method for controlling operation of moving average filter |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5394744A (en) * | 1994-01-05 | 1995-03-07 | Ford Motor Company | Fault detection using averaging filter with variable response time |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0000729A1 (en) * | 1977-08-03 | 1979-02-21 | BASF Aktiengesellschaft | Spindle for the simultaneous winding of a plurality of webs |
| GB2161964A (en) * | 1984-07-20 | 1986-01-22 | Georges J Bradford | A method of functional analysis |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB1290865A (en) * | 1969-09-24 | 1972-09-27 | ||
| JPS56169923A (en) * | 1980-06-03 | 1981-12-26 | Mitsubishi Electric Corp | Digital low-pass filter device |
-
1991
- 1991-10-01 CA CA002052600A patent/CA2052600C/en not_active Expired - Lifetime
- 1991-10-01 GB GB9120778A patent/GB2248954B/en not_active Expired - Lifetime
- 1991-10-14 ES ES09102259A patent/ES2048066B1/en not_active Expired - Fee Related
- 1991-10-16 IT ITRM910786A patent/IT1250938B/en active IP Right Grant
- 1991-10-16 FR FR9112756A patent/FR2668319B1/en not_active Expired - Fee Related
- 1991-10-17 DE DE4134398A patent/DE4134398C2/en not_active Expired - Fee Related
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0000729A1 (en) * | 1977-08-03 | 1979-02-21 | BASF Aktiengesellschaft | Spindle for the simultaneous winding of a plurality of webs |
| GB2161964A (en) * | 1984-07-20 | 1986-01-22 | Georges J Bradford | A method of functional analysis |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0602780A3 (en) * | 1992-12-15 | 1995-08-09 | Int Control Automation Finance | Digital signal processing and filtering. |
| EP3197050A1 (en) * | 2016-01-19 | 2017-07-26 | LSIS Co., Ltd. | Method for controlling operation of moving average filter |
| US9998101B2 (en) | 2016-01-19 | 2018-06-12 | Lsis Co., Ltd. | Method for controlling operation of moving average filter |
Also Published As
| Publication number | Publication date |
|---|---|
| IT1250938B (en) | 1995-04-22 |
| ITRM910786A1 (en) | 1993-04-16 |
| FR2668319B1 (en) | 1994-01-28 |
| DE4134398A1 (en) | 1992-04-23 |
| CA2052600C (en) | 1995-09-19 |
| FR2668319A1 (en) | 1992-04-24 |
| GB9120778D0 (en) | 1991-11-13 |
| ITRM910786A0 (en) | 1991-10-16 |
| ES2048066A2 (en) | 1994-03-01 |
| ES2048066B1 (en) | 1996-07-01 |
| ES2048066R (en) | 1995-11-16 |
| CA2052600A1 (en) | 1992-04-18 |
| DE4134398C2 (en) | 1996-02-15 |
| GB2248954B (en) | 1994-08-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Zhang et al. | A new impulse detector for switching median filters | |
| Yuksel | A hybrid neuro-fuzzy filter for edge preserving restoration of images corrupted by impulse noise | |
| EP0977355B1 (en) | Device and method for limiting peaks of a signal | |
| US6280391B1 (en) | Method and apparatus for removing baseline wander from an egg signal | |
| US4185168A (en) | Method and means for adaptively filtering near-stationary noise from an information bearing signal | |
| US4038539A (en) | Adaptive pulse processing means and method | |
| EP0396746B1 (en) | Picture receiver controller | |
| CA2191284C (en) | Ecg filter and slew rate limiter for filtering an ecg signal | |
| US4297642A (en) | Offset correction in operational amplifiers | |
| KR100221248B1 (en) | Easy-to-order median filter | |
| GB2248954A (en) | Computer with adaptive bandwidth moving average filter | |
| US5777909A (en) | High pass filter with coefficient switching to improve settling time | |
| JP2000090069A (en) | Method for processing sequence of input digital signal | |
| JPS6340367B2 (en) | ||
| US5010507A (en) | Sampled digital filter system | |
| US10797715B2 (en) | Filtering method and filter | |
| KR940013255A (en) | How to generate a modified video signal | |
| KR20050011241A (en) | Noise diminishing apparatus and a method thereof | |
| JP2668721B2 (en) | Limiter interpolation type DFT operation method | |
| RU2055396C1 (en) | Digital filter | |
| KR970002195B1 (en) | Voice element removing device and its controlling method in a digital equipment | |
| RU2015561C1 (en) | Device for aperture correction of images | |
| JPH0943340A (en) | Signal processing apparatus and method thereof | |
| US20080150626A1 (en) | Time variant filter with reduced settling time | |
| US6459752B1 (en) | Configuration and method for determining whether the counter reading of a counter has reached a predetermined value or not |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PE20 | Patent expired after termination of 20 years |
Expiry date: 20110930 |