CN104660215A - Digital filtering method with low resource consumption - Google Patents

Digital filtering method with low resource consumption Download PDF

Info

Publication number
CN104660215A
CN104660215A CN201510090694.7A CN201510090694A CN104660215A CN 104660215 A CN104660215 A CN 104660215A CN 201510090694 A CN201510090694 A CN 201510090694A CN 104660215 A CN104660215 A CN 104660215A
Authority
CN
China
Prior art keywords
filtering
sampled value
sampling
sampling value
value
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
Application number
CN201510090694.7A
Other languages
Chinese (zh)
Other versions
CN104660215B (en
Inventor
刘宝军
张弢
王学东
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.)
SHENYANG NORTHEAST ELECTRIC POWER CONTROL CO Ltd
Original Assignee
SHENYANG NORTHEAST ELECTRIC POWER CONTROL CO Ltd
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 SHENYANG NORTHEAST ELECTRIC POWER CONTROL CO Ltd filed Critical SHENYANG NORTHEAST ELECTRIC POWER CONTROL CO Ltd
Priority to CN201510090694.7A priority Critical patent/CN104660215B/en
Publication of CN104660215A publication Critical patent/CN104660215A/en
Application granted granted Critical
Publication of CN104660215B publication Critical patent/CN104660215B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Feedback Control In General (AREA)
  • Complex Calculations (AREA)

Abstract

The invention relates to the field of industrial automatic control, in particular to a digital filtering method with low resource consumption. The method comprises steps as follows: filtering relevant parameters are set, a sampling value after each sampling is acquired through N times of sampling, and N is a natural number; when a first sampling value is detected, the first sampling value is directly used as first filtering output; as for sampling values excluding the first sampling value, whether a difference value between a current sampling value and the last sampling value is in a sampling value relative change range is judged; if yes, weighted average calculation is performed on the current sampling value and the last sampling value, and current filtering output is acquired; otherwise, the current sampling value is taken as the current filtering output or transferred to the next filtering output for calculation according to a processing strategy of sampling values beyond the normal range. The method has the advantages of small occupation resources and capability of preventing memory overflow and is applicable to small controllers and microcontrollers in most industrial environments.

Description

