Dynamic filter

Abstract: Difficulty is experienced where filters are required to provide a high level of noise reduction and a fast step response in systems where a large input step in comparison to the final resolution may occur. A suitable filter comprises a variable length averaging filter, an averaging sample counter, the count of which is reduced by a predetermined factor when the count reaches a maximum value, and a spike counter, the count of which is incremented when the difference between an input sample and the current filter output exceeds a predetermined value, the sample count being reset to 1 when the spike count reaches a predetermined value, the filter output being otherwise maintained at the previous output.

Description: The present invention relates to a filter for electrical signals which is intended to provide a high level of noise reduction in the signal whilst still maintaining a fast step response. The filter has its primary application in systems which tend to experience relatively large step changes in the input signal in comparison to the final resolution of the signal required. Large in this context may be as little as I in 5000. According to the present invention there is provided a filter comprising a variable length quasi-average filter and a spike counter, the count of the spike counter being incremented when the difference between an input sample and the current filter output exceeds a predetermined value, the input sample being added to the filter and the averaging length of the variable length quasi-average filter being incremented at each input sample when the spike count is not incremented and being decreased by a predetermined factor when the averaging length reaches a maximum value, the averaging length being reset to 1 and the filter output set to the input sample when the spike count reaches a predetermined value, the filter output being otherwise maintained at the previous output. The present invention will now be described, by way of example, with reference to the accompanying drawings, in which:- Figure 1 shows a typical input signal divided into discrete samples; Figures 2A and 2B show the samples actually presented to the filters; Figures 3A and 3B show the filter outputs; Figures 2A, 3A and 2B, 3B relate to different filter constructions; Figure 4 represents an algorithm for carrying out the filter function. A filter according to the present invention may comprise three functional elements:- (1) A Variable Coefficient Digital Filter (VCDF); (2) Means to detect step changes and reject spikes; (3) Means to reduce the effects of ringing. Considering the input signal as shown in Figure 1, the signal is sampled as indicated by the vertical lines and is then input into the VCDF. The VCDF behaves initially as a variable length averaging filter. Each time a sample is input to the filter the length of the averaging stage is incremented. When the length of the averaging stage reaches a maximum value MAX_LENGTH then the averaging length is reduced by a factor REDUCTION. Before an input sample is presented to the input of the VCDF it is compared with the current output of the VCDF. If the difference between the input and the output exceeds a limit WINDOW_SIZE then it is assumed that either:- (a) A step change of input has occurred, or (b) An input spike has occurred. When the limit is exceeded, a spike_count is incremented. If the spike_count reaches a value MAX_STEP_DELAY, it is assumed that a step change of input has occurred and the VCDF is reset to an averaging length of 1. If the count has not reached MAX_STEP_DELAY then it is assumed that a spike may be present and hence the dynamic filter outputs the previous VCDF output and the input is 'thrown away'. If the input tends to ring after a step change, there is a risk of resetting the VCDF on each ringing cycle. This may be substantially reduced by dynamically altering the WINDOW_SIZE according to the size of the averaging stage, using a large window initially and gradually reducing the window as the length of the averaging increases. The effect of this is shown in Figures 2A, 2B, 3A and 3B. Figures 2A and 2B show in the full vertical lines the samples actually presented to the VCDF. The dotted lines show the samples 'thrown away' due to the 'spike count' not having reached MAX_STEP_DELAY and the change in the input having exceeded the WINDOW_SIZE. The window limits are indicated by dots above and below the input signal. Figures 3A and 3B show the resulting dynamic filter outputs. Figures 2A and 3A are for a fixed WINDOW_SIZE and Figures 2B and 3B are for a variable WINDOW_SIZE. Figure 4 shows an algorithm for the filter operation as described where the WINDOW_SIZE is fixed.

Claims: A filter comprising a variable length quasi-average filter and a spike counter, the count of the spike counter being incremented when the difference between an input sample and the current filter output exceeds a predetermined value, the input sample being added to the filter and the averaging length of the variable length quasi-average filter being incremented at each input sample when the spike count is not incremented and being decreased by a predetermined factor when the averaging length reaches a maximum value, the averaging length being reset to 1 and the filter output set to the input sample when the spike count reaches a predetermined value, the filter output being otherwise maintained at the previous output. A filter as claimed in Claim 1, wherein the predetermined value is reduced as the averaging length increases.

Inventors: EVANS JONATHAN PAUL, EVANS, JONATHAN PAUL
Applicants: GEC AVERY LTD, GEC AVERY LIMITED
Application year: 1994
Main classification: H03H17
IPC codes: H03H17