Post Go back to editing

自己写的DSP代码

#include "def21375.h"

#include "sru21375.h"

#define In_Bit          -31

#define Out_Bit          31

#define D1_L0                429               // = 266 @ 29761 Hz Fs

#define D2_L0               4797          // = 2974 @ 29761 Hz Fs

#define D3_L0               3085          // = 1913 @ 29761 Hz Fs

#define D4_L0               3219          // = 1996 @ 29761 Hz Fs

#define D5_L0               3210          // = 1990 @ 29761 Hz Fs

#define D6_L0               302               // = 187 @ 29761 Hz Fs

#define D7_L0               1719          // = 1066 @ 29761 Hz Fs      

// reverb right channel 0 output taps at 48 kHz fs

#define D1_R0               569               // = 353 @ 29761 Hz Fs

#define D2_R0               5849          // = 3627 @ 29761 Hz Fs

#define D3_R0               1981          // = 1228 @ 29761 Hz Fs

#define D4_R0               4311          // = 2673 @ 29761 Hz Fs

#define D5_R0               3404          // = 2111 @ 29761 Hz Fs

#define D6_R0               540               // = 335 @ 29761 Hz Fs

#define D7_R0               195               // = 121 @ 29761 Hz Fs

// reverb left channel 1 output taps at 48 kHz fs

#define D1_L1               329          

#define D2_L1               2797     

#define D3_L1               1085     

#define D4_L1               2219     

#define D5_L1               2210     

#define D6_L1               102          

#define D7_L1               719     

// reverb right channel 1 output taps at 48 kHz fs

#define D1_R1               369          

#define D2_R1               2627     

#define D3_R1               1228     

#define D4_R1               1673     

#define D5_R1               2311     

#define D6_R1               340               

#define D7_R1               95     

#define     allpass_Dline1          2168               // = 1344 @ 29761 Hz Fs

#define     allpass_Dline2          2930               // = 1816 @ 29761 Hz Fs      

#define     ALLPASS1_LENGTH          229                    // = 142 @ 29761 Hz Fs

#define     ALLPASS2_LENGTH          172                    // = 107 @ 29761 Hz Fs

#define     ALLPASS3_LENGTH          611                    // = 379 @ 29761 Hz Fs

#define     ALLPASS4_LENGTH          447                    // = 277 @ 29761 Hz Fs

#define     ALLPASS5_LENGTH          2168/2//1301///2//1301////1518///

#define     ALLPASS6_LENGTH          2930/2//1758///2//1758////2051//

#define     ALLPASS7_LENGTH          2903               // = 1800 @ 29761 Hz Fs

#define     ALLPASS8_LENGTH          4284               // = 2656 @ 29761 Hz Fs

#define     D_Line1                    7182               // = 4453 @ 29761 Hz Fs

#define     D_Line2                    6000               // = 3720 @ 29761 Hz Fs

#define     D_Line3                    6801               // = 4217 @ 29761 Hz Fs

#define D_Line4                    5101               // = 3163 @ 29761 Hz Fs

#define D_PDel              4800

//#define D_CLIP0             0.98

#define D_CLIP1             0x7ffffffe//0x7ffffeff;//0x7D70A3D6//0x7ffffff8//0x7ffffff8//

.extern  _FBX0Init;

.extern  _FBX0;

.extern   FBX0_In;

.extern   FBX0_Out;

.extern      DigitalReverberator;

.extern      InitReverb_Buffers;

.extern   Rev_In;

.extern   Rev_L_Out;

.extern   Rev_R_Out;

.extern   Rev_SL_Out;

.extern   Rev_SR_Out;

.extern      _Echo;

.extern  _EchoInit;

.extern   Echo_In;

.extern   Echo_Out;

.extern   Echo_Main_L_Out;

.extern   Echo_Main_R_Out;

.extern   Echo_SL_Out;

.extern   Echo_SR_Out;

.extern  biquadvec;

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   外部引用函数声名   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

.global _main;

.global _talkThroughISR;

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%系统缓冲%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%系统缓冲%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%系统缓冲%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

//.section/dm seg_dm32D;

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%算法临时变量%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%算法临时变量%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%算法临时变量%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

.section/dm seg_dm48D;

.var   ADC_In;

.var   ADC_In1;

.var  AdcDelay[66];

.var  AdcDelay_ptr = AdcDelay;

//=================================反馈抑制=======================================

.var   FBX0_In;

.var   FBX0_Out;

.var   FBX0w1[999];

//================================燥声门=======================================

.var   Noise_Gate0_In  = 0.0;

.var   Noise_Gate0_Rms = 0.0;

.var   Noise_Gate0_Out = 0.0;

     

//===============================麦克风参量========================================

.var Mic_PEQ_In;

.var Mic_PEQ_Out;

.var Mic_PEQ_State[15*2+1]=

{

     0,  0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0

};

.var Mic_Echo_PEQ_In;

.var Mic_Echo_PEQ_Out;

.var Mic_Echo_PEQ_State[5*2+1]=

{

     0,  0,0, 0,0, 0,0, 0,0, 0,0     

};

.var Mic_Rev_PEQ_In;

.var Mic_Rev_PEQ_Out;

.var Mic_Rev_PEQ_State[5*2+1]=

{

     0,  0,0, 0,0, 0,0, 0,0, 0,0     

};

//============================回声====================================

.var   Echo_feedback_state  = 0.0;

.var   Echo_In  = 0.0;

.var   Echo_Out  = 0.0;

.var   Echo_Main_L_Out  = 0.0;

.var   Echo_Main_R_Out  = 0.0;

.var   Echo_SL_Out  = 0.0;

.var   Echo_SR_Out  = 0.0;

