⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 equ_compu.c

📁 ADI公司的ADSP21065L的专业数字音频处理器的源代码
💻 C
字号:

#include <signal.h>
#include <def21065l.h>
#include <21060.h>
#include <signal.h>
#include <sport.h>
#include <macros.h>
#include <math.h>
#include <filters.h>
#include <trans.h>

#include "functions.h"
#include "myhead.h"

extern int RX_right_flag, RX_left_flag;
extern float sample;
extern float a_eq_1[3];
extern float b_eq_1[3];
extern float w_eq_1[3];
extern	float y0;
extern	float y1;
extern	float aa;

extern	float	v_gain;
extern	int		swith_com;
extern	float	g,fc,q;
void equ_compu(float fc,float g,float q,float *a_coeff,float *b_coeff)
//float *a_coeff,*b_coeff;
{
	float  a,b,c,e;
	float  Wn,Wp;
	float  gain;
	int     k,i;
	
	if(fc>Fs/2) fc=(float)(Fs/2);
	 
	if(g>=15)   g=15;
	else if(g<=-15)  g=-15;
	else g=g;
	 
	if(q>=1)    q=1;
	else if(q<=0.01) q=0.01;
	else q=q;
	
	gain=g/6.6;
	Wn=1/(2*PI*fc);
	Wp=(Wn/tanf(Wn/(2*Fs)));
	 
	a=Wn*Wn*Wp*Wp;
	b=(3+gain)*Wn*Wp*q;
	c=(3-gain)*Wn*Wp*q;
	e=1;
 
	*a_coeff=-(e-c+a)/(a+c+e);//a_eq_1[0]
	*(a_coeff+1)=-2*(e-a)/(a+c+e);//a_eq_1[1]
	*b_coeff=(e-b+a)/(a+c+e);//b_eq_1[0]
	*(b_coeff+1)=- * (a_coeff+1);//-a_eq_1[1];//2*(e-a)/(a+c+e);b_eq_1[1]
	*(b_coeff+2)=(e+b+a)/(a+c+e);//b_eq_1[2]
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -