A brief summary of several filters basic skills

Source: Internet
Author: User
Tags arithmetic

According to the related Materials on the Internet, a simple summary of several filtering methods is given below.


1. Amplitude-Limiting filter (Procedure judgment Filter method) A. Method: 1 According to experience judgment, determine the maximum deviation value (set to a) 2 allowed for two times sampling, and judge each new value when it detects: if the difference between this value and the last value is less than or equal to a, this value is valid if the difference between this and last value is greater than a, this value is invalid, discard this value, replace the value with the last value.
b A bit: can effectively overcome the impulsive interference caused by accidental factors
D Disadvantage: cannot restrain that kind of periodic interference, the smoothness degree is bad
Example: If used in wireless signals, can be used to filter the data collected in the room (for static environment data), the general benchmark data can be.

2. Median Filter method
A Methods: 1 continuous sampling n times (n take odd numbers), the N-time sampling values by size, take the median value for this valid value (using bubble sort can get a valid sort sequence)
C Advantages: It can effectively overcome the fluctuations caused by accidental factors, the temperature, liquid level changes slow to be measured parameters have a good filter effect
D Disadvantages: The flow rate, speed and other rapid changes in the parameters are not appropriate.
3. Arithmetic average filtering method
A                       Methods: The arithmetic average operation was taken by n sampling value, and the signal smoothness was higher when n value was large, but the sensitivity was low.                       When the n value is small, the signal smoothness is low, but the sensitivity is high. N-Value selection, general flow, n=12, pressure, n=4.
b It is suitable for filtering the signal with random interference, which is characterized by an average value, and the signal fluctuates up and down near a range of values.
C It is not suitable for real-time control with slower measuring speed or higher data calculation speed, which is more wasteful of memory. (The more sampling, whether the filtering accuracy will be better)
4. Recursive average filtering method (sliding average filtering method)
A Methods: The successive obtained n sampled values were considered as a queue, and the queue length was fixed to n. Each time a new data is sampled into the team's tail, and the original team's first data is discarded (FIFO principle) the arithmetic average operation of n data in the queue is obtained, and the new filtering result is gained.
N-Value selection: Flow n=12, pressure n=4, liquid level n=4-12, temperature n=1-4
b Advantages: It has good inhibitory effect on periodic interference, high smoothness, and is suitable for high frequency oscillation system.
C Disadvantages: Low sensitivity, the inhibition of accidental impulsive interference, it is not appropriate to eliminate the pulse interference caused by the sampling value deviation, not suitable for impulsive interference more serious occasions.


5 Median filtering method (anti-pulse interference average filter method) a. Methods: The maximum and minimum values were removed by a group of queues, which was equivalent to "median filtering method + arithmetic average filtering method". Sample n data continuously, remove a maximum value and a minimum value, and then calculate the arithmetic average of N-2 data. N-Value selection: 3-14.
b Advantages: It can eliminate the deviation of sampling value caused by accidental impulsive interference. Good inhibition of periodic interference, high smoothness, suitable for high-frequency vibration system.
C Disadvantage: The computation speed is slower, and the arithmetic average filter method is same

6. Amplitude-limiting average filtering method
A Methods: the amplitude-limiting processing was performed on each new data, then the average filter was processed in the feed queue. b Advantages: It combines the advantages of two filtering methods, and can eliminate the deviation of sampling value caused by impulsive interference for the occasional impulsive interference.
C Disadvantage: Compare wasted RAM
7. First-order hysteresis filtering method

A, Name: first-order hysteresis filtering method
B, Method:
Take a=0-1, this filter result = (1-a) * This sampling value +a* last filter result.
C, Advantages:
Has a good inhibitory effect on the periodic interference;
Suitable for occasions with high fluctuation frequency.
D, Disadvantages:
Phase lag, low sensitivity;
The degree of lag depends on the size of a value;
Can not eliminate the filtering frequency is higher than the sampling frequency 1/2 interference signal.
8, weighted recursive average filtering method
[Pre lang= "Arduino" line= "1"]/*
A, Name: Weighted recursive average filtering method
B, Method:
is the improvement of the recursive average filtering method, that is, the data at different times is different right;
Usually, the closer you get to the current moment of data, the greater the power gain.
The greater the weight coefficient given to the new sampling value, the higher the sensitivity, but the lower the smoothness of the signal.
C, Advantages:
It is suitable for objects with larger pure lag time constants and for systems with shorter sampling periods.
D, Disadvantages:
For the signal of small delay time constant, long sampling period and slow change;
The system can not quickly react to the severity of the current interference, the filter effect is poor.



9. Anti-chattering filtering method
[Pre lang= "Arduino" line= "1"]/*
A, Name: Anti-dither filtering method
B, Method:
Sets a filter counter that compares each sampled value to the current valid value:
If the sample value = Current valid value, the counter is 0;
If the sample value <> current valid value, counter +1, and determine whether the counter >= the upper limit n (overflow);
If the counter overflows, replace this value with the current valid value and clear the counter.
C, Advantages:
It has better filtering effect for the measured parameters with slow change.
&

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.