//=============================混响===================================

.var   Rev_In;

.var   Rev_L_Out;

.var   Rev_R_Out;

.var   Rev_SL_Out;

.var   Rev_SR_Out;

.var   comb1_feedback_state;

.var   comb2_feedback_state;

.var   comb3_feedback_state;

.var   recirculate1_feedback;

.var   recirculate2_feedback;

.var   diffusion_result;

.var   predelay_output;

.var   reverb_left0;

.var   reverb_right0;

.var   reverb_left1;

.var   reverb_right1;

.var   L0rev_output_taps[6];

.var   R0rev_output_taps[6];

.var   L1rev_output_taps[6];

.var   R1rev_output_taps[6];

.var   holdtank_input1;

.var   holdtank_input2;

//===============================话筒混合输出======================================

.var   Mic_Main_LOut;

.var   Mic_Main_ROut;

.var   Mic_C_Out;

.var   Mic_SW_Out;

.var   Mic_SL_LOut;

.var   Mic_SR_ROut;

//================================音乐参量========================================

.var Music_L_PEQ_In;

.var Music_L_PEQ_Out;

.var Music_L_PEQ_State[10*2+1]=

{

     0,  0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0     

};

.var Music_R_PEQ_In;

.var Music_R_PEQ_Out;

.var Music_R_PEQ_State[10*2+1]=

{

     0,  0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0     

};

//================================多通道参量========================================

.var ML_Ch_PEQ_In;

.var ML_Ch_PEQ_Out;

.var ML_Ch_PEQ_State[10*2+1]=

{

     0,  0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0                    

};

.var MR_Ch_PEQ_In;

.var MR_Ch_PEQ_Out;

.var MR_Ch_PEQ_State[10*2+1]=

{

     0,  0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0                    

};

.var C_Ch_PEQ_In;

.var C_Ch_PEQ_Out;

.var C_Ch_PEQ_State[10*2+1]=

{

     0,  0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0                    

};

.var SW_Ch_PEQ_In;

.var SW_Ch_PEQ_Out;

.var SW_Ch_PEQ_State[10*2+1]=

{

     0,  0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0                    

};

.var SL_Ch_PEQ_In;

.var SL_Ch_PEQ_Out;

.var SL_Ch_PEQ_State[10*2+1]=

{

     0,  0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0                    

};

.var SR_Ch_PEQ_In;

.var SR_Ch_PEQ_Out;

.var SR_Ch_PEQ_State[10*2+1]=

{

     0,  0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0                    

};

.var   Main_Mix_LOut = 0.0;

.var   Main_Mix_ROut = 0.0;

.var   C_Mix_Out     = 0.0;

.var   SW_Mix_Out    = 0.0;

.var   SL_Mix_LOut   = 0.0;

.var   SR_Mix_ROut   = 0.0;

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%系数变量%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%系数变量%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%系数变量%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

.section/dm seg_dm32C;

//=================================通讯缓冲与临时变量========================================

.var  SPI_R_DMA[16]=0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0;

.var  SPI_temp = 0;

.var  SPI_TAG  = 0;

//=================================ADC _ DAC DMA缓冲区============================================

.var rx0a_buf[2];   // SPORT0 接收缓冲 A (DMA) 用作话筒输入

.var rx0b_buf[2];   // SPORT0 接收缓冲 B (DMA) 用作音乐输入

//.var rx1a_buf[2];   // SPORT1 接收缓冲 A (DMA) 用作数字输入

//.var rx1b_buf[2];   // SPORT1 接收缓冲 B (DMA) 用作数字输入

.var rx0a_tcb[4]   =  0, 2, 1, rx0a_buf;  // SPORT0 接收tcb_a

.var rx0b_tcb[4]   =  0, 2, 1, rx0b_buf;  // SPORT0 接收tcb_b

//.var rx1a_tcb[4]   =  0, 2, 1, rx1a_buf;  // SPORT1 接收tcb_a

//.var rx1b_tcb[4]   =  0, 2, 1, rx1b_buf;  // SPORT1 接收tcb_b

//==============================================---输入延时=================================================

.var  AdcDelayOut;

//==============================================话筒反馈抑制系数============================================

.var    FBX0_rate    = 139; //128

.var    FBX0_rate1   = 860;// FBX0_rate1 = 888 - FBX0_rate   7hz

.var    FBX0_Switch  = 0;

.var    FBX0_Addr    = FBX0w1;

.var    FBX0_counter = 0;//0xbaffffff;//

.var    FBX0_Num     = 0;

.var    FBX0_FLAG    = 0;//0x57ffff;//

.var    FBX0_inc     = 1;

//===================================================燥声门=================================================

.var    Noise_Gate0_threshold =  0.000000018;          

.var    Noise_Gate0_Open_Time  = 0;

.var    Noise_Gate0_Close_Time = 3888;

.var    Noise_Gate0_Time0 = 0;

.var    Noise_Gate0_Time1 = 0;

//================================================话筒参量系数===============================================

.var   Mic_PEQ_Sections = 15;//15;

.var   Mic_PEQ_coeffs[15 * 5 ] =

{

//    B2,                 B1,               B0,            A2,             A1

//0.0144104957580,0.0288209915161,0.0144104957580,-0.691665291786,1.63402318954, //2k LPF

//0.664677500724,-1.69868814945,1.09393382072,-0.758611440658,1.69868814945,        //2k PEQ +5db

//1.13898932933,-2.74164867401, 1.67486667633 ,-0.598148584365,1.52594125270,  //2K HS +5db

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000

};

.var   Mic_Echo_PEQ_Sections = 5;//5;

.var   Mic_Echo_PEQ_coeffs[5*5] =

