CA2052600C - Adaptive bandwidth moving average filter - Google Patents

Adaptive bandwidth moving average filter

Info

Publication number
CA2052600C
CA2052600C CA002052600A CA2052600A CA2052600C CA 2052600 C CA2052600 C CA 2052600C CA 002052600 A CA002052600 A CA 002052600A CA 2052600 A CA2052600 A CA 2052600A CA 2052600 C CA2052600 C CA 2052600C
Authority
CA
Canada
Prior art keywords
value
filter
moving average
filter constant
found
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
CA002052600A
Other languages
French (fr)
Other versions
CA2052600A1 (en
Inventor
Abdi Mohtashemi
Norman Gray
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Newport Electronics Inc
Original Assignee
Newport Electronics Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Newport Electronics Inc filed Critical Newport Electronics Inc
Publication of CA2052600A1 publication Critical patent/CA2052600A1/en
Application granted granted Critical
Publication of CA2052600C publication Critical patent/CA2052600C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03HIMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
    • H03H17/00Networks using digital techniques
    • H03H17/02Frequency selective networks
    • H03H17/0248Filters characterised by a particular frequency response or filtering method
    • H03H17/026Averaging filters
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Theoretical Computer Science (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Probability & Statistics with Applications (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Algebra (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Operations Research (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 software filter is described which operates a 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; 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 running 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 when a sequential plurality of the found difference values manifest an identical polarity, dividing the initial filter constant by an integer factor to create a reduced filter constant 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 by an integer factor to increase its value, not to exceed a maximum value, so as to increase the filter response time.

Description

20~2600 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 values, 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 A/D converter 16 provides signals onto bus 20 is controlled by commands from ALU 12. The filter is updated once per sample.

One of the better known amplitude filtering software algorithms creates a filter function termed a "moving average filter". In such a filter, each input sample value is multiplied by a fraction hereinafter called the "filter factor" and is then added to the previously averaged reading values, multiplied by 1 -the filter factor to produce a new av~rage value. The operation of this filter is expressed as:

(1 X) (AVG)i_l + X(RDG)i (1) where:

AVGi = ith averaged value RDGi = ith reading value x = filter factor (less than 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 El to voltage E2. Filter waveform 30 can be expressed as:

E(n) = (l-x)E(n-l) + 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.

Using the moving average filter technique, the discrete signal amplitudes which result from the operation of equation 2 are as follows:

E(O) = El E(l) = (l-x)E(O) + xE2 = E2 ~ (E2-El)(l-X)2 E(2) = (l-x)E(l) + xE2 = E2 ~ (E2-El)(l-X)3 E(3) = (1-x)E(2) + xE2 = E2 ~ (E2-E1)(1-x) E(n) = E2 ~ (E2-El)(l-x) (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.

SUMMARY OF THE INVENTION

A software filter is described which operates a 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 amplitude; 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 when a sequential plurality of the found difference values manifest an identical polarity, 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.

s 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 ~et of waveforms which illustrates the response of the filter of this invention in response to a pulse input 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 register filter 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 NmaX
(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 Avg i 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 now tested to determine whether it is equal to 0 (box 56). If it is found not to be equal to 0, the Diffi polarity is tested to determine whether it is equal to the polarity of DIFFi 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 l (box 60), and the value of the counter is tested (decision box 62) to determine whether its count is equal to or greater than S. 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 Ni. The result of this division is then added to Avgi 1 to obtain a new moving average value (box 66).

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 (Avgi 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 Ni is not decreased and the moving average value calculation shown in box 66 continues, with the latest filter constant used as the divisor.

Returning now to decision box 56, if the value of DIFFi is found equal to 0, then the program immediately moves to box 68 where the Ni value, as evidenced by filter constant register 15, is increased by an integer factor, preferably 2. Its value is limited so that Ni does not exceed NmaX. The same action occurs if it is found that the polarity of DIFFi is not equal to the polarity of DIFFi 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 O (box 70) and then using the increased value of Ni in filter constant register 15 in the calculation indicated in box 66.

Thus, using this greater value for the filter constant, the value of DIFFi/Ni is reduced and the filter response time is greater until the equal polarity count again evidences a count of either -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+l etc. and the program proceeds.

Referring now to Figs. 4 and 5, ex~ples 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 NmaX is 128 and the reading rate is 2.S
readings per second (period z 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)l = 100 + 50/128 = 100.39 (Avg)2 = 100.39 + 49.61/128 = 100.78 (Avg)3 = 100.78 + 49.22/128 = 101.163 (Avg)4 = 101.163 + 48.837/128 = 101.55 (Avg)5 = lOl.S5 + 48.45/64 = 102.30 (Avg)6 = 102.30 + 47.70/32 = 103.79 (Avg)ll = 135.78 + 14.22/1 = 150 It can be seen that the total number of readings for the adaptive bandwidth filter of this invention to reach its 100% of steady state value is 11. The total filtering time is then:

T = 11 = 4.4 second # of reading/sec 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:
2 E2 (E2 ~ E~ 1/128)n) where: E2 = 150 El = 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 (Nmax = 64). Using the filter algorithm as shown in Figs. 3a and 3b, the individual Avgi readings are as follows:

(Avg)l = 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 for the filter to reach 100% of its steady. state value and 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.

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.

Claims (9)

1. A method for altering the response time of a software filter, said software filter operating a computer to perform a moving average filter method, said 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 by a factor to create a reduced filter constant, to thereby reduce the filter response time.
2. The method 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. The method as defined in claim 2, further comprising the step of:

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. The method 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.
5. The method as defined in claim 2 wherein said integer factor is two.
6. The method as defined in claim 4 wherein said factor is an integer.
7. The method as defined in claim 6 wherein said integer factor is two.
8. The method as defined in claim 5 wherein a sequential plurality of said found difference values is five.
9. The method as defined in claim 7 wherein a sequential plurality of said found difference values is five.
CA002052600A 1990-10-17 1991-10-01 Adaptive bandwidth moving average filter Expired - Lifetime CA2052600C (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US59908790A 1990-10-17 1990-10-17
US07/599,087 1990-10-17

Publications (2)

Publication Number Publication Date
CA2052600A1 CA2052600A1 (en) 1992-04-18
CA2052600C true CA2052600C (en) 1995-09-19

Family

ID=24398158

Family Applications (1)

Application Number Title Priority Date Filing Date
CA002052600A Expired - Lifetime CA2052600C (en) 1990-10-17 1991-10-01 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5339335A (en) * 1992-12-15 1994-08-16 Elsag International B.V. Method and apparatus for digitally processing and filtering signals in industrial control applications
US5394744A (en) * 1994-01-05 1995-03-07 Ford Motor Company Fault detection using averaging filter with variable response time
KR101716481B1 (en) 2016-01-19 2017-03-14 엘에스산전 주식회사 Method for controlling operation of moving average filter

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB1290865A (en) * 1969-09-24 1972-09-27
DE2734978A1 (en) * 1977-08-03 1979-02-22 Basf Ag WINDING SHAFT FOR WINDING SEVERAL TAPES AT THE SAME TIME
JPS56169923A (en) * 1980-06-03 1981-12-26 Mitsubishi Electric Corp Digital low-pass filter device
GB8418504D0 (en) * 1984-07-20 1984-08-22 Fiamass Ltd Functional analysis

Also Published As

Publication number Publication date
ITRM910786A0 (en) 1991-10-16
CA2052600A1 (en) 1992-04-18
FR2668319B1 (en) 1994-01-28
GB2248954B (en) 1994-08-24
DE4134398C2 (en) 1996-02-15
FR2668319A1 (en) 1992-04-24
GB2248954A (en) 1992-04-22
ES2048066A2 (en) 1994-03-01
ITRM910786A1 (en) 1993-04-16
IT1250938B (en) 1995-04-22
GB9120778D0 (en) 1991-11-13
ES2048066B1 (en) 1996-07-01
ES2048066R (en) 1995-11-16
DE4134398A1 (en) 1992-04-23

Similar Documents

Publication Publication Date Title
US4216463A (en) Programmable digital tone detector
US4038539A (en) Adaptive pulse processing means and method
US4872127A (en) Ripple rejection filter
WO2008016982A2 (en) Self-adjusting hold-off trigger
CA2052600C (en) Adaptive bandwidth moving average filter
KR100221248B1 (en) Extensible median filter
US4606009A (en) Step responsive averaging filter
EP0297701B1 (en) Method for measuring pulse parameters
JPS6340367B2 (en)
US10797715B2 (en) Filtering method and filter
US5010507A (en) Sampled digital filter system
Mishkin et al. Identification and command problems in adaptive systems
JP2668721B2 (en) Limiter interpolation type DFT operation method
KR940013255A (en) How to generate a modified video signal
KR970002195B1 (en) Voice element removing device and its controlling method in a digital equipment
JP2990509B2 (en) Comb filter differentiator
US7031412B2 (en) Digital signal processing apparatus
KR100548800B1 (en) Digital filter
JP2000004147A (en) Device and method for eliminating noise, and recording medium
US6459752B1 (en) Configuration and method for determining whether the counter reading of a counter has reached a predetermined value or not
JPH07123220B2 (en) Digital pulse width detector
RU2042979C1 (en) Device for interpolation
KR100392337B1 (en) A circuits for generating minimum on/of pulse width
JP3043021B2 (en) Digital notch filter
US20020130971A1 (en) Device for reducing noise in image signals

Legal Events

Date Code Title Description
EEER Examination request
MKEX Expiry