Dmitry Kovalev
/
LG
n
Fork of LG by
mathDSP.h@21:bc8c1cec3da6, 2016-02-03 (annotated)
- Committer:
- igor_v
- Date:
- Wed Feb 03 07:19:30 2016 +0000
- Revision:
- 21:bc8c1cec3da6
- Parent:
- 1:f2adcae3d304
?????????? ??????? ??????????, ???????? ??? ?????? ?????????? ??????????? ?????????.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igor_v | 1:f2adcae3d304 | 1 | #ifndef mathDSP_H |
igor_v | 1:f2adcae3d304 | 2 | #define mathDSP_H |
igor_v | 1:f2adcae3d304 | 3 | |
igor_v | 21:bc8c1cec3da6 | 4 | #include "dspfns.h" |
igor_v | 1:f2adcae3d304 | 5 | |
igor_v | 0:8ad47e2b6f00 | 6 | |
igor_v | 0:8ad47e2b6f00 | 7 | typedef enum BAND_PASS_TYPE_{PLC, DUP} BAND_PASS_TYPE; |
igor_v | 0:8ad47e2b6f00 | 8 | |
igor_v | 0:8ad47e2b6f00 | 9 | extern BAND_PASS_TYPE BandPassType; |
igor_v | 0:8ad47e2b6f00 | 10 | extern unsigned int Vibro_Filter_Aperture; |
igor_v | 0:8ad47e2b6f00 | 11 | |
igor_v | 0:8ad47e2b6f00 | 12 | #define PI 3.14159265 |
igor_v | 0:8ad47e2b6f00 | 13 | |
igor_v | 21:bc8c1cec3da6 | 14 | //e. constants for the filter in the CPLC regulator //r. константы для фильтра в контуре СРП |
igor_v | 0:8ad47e2b6f00 | 15 | #define NUMB_OF_BIQUADS_PLC 2 |
igor_v | 0:8ad47e2b6f00 | 16 | #define TAPS_PLC 5*NUMB_OF_BIQUADS_PLC |
igor_v | 0:8ad47e2b6f00 | 17 | #define DELAY_LEN_PLC (2*NUMB_OF_BIQUADS_PLC+2) |
igor_v | 0:8ad47e2b6f00 | 18 | |
igor_v | 21:bc8c1cec3da6 | 19 | //e. constants for the filter in the APS regulator //r. константы для фильтра в контуре ДУП |
igor_v | 0:8ad47e2b6f00 | 20 | #define NUM_OF_BIQUADS_DUP 2 |
igor_v | 0:8ad47e2b6f00 | 21 | #define TAPS_DUP 5*NUM_OF_BIQUADS_DUP |
igor_v | 0:8ad47e2b6f00 | 22 | #define DELAY_LEN_DUP (2*NUM_OF_BIQUADS_DUP+2) |
igor_v | 0:8ad47e2b6f00 | 23 | |
igor_v | 0:8ad47e2b6f00 | 24 | #define X 0.98 //0.96 //0.86 |
igor_v | 0:8ad47e2b6f00 | 25 | #define A0_HP ((1 + X)/2) * 0x40000000 |
igor_v | 0:8ad47e2b6f00 | 26 | #define A1_HP (-(1 + X)/2) * 0x40000000 |
igor_v | 0:8ad47e2b6f00 | 27 | #define B1_HP (X * 0x80000000)/2 |
igor_v | 0:8ad47e2b6f00 | 28 | |
igor_v | 0:8ad47e2b6f00 | 29 | #define MULT_7680_12500 26667 |
igor_v | 0:8ad47e2b6f00 | 30 | |
igor_v | 0:8ad47e2b6f00 | 31 | #define Saturation(Uin, UpSat, DownSat) if (Uin > UpSat) Uin = UpSat; \ |
igor_v | 0:8ad47e2b6f00 | 32 | if (Uin < DownSat) Uin = DownSat; |
igor_v | 0:8ad47e2b6f00 | 33 | |
igor_v | 0:8ad47e2b6f00 | 34 | #define Cnt_Overload(Uin, UpSat, DwnSat) if (Uin > UpSat) Uin -= INT32_MAX; if (Uin < DwnSat) Uin += INT32_MAX; |
igor_v | 0:8ad47e2b6f00 | 35 | |
igor_v | 0:8ad47e2b6f00 | 36 | #define CPL_reset_calc(U0, Kgrad, Ti, T0) U0 + L_mult( Kgrad, (Ti - T0) ) |
igor_v | 0:8ad47e2b6f00 | 37 | |
igor_v | 0:8ad47e2b6f00 | 38 | int HFO_MovAverFilt (int ); |
igor_v | 0:8ad47e2b6f00 | 39 | |
igor_v | 0:8ad47e2b6f00 | 40 | int VibroReduce (int input); |
igor_v | 0:8ad47e2b6f00 | 41 | void init_VibroReduce(void); |
igor_v | 0:8ad47e2b6f00 | 42 | int PLC_PhaseDetFilt (int input); |
igor_v | 0:8ad47e2b6f00 | 43 | int DUP_Filt (int input); |
igor_v | 21:bc8c1cec3da6 | 44 | void init_BandPass(double CenterFreq, double BandWidth, BAND_PASS_TYPE ); |
igor_v | 0:8ad47e2b6f00 | 45 | |
igor_v | 1:f2adcae3d304 | 46 | #endif // mathDSP_H |