{      

//    B2,       B1,        B0,         A2,         A1

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000

};

.var   Mic_Rev_PEQ_Sections = 5;//5;

.var   Mic_Rev_PEQ_coeffs[5*5] =

{

//    B2,       B1,        B0,         A2,         A1

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000

};

//============================================回声系数===============================================

.var   EchoAddr       = EcohDeley;

.var   EcohInVol      = 1.0;//

.var   EcohRep        = 0.81;//

.var   EcohDel        = 9018;//

.var   EcohMainLDel   = 3000;//

.var   EcohMainRDel   = 6000;//

.var   EcohSLDel      = 6000;//

.var   EcohSRDel      = 6000;//

.var   Echo_bandwidth = 0.93;

.var   EcohOVol       = 0.0;//

.var   EchoMainVol    = 0.0;

.var   EchoSLRVol     = 0.0;

//============================================混响系数===============================================

.var   Predel_ptr    = Predelay;

.var   decay             = 0.83;      // 混响时间

.var   bandwidth         = 0.0001;                                                       

.var   damping           = 0.0001;              // 高频阻尼; 无阻尼 = 0.0

.var   predelay_time     = 0;

.var   input_diffusion_1 = 0.75;      //  = 0.75, 解相关的输入信号  My = 0.615;

.var   input_diffusion_2 = 0.625;    //  = 0.625,解相关的输入信号  My = 0.615;

.var   all_pass_ptr1 = diffuser_1;   //  衰减扩散 2 = 衰减 +0.15, 地板 = 0.25, 天花板 - 0.50

.var   all_pass_ptr2 = diffuser_2;

.var   all_pass_ptr3 = diffuser_3;

.var   all_pass_ptr4 = diffuser_4;

.var   decay_diffusion_1 = 0.70;      //  = 0.70, 控制尾音的密度  My = 0.615;

.var   decay_diffusion_2 = 0.50;      //  = 0.50, 解相关水箱信号       My = 0.615;

.var   all_pass_ptr5 = decay_diffuser_A1;

.var   RevW1_ptr     = RevW1;

.var   all_pass_ptr6 = decay_diffuser_A2;

.var   RevW2_ptr     = RevW2;

.var   all_pass_ptr7 = decay_diffuser_B1;

.var   RevW3_ptr     = RevW3;

.var   all_pass_ptr8 = decay_diffuser_B2;

.var   RevW4_ptr     = RevW4;

                              

.var   RevOut        = 0.0;

          

//=============================================话筒音量系数===========================================

.var    MicBBEVol     = 1.0;//2.188;

.var    MicEffVol     = 1.0;

//=============================================话筒混合系数===========================================

.var    Main_Mic_Z_Vol      = 1.0;

.var    Main_Mic_Echo_Vol   = 1.0;

.var    Main_Mic_EchoS_Vol  = 1.0;

.var    Main_Mic_Rev_Vol    = 1.0;

.var    SLR_Mic_Z_Vol       = 1.0;

.var    SLR_Mic_Echo_Vol    = 1.0;

.var    SLR_Mic_EchoS_Vol   = 1.0;

.var    SLR_Mic_Rev_Vol     = 1.0;

.var    C_Mic_Z_Vol         = 1.0;

.var    C_Mic_Echo_Vol      = 1.0;

.var    C_Mic_EchoS_Vol     = 1.0;

.var    C_Mic_Rev_Vol       = 1.0;

.var    SW_Mic_Z_Vol        = 1.0;

//==============================================话筒压缩系数=============================================

.var    MicVol                 = 0.88;

.var     Mic_compress_threshold = 1.0;

.var     Mic_compress_ratio     = 0.1;

.var     Mic_compress_OffOn     = 0;

//=============================================音乐参量系数===========================================

.var Music_PEQ_Sections  = 10;//10;

.var Music_PEQ_coeffs[10*5]=

{

//    B2,       B1,        B0,         A2,         A1

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000

};

//=============================================话筒音乐混合系数===========================================

.var    MusicVol           = 0.18;  //音乐音量

.var    Main_Music_Vol     = 1.0;

.var    SLR_Music_Vol      = 1.0;

.var    C_Music_Vol        = 1.0;

.var    SW_Music_Vol       = 1.0;

//=============================================通道参量系数===========================================

.var  MLR_Ch_PEQ_Sections = 10;//;10;

.var  MLR_Ch_PEQ_coeffs[10*5]=

{

//    B2,       B1,        B0,         A2,         A1

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000

};

.var  C_Ch_PEQ_Sections = 10;//10;

.var  C_Ch_PEQ_coeffs[10*5]=

{

//    B2,       B1,        B0,         A2,         A1

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000

};

.var  SW_Ch_PEQ_Sections = 10;//10;

.var  SW_Ch_PEQ_coeffs[10*5]=

{

//    B2,       B1,        B0,         A2,         A1

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000

};

.var  SLR_Ch_PEQ_Sections = 10;//10;

.var  SLR_Ch_PEQ_coeffs[10*5]=

{

//    B2,       B1,        B0,         A2,         A1

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000,

0.00000000,0.00000000, 1.0000000000 ,0.00000000,0.00000000

};

//=============================================通道压限系数===========================================

.var  Main_Channel_threshold        = 1.00;

.var  Main_Channel_ratio            = 0.5;

.var  Main_Channel_Compress_Off_On  = 0;

.var  C_Channel_threshold           = 1.00;

.var  C_Channel_ratio               = 0.5;

.var  C_Channel_Compress_Off_On     = 0;

.var  SW_Channel_threshold          = 1.00;

.var  SW_Channel_ratio              = 0.5;

