n

Dependencies:   mbed

Fork of LG by igor Apu

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mathDSP.h Source File

mathDSP.h

00001 #ifndef mathDSP_H
00002 #define mathDSP_H
00003 
00004 #include "dspfns.h"
00005 
00006 
00007 typedef enum BAND_PASS_TYPE_{PLC, DUP} BAND_PASS_TYPE;
00008 
00009 extern  BAND_PASS_TYPE BandPassType;
00010 extern unsigned int Vibro_Filter_Aperture;
00011 
00012 #define     PI  3.14159265
00013 
00014     //e. constants for the filter in the CPLC regulator //r. константы для фильтра в контуре СРП
00015 #define  NUMB_OF_BIQUADS_PLC    2
00016 #define  TAPS_PLC               5*NUMB_OF_BIQUADS_PLC
00017 #define  DELAY_LEN_PLC          (2*NUMB_OF_BIQUADS_PLC+2)
00018 
00019     //e. constants for the filter in the APS regulator //r. константы для фильтра в контуре ДУП
00020 #define  NUM_OF_BIQUADS_DUP     2
00021 #define  TAPS_DUP               5*NUM_OF_BIQUADS_DUP
00022 #define  DELAY_LEN_DUP          (2*NUM_OF_BIQUADS_DUP+2)
00023 
00024 #define     X               0.98 //0.96 //0.86
00025 #define     A0_HP           ((1 + X)/2) * 0x40000000
00026 #define     A1_HP           (-(1 + X)/2) * 0x40000000
00027 #define     B1_HP           (X * 0x80000000)/2
00028 
00029 #define     MULT_7680_12500         26667
00030 
00031 #define Saturation(Uin, UpSat, DownSat) if (Uin > UpSat) Uin = UpSat; \
00032                                                             if (Uin < DownSat) Uin = DownSat;
00033 
00034 #define Cnt_Overload(Uin, UpSat, DwnSat)    if (Uin > UpSat) Uin -= INT32_MAX;  if (Uin < DwnSat) Uin += INT32_MAX;
00035 
00036 #define CPL_reset_calc(U0, Kgrad, Ti, T0)   U0 + L_mult( Kgrad, (Ti - T0) ) 
00037 
00038 int HFO_MovAverFilt (int );
00039 
00040 int VibroReduce (int input);
00041 void init_VibroReduce(void);
00042 int PLC_PhaseDetFilt (int input);
00043 int DUP_Filt (int input);
00044 void init_BandPass(double CenterFreq, double BandWidth, BAND_PASS_TYPE );
00045 
00046 #endif // mathDSP_H