Program examples of filtering software

Publisher:以泉换泉Latest update time:2018-03-06 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  We can use the C language program code subroutine of the digital filtering method to complete the software filtering function. We assume that the data is read from the 8-bit AD. If it is a higher-bit AD, the data type can be defined as int, and the subroutine is defined as get_ad().
  
  (1) Arithmetic average filtering program, call the function get_ad() to read the data.

 

  (2) Determine the filtering program and call the data reading subroutine get_ad().

  (3) Sliding average filter method C language program, calling the data reading subroutine get_ad().

   (4) Median average filtering method C language program, calling the data reading sub-function get_ad().

  (5) Median filtering method: the N value can be adjusted according to the actual situation, and the sorting adopts the bubble method.

  This example mainly introduces the method and program of using single-chip microcomputer to realize software filtering. The sliding average filter method has a good inhibitory effect on periodic interference, high smoothness and low sensitivity, but it has a poor inhibitory effect on occasional pulse interference, and it is not easy to eliminate the deviation of the sampling value caused by pulse interference. Therefore, it is not suitable for occasions with serious pulse interference, but is more suitable for high-frequency oscillation systems.
  
  Arithmetic mean filtering cannot eliminate obvious pulse interference, but can only weaken its influence, so that the output value of the average filter is closer to the true value. The program judgment filtering method can effectively overcome the shortcomings of pulse interference caused by accidental factors, but it cannot suppress that kind of periodic interference and has poor smoothness.


Reference address:Program examples of filtering software

Previous article:Implementation of USB firmware design for single chip microcomputer
Next article:Nine simple digital filtering algorithms (C language source program)

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号