.var  SW_Channel_Compress_Off_On    = 0;

.var  SLR_Channel_threshold         = 1.00;

.var  SLR_Channel_ratio             = 0.5;

.var  SLR_Channel_Compress_Off_On   = 0;

//==============================================通道延时系数===========================================

.var  Main_Delay_L_Addr =D_Main_Delay_L;

.var  Main_Delay_L = 0;

.var  Main_Delay_R_Addr =D_Main_Delay_R;

.var  Main_Delay_R = 0;

.var  SW_Delay_Addr     =D_SW_Delay;

.var  SW_Delay     = 0;

.var  C_Delay_Addr      =D_C_Delay;

.var  C_Delay      = 0;

.var  Aux_Delay_L_Addr  =D_Aux_Delay_L;

.var  Aux_Delay_L  = 0 ;

.var  Aux_Delay_R_Addr  =D_Aux_Delay_R;

.var  Aux_Delay_R  = 0;

.var tx2a_buf[2];   // SPORT2 发送缓冲 A (DMA) 用作DAC0 存放L+R

.var tx2b_buf[2];   // SPORT2 发送缓冲 B (DMA) 用作DAC1 存放L+R

.var tx3a_buf[2];   // SPORT3 发送缓冲 A (DMA) 用作DAC2 存放L+R

//.var tx3b_buf[2];   // SPORT3 发送缓冲 B (DMA) 用作DAC3 数字输出

.var tx2a_tcb[4]   =  0, 2, 1, tx2a_buf;  // SPORT3 发送tcb_a

.var tx2b_tcb[4]   =  0, 2, 1, tx2b_buf;  // SPORT3 发送tcb_b

.var tx3a_tcb[4]   =  0, 2, 1, tx3a_buf;  // SPORT4 发送tcb_a

//.var tx3b_tcb[4]   =  0, 2, 1, tx3b_buf;  // SPORT4 发送tcb_b

.var   MainLOut = 0.0;

.var   MainROut = 0.0;

.var   COut     = 0.0;

.var   SWOut    = 0.0;

.var   SLOut   = 0.0;

.var   SROut   = 0.0;

//

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%延时外部内存%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%延时外部内存%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%延时外部内存%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

.section/dm seg_extsdram;

//=====================================================================

.var  EcohDeley[12818];

//=====================================================================

.var  Predelay[D_PDel];

.var  diffuser_1[ALLPASS1_LENGTH];

.var  diffuser_2[ALLPASS2_LENGTH];

.var  diffuser_3[ALLPASS3_LENGTH];

.var  diffuser_4[ALLPASS4_LENGTH];

.var  decay_diffuser_A1[ALLPASS5_LENGTH];     // 全通扩散器 同 可变延时

.var  RevW1[D_Line1];

.var  decay_diffuser_B1[ALLPASS6_LENGTH];     // 全通扩散器 同 可变延时

.var  RevW2[D_Line2];

.var  decay_diffuser_A2[ALLPASS7_LENGTH];     

.var  RevW3[D_Line3];

.var  decay_diffuser_B2[ALLPASS8_LENGTH];

.var  RevW4[D_Line4];

//====================================================================

.var  D_Main_Delay_L[3848];

.var  D_Main_Delay_R[3848];

.var  D_SW_Delay[3848];

.var  D_C_Delay[3848];

.var  D_Aux_Delay_L[3848];

.var  D_Aux_Delay_R[3848];

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    程序      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

.section/code seg_pmco;

_main:

    //=============================设置系统时钟========================================

    //ustat1 = PLLM32|INDIV|DIVEN;

    ustat1 = PLLM16|PLLD1|DIVEN;

changePLL:

    //设置核心时钟(CCLK)的 Set the Core clock (CCLK) to SDRAM clock (SDCLK) ratio to 2

    bit set ustat1 SDCKR2;

    dm(PMCTL) = ustat1;

    bit set ustat1 PLLBP;

    bit clr ustat1 DIVEN;

    dm(PMCTL) = ustat1;

    //等待5000个循环

    lcntr = 5000, do loopend2 until lce;