A kind of digital filtering method of low consumption of resources
Technical field
The present invention relates to field of industrial automatic control, be specifically related to a kind of digital filtering method of low consumption of resources, for carrying out digital filtering to the analog quantity collected.
Background technology
In field of industrial automatic control; due to the restriction of on-the-spot electromagnetic environment; the noise of varying number level often can be coupled in the in-site modeling amount signal of equipment; if do not carry out filtering process to analog signals; then can the performance of influential system and Control platform, hardware filtering or software filtering two kinds of modes usually can be adopted to carry out filtering process.
Namely hardware filtering adopts hardware filter, directly carries out filtering process to analog signals, and this mode is necessary, irreplaceable to only using the simple system of analog quantity circuit.But when sampling to Digital Control System, software can also be adopted representing that the sampled value of analog quantity information carries out filtering, i.e. digital filtering.For two kinds of filtering processing modes, hardware filtering real-time is good, but the hardware filter that hardware filtering adopts takies volume greatly, and can not adjust parameter flexibly; And the real-time of digital filtering is poorer than hardware filtering, but advantage does not need hardware filter, takes up room little, and can pass through the flexible adjustment of programming realization filtering parameter or even filter form.
Current digital filtering technique has a variety of, and have from simple arithmetic average value filtering (low-pass filtering) to the filtering of various complexity, these digital filtering techniques there are differences in performance and resource consumption.For adopting the system of small-sized or microcontroller, hardware resource (the CPU speed of service and storage resources) is not very abundant, and what usually adopt in practice is all low pass filter, i.e. various averaging filter.The arithmetic average value filtering of standard obtains one group of sampled value after carrying out N (N is natural number) secondary sampling continuously, get arithmetic mean acquired results to this group sampled value to export as filtering, although this method realizes simple, but the equivalent sampling rate that maximum negative interaction is the output of N sampling post filtering is only the 1/N of actual sample rate, according to sampling thheorem, in order to ensure that signal is undistorted, sample rate should be more than or equal to 2 times of signal highest frequency, and this arithmetic average value filtering is subject to the restriction of hardware resource, the filtering of very large time constant cannot be done.A kind of average value filtering method of improvement is sliding window average value filtering method, maintenance length is needed to be the one dimension form of N in the method, i.e. history samples record sheet, for the N number of continuous print sampled value of buffer memory, arithmetic average calculating is carried out to the data in one dimension form, adopts the data in first-in first-out form renewal one dimension form, namely often complete and once sample, then current sample values is added in one dimension form, and the sampled value joined the earliest in one dimension form is shifted out.This solves the problem that equivalent sampling rate declines, but protect history samples record sheet due to needs volume, so resource consumption is larger, especially when needs carry out the filtering compared with large time constant.
Summary of the invention
In view of this, the invention provides a kind of digital filtering method of low consumption of resources, solve the problem that balances between analog quantity low-pass filter effect in the industrial equipment automatic control process that little microcontroller realizes and resource occupation.
For solving the problem, technical scheme of the present invention is achieved in that
A digital filtering method for low consumption of resources, comprises the steps:
Step 101: filtering relevant parameter is set, and the sampled value of each sampling is obtained by N sampling, relevant parameter comprises filtering space, sampled value weight, sampled value relative variation ranges and exceeds normal range (NR) sampled value processing policy, wherein exceeding normal range (NR) sampled value processing policy is logical data, and filtering space is natural number N;
Step 102: when detect first sampled value time, then directly will first sampled value export as filtering first;
Step 103: for the sampled value except sampled value first, judges difference between this sampled value and last time sampled value whether in sampled value relative variation ranges; If so, then carry out step 104, otherwise carry out step 105;
Step 104: export according to this filtering of following formulae discovery:
A a = A al ( N - b ) + A N b N = A al + ( A N - A al ) b N
Wherein, A afor this filtering exports, A a1for filtering last time exports, A nfor this sampled value, b is sampled value weight;
Step 105: if exceed the value of normal range (NR) sampled value processing policy for " 1 ", then this sampled value is exported as this filtering; If be " 0 ", then proceed to the calculating that next filtering exports.
Preferably, also comprise after step 101: the step of on-line tuning filtering relevant parameter.
The invention provides a kind of digital filtering method of low consumption of resources, sampling this method carries out filtering, when filtering space is identical, the smoothness effect of this method is about 2 times of sliding window average value filtering method, meanwhile, this method only needs record last time and this sampled value, and last time exports with this filtering, take 4 memory variables, take resource little; Amount of calculation is only a subtraction, multiplication, a division and a sub-addition, or using b/N as a parameter, and only calculate subtraction, a multiplication and a sub-addition; And owing to not needing maintenance history sample record table, therefore can change filtering space neatly as required, and not worry the problem that internal memory overflows.Be suitable for little, the microcontroller application under most industry environment.
Accompanying drawing explanation
Fig. 1 is method flow diagram of the present invention.
Embodiment
For make the object, technical solutions and advantages of the present invention clearly, understand, below in the process of the present invention in " draw gas regulating valve controller " be applied as embodiment and with reference to accompanying drawing, the present invention is described in more detail.
A kind of mode of operation of regulating valve of drawing gas is " far control ", namely the regulating valve that draws gas is controlled by analog quantity " control command " by Central Control Room, the regulating valve controller that draws gas accepts " control command " from Central Control Room and the analog quantity " valve position feedback signal " detected in real time from the regulating valve that draws gas, and carries out control treatment.Because these two signals are all analog quantitys, in transmitting procedure, be inevitably subject to various interference, therefore must carry out filtering process.
After the present invention is used for each sampling, judging sampled value by the flow process shown in Fig. 1 and process, concrete steps are as follows:
Step 101: filtering relevant parameter is set, and the sampled value of each sampling is obtained by N sampling, relevant parameter comprises filtering space, sampled value weight, sampled value relative variation ranges and exceeds normal range (NR) sampled value processing policy, wherein exceeding normal range (NR) sampled value processing policy is logical data, i.e. " 1 " or " 0 ", filtering space is natural number N;
Step 102: when detect first sampled value time, then directly will first sampled value export as filtering first;
Step 103: for the sampled value except sampled value first, judges difference between this sampled value and last time sampled value whether in sampled value relative variation ranges; If so, then carry out step 104, otherwise carry out step 105;
Step 104: export according to this filtering of following formulae discovery:
A a = A al ( N - b ) + A N b N = A al + ( A N - A al ) b N
Wherein, A afor this filtering exports, A a1for filtering last time exports, A nfor this sampled value, b is sampled value weight;
Step 105: if exceed the parameter value of normal range (NR) sampled value processing policy for " 1 ", then this sampled value is exported as this filtering; If be " 0 ", then proceed to the calculating that next filtering exports, namely repeat step 103 to step 105, until the N time sampled value has carried out filtering export calculating.
In order to carry out on-line parameter adjustment, also comprising after step 101: the step of on-line tuning filtering relevant parameter, if namely user has parameter modification authority, then opening parameter modification interface, after user's amendment, upgrade filtering relevant parameter.
The above, be only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.

Claims (2)

