1, limiting filter method (also called Program Judgment Filter)
A, method:
Based on experience, determine the maximum allowable deviation for two samples (set to a)
every time a new value is detected:
If the difference between this value and the last value is <=a, this value is valid
If the difference between this value and the last value >a, the value is invalid, discard this value, Replace the current value with the last value
B, advantages:
can effectively overcome the impulse interference caused by accidental factors
C, disadvantages
cannot suppress that periodic interference
smoothness difference
2, median filter
A, method:
continuous sampling n times (n odd)
Arrange the n sampling values by size
take intermediate values for this valid value
B, advantages:
can effectively overcome the fluctuations caused by accidental factors
the temperature, The measured parameters with slow change of liquid level have good filtering effect
C, disadvantage:
The fast changing parameters such as flow rate, speed, etc. are not appropriate
3, arithmetic average filter method
A, Method:
Arithmetic averaging operation by taking n sampled values continuously
Large n value: higher signal smoothness, but less sensitivity
When n values are small: signal smoothness is low, but sensitivity is high
N-Value selection: General flow, n=12; pressure: n=4
B, Advantages:
Suitable for filtering signals that generally have random disturbances
This signal is characterized by an average value, and the signal moves up and down near a range of values
C, Disadvantages:
Not suitable for real-time control with slow measurement or faster data calculation
Compare wasted Ram
4, recursive average filter method (also known as the sliding Average filter method)
A, Method:
Consider a sequential fetch of n sampled values as a queue
The queue length is fixed to n
Each time a new data is sampled, it is placed at the end of the queue and the first data of the original team is discarded. (Advanced first Out principle)
A new filtering result can be obtained by arithmetic averaging of n data in the queue.
N-Value selection: flow, n=12; pressure: n=4; liquid level, n=4~12; temperature, n=1~4
B, Advantages:
Good inhibition of periodic interference, high smoothness
Systems for high-frequency oscillation
C, Disadvantages:
Low sensitivity
Poor inhibition of occasional impulsive disturbances
It is not easy to eliminate the sampling value deviation caused by impulse interference
Not suitable for situations where pulse interference is more severe
Compare wasted Ram
5, median value averaging filter method (also known as anti-pulse interference averaging filter method)
A, Method:
Equivalent to "median filter" + "Arithmetic average filter"
Continuously samples n data, minus one maximum and one minimum value
Then calculate the arithmetic mean of the N-2 data
Selection of n values: 3~14
B, Advantages:
Combines the advantages of two filtering methods
For accidental impulse interference, the deviation of sampling value caused by impulse interference can be eliminated.
C, Disadvantages:
The measurement is slower, as is the arithmetic average filtering method
Compare wasted Ram
6, the limit amplitude average filter method
A, Method:
Equivalent to "amplitude-limiting filtering" + "recursive averaging filter"
Each new data sampled is limited to the first
Re-feed the queue for recursive averaging filter processing
B, Advantages:
Combines the advantages of two filtering methods
For accidental impulse interference, the deviation of sampling value caused by impulse interference can be eliminated.
C, Disadvantages:
Compare wasted Ram
7, first-order hysteresis filter method
A, Method:
Take a=0~1
This filter result = (1-a) * This sample value +a* the last filter result
B, Advantages:
Good inhibition of periodic disturbances
Suitable for occasions with high fluctuation frequency
C, Disadvantages:
Phase lag, low sensitivity
The degree of lag depends on the a value size
Interference signals with a filter frequency higher than 1/2 of the sampling frequency cannot be eliminated
8. Weighted recursive average filtering method
A, Method: Nanping private Detective
is the improvement of the recursive average filtering method, that is, the data of different moments have different weights
Usually, the closer the data is to the present moment, the greater the right to achieve.
The higher the weight coefficient of the new sampled value, the higher the sensitivity, but the lower the signal smoothness
B, Advantages:
For objects with large pure lag time constants
Systems with short sampling cycles
C, Disadvantages:
For low-latency constant, long sampling period, slow-changing signal
Cannot quickly react to the severity of the system's current interference, the filtering effect is poor
9, anti-shake filter method
A, Method:
Set up a filter counter
Compare each sample value to the current valid value:
If the sample value = Current valid value, the counter is zeroed
Counter +1 if the sample value <> current valid value, and determine if the counter is >= upper limit n (overflow)
If the counter overflows, replace this value with the current valid value and clear the counter
B, Advantages:
The measured parameters with slow change have better filtering effect,
Avoids repeated on/off runout of the controller near the critical value or numeric jitter on the monitor
C, Disadvantages:
For rapidly changing parameters, it is not advisable
If the value sampled at the time of the counter overflow happens to be a disturbance value, the interference value is imported as a valid value into the system
10. Amplitude-limiting anti-jitter filtering method
A, Method:
Equivalent to "amplitude-limiting filtering" + "anti-jitter filtering"
First limit amplitude, rear shake
B, Advantages:
Inherited the advantages of "limit" and "shake-out"
Some defects in the "chattering filtering" method are improved to avoid the introduction of interference values into the system.
C, Disadvantages:
For rapidly changing parameters, it is not advisable
Article from: Barmaton official website Yao Barmaton
10 kinds of software filtering methods