loopend2:     nop;

    ustat1 = dm(PMCTL);

    bit clr ustat1 PLLBP;

    dm(PMCTL) = ustat1;   //以上程序达到预期

    dm(PMCTL) = ustat1;   //以上程序达到预期  

   

    //要将下面的程序进行变更设定

    // 编程SDRAM控制寄存器。

    // RDIV = ((f SDCLK X t REF )/NRA) - (tRAS + tRP )

    // CCLK_SDCLK_RATIO==2

    // ===============================================================

    // RDIV         11-0位    刷新分频记数

    // SDROPT         16位    读优化

    // SDMODIFY   20–17位    修改 优化读寻址

       

    ustat4 = 0x7F7; // (131.072(10^6)64*(10^-3)/4096) - (6+3) = 2039

    //ustat4 = 0x777; // (122.280(10^6)64*(10^-3)/4096) - (6+3) = 1911

    //===================================================================

    //

    // 配置 SDRAM 控制寄存器 (SDCTL) 对于美光科技公司的 MT48LC8M16

    //

    //  SDCL3  : SDRAM CAS延迟 = 3 cycles

    //  DSDCLK1: 关闭  SDRAM Clock 1

    //  SDPSS  : 开始SDRAM上电序列

    //  SDCAW9 : SDRAM 银行列地址宽度 = 9 bits

    //  SDRAW12: SDRAM 行地址宽度     = 12 bits

    //  SDTRAS7: SDRAM tRAS 规范。 激活命令延迟  = 6 cycles

    //  SDTRP3 : SDRAM tRP  规范。 预充电延迟    = 3 cycles.

    //  SDTWR2 : SDRAM tWR  规范。 tWR           = 2 cycles.

    //  SDTRCD3: SDRAM tRCD 规范。 tRCD          = 3 cycles.

    //  X16DE  : SDRAM 外部总线宽度 = 16 位宽

    //----


    ustat1 = SDNOBSTOP|SDCL3|DSDCLK1|SDPSS|SDCAW9|SDRAW12|SDTRAS6|SDTRP3|SDTWR2|SDTRCD3|X16DE;

    dm(SDCTL) = ustat1;

    // 将此值更改优化性能类似连续访问(步 >1)

    #define SDMODIFY 1                    // 修改设置1

    bit set ustat4 (SDMODIFY<<17)|SDROPT; // 启用SDRAM读优化

    dm(SDRRC) = ustat4;

    // 需要注意的是FLAG2及FLAG3复用MS2和MS3脚。           

    // 必须启用MSEN位访问SDRAM,但不能同时驱动LED8和SDRAM

    ustat1=dm(SYSCTL);

    bit set ustat1 MSEN ;    //此设置允许访问的SDRAM

    //bit clr ustat3 MSEN;  //此设置Flag3被允许使用

    dm(SYSCTL)=ustat1;

    // 映射SDRAM到0块                      

    // 确保跳线适当设置,以便MS0的是连接到

    // 16位SDRAM器件芯片选择

    ustat1 = dm(EPCTL);

    bit set ustat1 B0SD;

    bit clr ustat1 B2SD|B1SD|B3SD;

    dm(EPCTL) = ustat1;

 

    //SRAM 设置

    //ustat4 = WS2|HC1|AMIEN|BW8;

    ustat1 = WS2|HC1|BW8;

    dm(AMICTL0)= ustat1;

   

    //Flash  设置

    //ustat4 = WS23|AMIEN|BW8;

    ustat1 = WS23|BW8;

    dm(AMICTL1)= ustat1;

   

    //==============================精密时钟发生器设置========================================================================    

    // 时钟源取 PCLK  = 90.3168MHz  FSDIV  CLKDIV

    // SCLK = PCLK/CLKDIV = 90.3168/16   = 5.6448MHz   

    // FS   = PCLK/FSDIV = 90.3168/16*64 = 88.2Khz

    // PCGA 输出 BCLK 与 LRCLK , PCGA 输出 MCLK

    /*r0 = 0x00000000 | 0x00000000;

    dm(PCG_PW) = r0;  //0-15位 FS A/C脉宽| 15-31位 FS B/D脉宽   是输入时钟的个数

    

    //0x3FF00000

     r0 = 0x00000028 | 0x01400000 | 0x00000000;    //这里122.88M分频到 3.072M 的位时钟 

     dm(PCG_CTLA1) = r0;//0-19位 CLKA分频系数| 20-29 FSB相位补偿低|30位 FSB选择CLKIN或PCG_EXTx_I|31位 CLKA选择CLKIN或PCG_EXTx_I

     

    r0 = 0x0000000A | 0x01400000 | 0x00000000; //这里122.88M分频到 12.288M供ADC DAC的时钟

    dm(PCG_CTLB1) = r0;//0-19位 CLKB分频系数| 20-29 FSB相位补偿低|30位 FSB选择CLKIN或PCG_EXTx_I|31位 CLKA选择CLKIN或PCG_EXTx_I

                       

        

    r0 = CLKA_SOURCE_IOP | FSA_SOURCE_IOP | CLKB_SOURCE_IOP | FSB_SOURCE_IOP; //设置时钟源 为PCLK=122.88M

    dm(PCG_SYNC) = r0;

     

     r0 = 0x00000A00 | 0x00000000 | ENFSA | ENCLKA; //这里122.88M分频到 48k 的左右通道时钟

     dm(PCG_CTLA0) = r0;//0-19位 FSA分频系数 | 20-29 FSA相位补偿高 | 30位 启用FSA | 31位 启用CLKA

     

     r0 = 0x00000A00 | 0x00000000 |ENFSA|  ENCLKA; //这里122.88M分频到 48k 的左右通道时钟供DAC

     dm(PCG_CTLB0) = r0;//0-19位 FSB分频系数 | 20-29 FSB相位补偿高 | 30位 启用FSB | 31位 启用CLKB*/

     //==============================音频串行端口设置========================================================================

     r0 = 0;

    //清除串行端口控制寄存器

     dm(SPCTL0) = r0; 

     dm(SPCTL1) = r0;

     dm(SPCTL2) = r0;

     dm(SPCTL3) = r0;

     

     //清除串行端口多通道控制寄存器

     dm(SPMCTL0) = r0;

     dm(SPMCTL1) = r0;

     dm(SPMCTL2) = r0;

     dm(SPMCTL3) = r0;

     

     //设置串行端口时钟分频 根据具体情况来设置 这里先设置为0

     r0 = 0;

     dm(DIV1)    = r0;

     dm(DIV0)    = r0;

     dm(DIV3)    = r0;

     dm(DIV2)    = r0;     

     

     //设置串行端口链式DMA 链寄存器  对于DMA链,19位PCI决定产生中断两种方法之一: 这里是每个链完成就产生中断。也就是每接收两个数据产生中断

     //这里的两个数据就是每个串行通道接收到的左右通道数据 ,下面的链是指到了链自己。

     //ADSP-2137x  链指针还有一个 CPDR位 。在20位//| (1<<19) 是否在每个DMA完成时产生中断。 还是整个链DMA完成产生中断

     //r3 = (rx0a_tcb  + 3);

     r0 = rx0a_tcb + 3 - 0x00080000  + 0x00080000  ;      dm(rx0a_tcb+0) = r0;

     r0 = rx0a_buf - 0x00080000 ;                         dm(rx0a_tcb+3) = r0;

     r0 = rx0a_tcb - 0x00080000 + 3 ;                 dm(CPSP0A) = r0;

     

     r0 = rx0b_tcb + 3 - 0x00080000 ; ;      dm(rx0b_tcb+0) = r0; // + 0x00080000

     r0 = rx0b_buf - 0x00080000 ;                         dm(rx0b_tcb+3) = r0;

     r0 = rx0b_tcb - 0x00080000 + 3 ;                 dm(CPSP0B) = r0;     

     

     

     

     r0 = tx2a_tcb + 3 - 0x00080000 ;  ;      dm(tx2a_tcb+0) = r0; // + 0x00080000

     r0 = tx2a_buf - 0x00080000 ;                         dm(tx2a_tcb+3) = r0;

     r0 = tx2a_tcb - 0x00080000 + 3 ;                 dm(CPSP2A) = r0;

     

     r0 = tx2b_tcb + 3 - 0x00080000 ;  ;      dm(tx2b_tcb+0) = r0; // + 0x00080000

     r0 = tx2b_buf - 0x00080000 ;                         dm(tx2b_tcb+3) = r0;

     r0 = tx2b_tcb - 0x00080000 + 3 ;                 dm(CPSP2B) = r0;

     

     r0 = tx3a_tcb + 3 - 0x00080000 ; ;      dm(tx3a_tcb+0) = r0; // + 0x00080000

     r0 = tx3a_buf - 0x00080000 ;                         dm(tx3a_tcb+3) = r0;

     r0 = tx3a_tcb - 0x00080000 + 3 ;                 dm(CPSP3A) = r0;

          

     /*r0 = (rx0a_tcb  + 3) & 0x7FFFF | (1<<19);     dm(rx0a_tcb  + 0) = r0; dm(CPSP0A) = r0;

     r0 = (rx0b_tcb  + 3) & 0x7FFFF ;            dm(rx0b_tcb  + 0) = r0; dm(CPSP0B) = r0;*/

     //r0 = (rx1a_tcb  + 3) & 0x7FFFF ;             dm(rx1a_tcb  + 0) = r0; dm(CPSP1A) = r0;  //目前串口2没使用

     //r0 = (rx1b_tcb  + 3) & 0x7FFFF ;             dm(rx1b_tcb  + 0) = r0; dm(CPSP1B) = r0;

     

     /*r0 = (tx2a_tcb  + 3) & 0x7FFFF ;             dm(tx2a_tcb  + 0) = r0; dm(CPSP2A) = r0;

    r0 = (tx2b_tcb  + 3) & 0x7FFFF ;             dm(tx2b_tcb  + 0) = r0; dm(CPSP2B) = r0;

     r0 = (tx3a_tcb  + 3) & 0x7FFFF ;             dm(tx3a_tcb  + 0) = r0; dm(CPSP3A) = r0;*/

     //r0 = (tx3b_tcb  + 3) & 0x7FFFF ;             dm(tx3b_tcb  + 0) = r0; dm(CPSP3B) = r0;

     

     

     //CKRE|FSR| DIFS |LSBF |  DIFS |FSR|

     //位说明  L_FIRST是左右通道选择   LAFS表示左对齐   SPTRAN表示接收还是发送          

     //设置串行端口控制寄存器  //FSR |  DIFS |  CKRE| LSBF | BHD|FS_BOTH|      MSTR

     //接收              左对齐       24位    A通道启动   A启动DMA链   A启用DMA   B通道启动   B启动DMA链   B启用DMA

     r0 =  (         OPMODE |  BHD |SLEN32 |   SPEN_A  |   SCHEN_A  |  SDEN_A  |   SPEN_B  |  SCHEN_B   | SDEN_B  );

     dm(SPCTL0) = r0;

     //r0 = 0;

     //dm(SPCTL1) = r0; //目前串口2没使用

     

      //FSR| DIFS |  CKRE|  LSBF | BHD|FS_BOTH|  //LSBF |FSR| DIFS |  MSTR

     //发送              左对齐       24位    A通道启动   A启动DMA链   A启用DMA   B通道启动   B启动DMA链   B启用DMA

     r0 =  (SPTRAN | OPMODE |  BHD |SLEN32 |   SPEN_A  |   SCHEN_A  |  SDEN_A  |   SPEN_B  |  SCHEN_B   | SDEN_B  );

     dm(SPCTL2) = r0;

     //发送              左对齐       24位    A通道启动   A启动DMA链   A启用DMA   B通道启动   B启动DMA链   B启用DMA

     r0 =  (SPTRAN | OPMODE |  BHD |SLEN32 |   SPEN_A  |   SCHEN_A  |  SDEN_A   );

     dm(SPCTL3) = r0;

     

          

     //==============================SRU设置========================================================================

    // 禁用所有20个引脚上的上拉电阻

    r0 = 0x000FFFFF;

    dm(DAI_PIN_PULLUP) = r0;

   

    r0 = 0x00003FFF;

    dm(DPI_PIN_PULLUP) = r0;

   

     //--