1. a digital filtering method for low consumption of resources, is characterized in that, comprises the steps:
Step 101: filtering relevant parameter is set, and the sampled value of each sampling is obtained by N sampling, relevant parameter comprises filtering space, sampled value weight, sampled value relative variation ranges and exceeds normal range (NR) sampled value processing policy, wherein exceeding normal range (NR) sampled value processing policy is logical data, and filtering space is natural number N;
Step 102: when detect first sampled value time, then directly will first sampled value export as filtering first;
Step 103: for the sampled value except sampled value first, judges difference between this sampled value and last time sampled value whether in sampled value relative variation ranges; If so, then carry out step 104, otherwise carry out step 105;
Step 104: export according to this filtering of following formulae discovery:
A a = A a 1 ( N - b ) + A N b N = A a 1 + ( A N - A a 1 ) b N
Wherein, A afor this filtering exports, A a1for filtering last time exports, A nfor this sampled value;
Step 105: if exceed the value of normal range (NR) sampled value processing policy for " 1 ", then this sampled value is exported as this filtering; If be " 0 ", then proceed to the calculating that next filtering exports.
2. the digital filtering method of low consumption of resources according to claim 1, is characterized in that, also comprises after step 101: the step of on-line tuning filtering relevant parameter.
CN201510090694.7A 2015-02-26 2015-02-26 A kind of digital filtering method of low consumption of resources Active CN104660215B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510090694.7A CN104660215B (en) 2015-02-26 2015-02-26 A kind of digital filtering method of low consumption of resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510090694.7A CN104660215B (en) 2015-02-26 2015-02-26 A kind of digital filtering method of low consumption of resources

Publications (2)

Publication Number Publication Date
CN104660215A true CN104660215A (en) 2015-05-27
CN104660215B CN104660215B (en) 2017-08-25

Family

ID=53250977

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510090694.7A Active CN104660215B (en) 2015-02-26 2015-02-26 A kind of digital filtering method of low consumption of resources

Country Status (1)

Country Link
CN (1) CN104660215B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107064312A (en) * 2017-04-18 2017-08-18 南通友联数码技术开发有限公司 It is a kind of to be used for the quick and smooth filtering method of ultrasonic detection

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101188410A (en) * 2007-11-27 2008-05-28 上海工业自动化仪表研究所 One-order lag digital filtering algorithm for intelligent transformer
CN101977033A (en) * 2010-11-09 2011-02-16 中天启明石油技术有限公司 Digital filtering method for underground instrument signal transmission
CN102355230A (en) * 2011-07-05 2012-02-15 中兴通讯股份有限公司 Digital filtering apparatus and method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101188410A (en) * 2007-11-27 2008-05-28 上海工业自动化仪表研究所 One-order lag digital filtering algorithm for intelligent transformer
CN101977033A (en) * 2010-11-09 2011-02-16 中天启明石油技术有限公司 Digital filtering method for underground instrument signal transmission
CN102355230A (en) * 2011-07-05 2012-02-15 中兴通讯股份有限公司 Digital filtering apparatus and method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
胡家华 等: "《现代测控技术》", 31 December 2012 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107064312A (en) * 2017-04-18 2017-08-18 南通友联数码技术开发有限公司 It is a kind of to be used for the quick and smooth filtering method of ultrasonic detection

Also Published As

Publication number Publication date
CN104660215B (en) 2017-08-25

Similar Documents

Publication Publication Date Title
CN108875710B (en) Elevator door running speed estimation method based on energy threshold algorithm
CN104992164B (en) A kind of dynamic oscillation signal model parameters discrimination method
CN106532969B (en) The circuit structure that fsk signal efficiently demodulates is realized in wireless charging device
CN108168680A (en) A kind of dynamic weighing filtering method and its system
CN110687791B (en) Nonlinear oscillation detection method based on improved adaptive frequency modulation modal decomposition
CN104660215A (en) Digital filtering method with low resource consumption
CN104569675B (en) Flicker detection circuit and detection method in electric energy metering chip
CN109214318A (en) A method of finding the faint spike of unstable state time series
Kao et al. On robust stability of aperiodic sampled-data systems-an integral quadratic constraint approach
CN106053936B (en) A kind of method and system obtaining electrical signal instantaneous frequency
CN115328093B (en) Safety state estimation method of double-time scale industrial information physical system
CN110435589A (en) A method of based on bluetooth close to realization electric vehicle locking
Huselstein et al. An approach to continuous-time model identification from non-uniformly sampled data
US20200228945A1 (en) Data processing device, data analyzing device, data processing system and method for processing data
CN112422212B (en) Data self-adaptive wireless communication channel prediction method, storage medium and equipment
Parashar et al. Analytical approach for analyzing quantization noise effects on decision operators
CN103630744A (en) PMU phase angle detection method and system
CN114118676A (en) Data analysis method and device based on multi-type sensing equipment and readable medium
CN110702972A (en) Adaptive sampling method and device for analog signals
CN207460228U (en) The circuit structure that fsk signal efficiently demodulates is realized in wireless charging device
WO2014184263A1 (en) Integration platform monitoring
Wang et al. Design and Implementation of Strong Tracking Combined Filtering Algorithm for MEMS Gyroscope
WO2015017139A1 (en) Method of detecting oscillations using coherence
CN109857973A (en) Infrared data filtering method and device
CN117221075B (en) Discrete networking system fault detection method based on self-adaptive event trigger mechanism

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20150527

Assignee: SHENYANG NAISI CONTROL TECHNOLOGY CO.,LTD.

Assignor: SHENYANG NORTHEAST ELECTRIC POWER CONTROL Co.,Ltd.

Contract record no.: X2023210000146

Denomination of invention: A Low Resource Consumption Digital Filtering Method

Granted publication date: 20170825

License type: Common License

Record date: 20230927