this is a digital intercom projects using ADC PWM and UART interrupt.
you take the value from mic enter it to ADC and then send serially to the other microcontroller which receives the data and transform the digital data into analog data by PWM which is connected to speaker
10种软件滤波方法的示例程序
1、限副滤波
/* A值可根据实际情况调整
value为有效值,new_value为当前采样值
滤波程序返回有效的实际值 */
#define A 10
char value
char filter()
{
char new_value
new_value = get_ad()
if ( ( new_value - value > A ) || ( value - new_value > A )
r ...