时钟到串口--


     SRU(DAI_PB19_O,        SPORT0_CLK_I); 

    SRU(DAI_PB18_O,        SPORT0_FS_I);

     //SRU(DAI_PB19_O,        SPORT1_CLK_I);//目前串口2没使用

    //SRU(DAI_PB18_O,        SPORT1_FS_I);

   

    SRU(DAI_PB19_O,        SPORT2_CLK_I);

    SRU(DAI_PB18_O,        SPORT2_FS_I);

   

    SRU(DAI_PB19_O,        SPORT3_CLK_I);

    SRU(DAI_PB18_O,        SPORT3_FS_I);

  

    //--


以下是ADC的布线--


 

    SRU(LOW,  PBEN08_I);

    SRU(DAI_PB08_O,       SPORT0_DA_I); //麦克风输入 

   

    SRU(LOW,  PBEN14_I); 

    SRU(DAI_PB14_O,       SPORT0_DB_I); //音乐输入

    

     

    //--


以下是DAC数据--


 

    SRU(SPORT2_DA_O,       DAI_PB13_I);

    SRU(HIGH,              PBEN13_I);   //配置为输出 输出到DAC

     

    SRU(SPORT2_DB_O,       DAI_PB12_I);

    SRU(HIGH,              PBEN12_I);   //配置为输出 输出到DAC

     

    SRU(SPORT3_DA_O,       DAI_PB11_I);

    SRU(HIGH,              PBEN11_I);   //配置为输出 输出到DAC

     

     //--


