# noise_filter **Repository Path**: sunarvin/noise_filter ## Basic Information - **Project Name**: noise_filter - **Description**: Filter the noise in signals acquired - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-04-15 - **Last Updated**: 2021-09-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README There are always some noises when acquiring signals. This simple snippet code is used to filter these noises. Let's assume that you are using 5bits width. Here is an example to call the API: cur_bit &= 1; /* get current pin status */ bits = ((bits << 1) + cur_bit) & NF5_MASK; result = noise_filter(NF5_WIDTH, bits); The following images show the transition among statuses: ========================================================================= 3bits ![image](https://gitee.com/sunarvin/noise_filter/raw/main/images/3.png) ========================================================================= 4bits ![image](https://gitee.com/sunarvin/noise_filter/raw/main/images/4.png) ========================================================================= 5bits ![image](https://gitee.com/sunarvin/noise_filter/raw/main/images/5.png)