时钟到引脚--


     SRU (LOW,          PBEN19_I);   //BCLK   输入  到DSP

     SRU (LOW,          PBEN18_I);   //LRCLK  输入  到DSP

     

     //--


麦克风检测--


     SRU (DAI_PB01_O,   DAI_PB01_I);   //LRCLK  输入  到DSP

     SRU (HIGH,         PBEN01_I);   //LRCLK  输入  到DSP

   

    //--


以下是SPI--


 

    SRU2(LOW,               DPI_PB01_I);

    SRU2(LOW,               DPI_PBEN01_I);   

    SRU2(DPI_PB01_O,        SPI_MOSI_I );  //输入 数据

 

    SRU2(LOW,               DPI_PB03_I); 

    SRU2(LOW,               DPI_PBEN03_I);   

    SRU2(DPI_PB03_O,        SPI_CLK_I);    //时钟 数据

   

    SRU2(LOW,               DPI_PB04_I);

    SRU2(LOW,               DPI_PBEN04_I);   

    SRU2(DPI_PB04_O,        SPI_DS_I);     //时钟 片选

   

    SRU2(HIGH,              DPI_PBEN02_I);

    SRU2(SPI_MISO_O,        DPI_PB02_I );  //数据 输出 

   

    SRU2(HIGH,              DPI_PBEN05_I);

    SRU2(LOW,               DPI_PB05_I );  //标志 输出

   

   

     USTAT1 = TMROFF|SP45OFF|EPOFF| TWIOFF|PWMOFF|UART0OFF|SP67OFF|SRCOFF|CRAT0 | CRAT1 ;//;  ;

    //DM(PMCTL) =USTAT1; //电源管理

     

     //==============================SPI通讯接口初始化========================================================================

    USTAT1 = 0;

    DM(SPI_TAG) =USTAT1;                       //将SPI通讯接口自定义状态变量初始化为0

   

    BIT CLR IRPTL SPIHI;                       //清除SPI中断锁存

   

    USTAT1 = 0x00000000 | TXFLSH | RXFLSH;     //清除SPI接收发送移位寄存器

    DM(SPICTL) = USTAT1;   

   

    USTAT1 = 0x00000000 | FIFOFLSH;            //清理停止DMA 

    DM(SPIDMAC) = USTAT1;

    USTAT1 = 0x00000000|MME|TUNF|ROVF|TXCOL ;  //清理错误状态

    DM(SPISTAT) = USTAT1; 

    SRU2(LOW,               DPI_PB05_I );  //标志 输出 

   

    //==============================内存工作字长设置================================================================

    nop;

    ustat1=dm(SYSCTL);

    bit set ustat1   IMDW1;//| IMDW3

    dm(SYSCTL)=ustat1;nop;

    nop;

    nop;

    //==============================初始化算法==============================  

    call _FBX0Init;

    call _EchoInit;

    call InitReverb_Buffers;

    call InitChannelApp;

    //==============================中断设置========================================================================

    bit set mode1  IRPTEN; //全局中断激活

    nop;

    LIRPTL =  SP0IMSK;

    nop;

    nop;

    loopend6:

     IDLE;////nop;//

    jump loopend6;

_main.end:

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&  音频中断程序  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&  音频中断程序  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&  音频中断程序  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

_talkThroughISR:

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//================================================音乐 话筒ADC输入处理======================================================

    r8   = dm(rx0a_buf+0);   话筒ADC L

    r9   = dm(rx0a_buf+1);   话筒ADC R

   

    r10  = dm(rx0b_buf+0);   音乐ADC L

    r11  = dm(rx0b_buf+1);   音乐ADC R

   

    //

    dm(tx2a_buf+4) = r8;   //主L

    dm(tx2a_buf+2) = r9;   //C

    dm(tx2a_buf+0) = r10;   //SL

   

    dm(tx2a_buf+5) = r8;  //主R

    dm(tx2a_buf+3) = r9;  //SW

    dm(tx2a_buf+1) = r8;  //SR

   

   //这个硬件设置 ,可以做到整个音频系统只用一个12.228的晶体。

   

    //因为涉及产品机密。其他部分全部删掉。就想结识做软件开发的朋友18028703418

  

    //全套Dsp程序 计算机程序 和中文手机屏面板程序

    //这种框架最大的好处就是省资源(那就是省钱)。 声音延时只有一个取样。

    // 基本上266M的芯片可以做到400M芯片干的活。就是代码需要自己改

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&   

//=====================自创反馈抑制=========================================================================================

   

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&   

//========================================话筒延时==========================================================================

   

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&   

//=====================自创反馈抑制=========================================================================================

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//=========================================静躁门========================================================================

 

     

     

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//=========================================话筒参量=========================================================================

 

     

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//=======================================话筒效果参量=======================================================================

   

   

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&     

//========================================    回声  ========================================================================     

   

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&   

//===================================================   混响  ==============================================================

//--


预延时--


   

     

//--


4级全通--


 

   

//--


桶箱处理左通道--


    

                         

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//====================================================话筒混合处理==========================================================

     

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&   

//========================================话筒压缩==========================================================================

 

   

   

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&   

//====================================================音乐参量==============================================================

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&      

//==================================================话筒音乐混合处理 =======================================================

   

  

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&通道处理&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&   

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&通道处理&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

   

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//================================================通道参量==========================================================================

   

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//================================================压限处理==========================================================================    

   

                   

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//================================================延时处理==========================================================================   

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//===============================通讯程序==================================================================================

      

_talkThroughISR.end:rti;

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

//================================================初始化处理========================================================================

InitChannelApp:

    B0 = D_Main_Delay_L;  L0 = @D_Main_Delay_L;                            

     m0 = 1;

     LCNTR = L0;                                      

    DO Delay1 UNTIL LCE;

Delay1:    dm(i0, m0) = 0;

    B0 = D_Main_Delay_R;  L0 = @D_Main_Delay_R;                            

     m0 = 1;

     LCNTR = L0;                                      

    DO Delay2 UNTIL LCE;

Delay2:    dm(i0, m0) = 0;

    B0 = D_SW_Delay;  L0 = @D_SW_Delay;                            

     m0 = 1;

     LCNTR = L0;                                      

    DO Delay3 UNTIL LCE;

Delay3:    dm(i0, m0) = 0;

    B0 = D_C_Delay;  L0 = @D_C_Delay;                            

     m0 = 1;

     LCNTR = L0;                                      

    DO Delay4 UNTIL LCE;

Delay4:    dm(i0, m0) = 0;

    B0 = D_Aux_Delay_L;  L0 = @D_Aux_Delay_L;                            

     m0 = 1;

     LCNTR = L0;                                      

    DO Delay5 UNTIL LCE;

Delay5:    dm(i0, m0) = 0;

    B0 = D_Aux_Delay_R;  L0 = @D_Aux_Delay_R;                            

     m0 = 1;

     LCNTR = L0;                                      

    DO Delay6 UNTIL LCE;

Delay6:    dm(i0, m0) = 0;

InitChannelApp.end:rts;

_FBX0Init:

    r0 = FBX0w1;  r1 = @FBX0w1;

    dm(FBX0_Addr) = r0;

     B3 = r0;      L3 = r1;

     m3 = 1;

     r0 =0;

     LCNTR = L3;

    DO clrDline1 UNTIL LCE;

clrDline1:  DM(i3,m3) = r0;

_FBX0Init.end:rts;

_EchoInit:

    r0 = EcohDeley;  r1 = @EcohDeley;  dm(EchoAddr) = r0;

     B0 = r0;  L0 = r1;

     m0 = 1;

     r0 =0;

     LCNTR = L0;

    DO Ecoh1 UNTIL LCE;

Ecoh1:  DM(i0,m0) = r0;

_EchoInit.end:RTS;

InitReverb_Buffers:

    r0 = diffuser_1;

     B4 = r0;

     DM(all_pass_ptr1) = r0;

     

    r0 = diffuser_2;

     B4 = r0;

     DM(all_pass_ptr2) = r0;

     

    r0 = diffuser_3;

     B4 = r0;

     DM(all_pass_ptr3) = r0;

     

    r0 = diffuser_4;

     B4 = r0;

     DM(all_pass_ptr4) = r0;

     

     r0 = decay_diffuser_A1;

     B4 = r0;

     DM(all_pass_ptr5) = r0;

     

     r0 = decay_diffuser_B1;

     B4 = r0;

     DM(all_pass_ptr6) = r0;

     

     r0 = decay_diffuser_A2;

     B4 = r0;     

     DM(all_pass_ptr7) = r0;

     

     r0 = decay_diffuser_B2;

     B4 = r0;     

     DM(all_pass_ptr8) = r0;

     m4 = 1;

     r0 = RevW1;  r1 = @RevW1;

     B4 = r0;     L4 = r1;          DM(RevW1_ptr)=r0;r0 = 0;     

     LCNTR = L4;                

     DO clrDline_1 UNTIL LCE;

clrDline_1:        dm(i4, m4) = r0;

     r0 = RevW2;  r1 = @RevW2;

     B4 = r0;     L4 = r1;        DM(RevW2_ptr)=r0;r0 = 0;

     LCNTR = L4;                

     DO clrDline_2 UNTIL LCE;

clrDline_2:        dm(i4, m4) = r0;

     r0 = RevW3;  r1 = @RevW3;

     B4 = r0;     L4 = r1;        DM(RevW3_ptr)=r0;r0 = 0;

     LCNTR = L4;                

     DO clrDline_3 UNTIL LCE;

clrDline_3:        dm(i4, m4) = r0;

     r0 = RevW4;  r1 = @RevW4;

     B4 = r0;     L4 = r1;        DM(RevW4_ptr)=r0;r0 = 0;

     LCNTR = L4;                

     DO clrDline_4 UNTIL LCE;

clrDline_4:        dm(i4, m4) = r0;     

     r0 = Predelay; r1 = @Predelay;

     B4 = r0;       L4 = r1; DM(Predel_ptr)=r0;r0 = 0;

     LCNTR = L4;                

     DO clrDline_5 UNTIL LCE;

clrDline_5:        dm(i4, m4) = r0;

   

InitReverb_Buffers.end:RTS;

Parents Reply Children
No Data