![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LG2 by
host/Source/App/mathDSP.h@23:12e6183f04d4, 2016-02-03 (annotated)
- Committer:
- Kovalev_D
- Date:
- Wed Feb 03 10:44:42 2016 +0300
- Revision:
- 23:12e6183f04d4
[thyz
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kovalev_D |
23:12e6183f04d4 | 1 | #include "dspfns.h" |
Kovalev_D |
23:12e6183f04d4 | 2 | |
Kovalev_D |
23:12e6183f04d4 | 3 | |
Kovalev_D |
23:12e6183f04d4 | 4 | typedef enum BAND_PASS_TYPE_{PLC, DUP} BAND_PASS_TYPE; |
Kovalev_D |
23:12e6183f04d4 | 5 | |
Kovalev_D |
23:12e6183f04d4 | 6 | extern BAND_PASS_TYPE BandPassType; |
Kovalev_D |
23:12e6183f04d4 | 7 | extern unsigned int Vibro_Filter_Aperture; |
Kovalev_D |
23:12e6183f04d4 | 8 | |
Kovalev_D |
23:12e6183f04d4 | 9 | #define PI 3.14159265 |
Kovalev_D |
23:12e6183f04d4 | 10 | |
Kovalev_D |
23:12e6183f04d4 | 11 | //e. constants for the filter in the CPLC regulator //r. êîíñòàíòû äëÿ ôèëüòðà â êîíòóðå ÑÐÏ |
Kovalev_D |
23:12e6183f04d4 | 12 | #define NUMB_OF_BIQUADS_PLC 2 |
Kovalev_D |
23:12e6183f04d4 | 13 | #define TAPS_PLC 5*NUMB_OF_BIQUADS_PLC |
Kovalev_D |
23:12e6183f04d4 | 14 | #define DELAY_LEN_PLC (2*NUMB_OF_BIQUADS_PLC+2) |
Kovalev_D |
23:12e6183f04d4 | 15 | |
Kovalev_D |
23:12e6183f04d4 | 16 | //e. constants for the filter in the APS regulator //r. êîíñòàíòû äëÿ ôèëüòðà â êîíòóðå ÄÓÏ |
Kovalev_D |
23:12e6183f04d4 | 17 | #define NUM_OF_BIQUADS_DUP 2 |
Kovalev_D |
23:12e6183f04d4 | 18 | #define TAPS_DUP 5*NUM_OF_BIQUADS_DUP |
Kovalev_D |
23:12e6183f04d4 | 19 | #define DELAY_LEN_DUP (2*NUM_OF_BIQUADS_DUP+2) |
Kovalev_D |
23:12e6183f04d4 | 20 | |
Kovalev_D |
23:12e6183f04d4 | 21 | #define X 0.98 //0.96 //0.86 |
Kovalev_D |
23:12e6183f04d4 | 22 | #define A0_HP ((1 + X)/2) * 0x40000000 |
Kovalev_D |
23:12e6183f04d4 | 23 | #define A1_HP (-(1 + X)/2) * 0x40000000 |
Kovalev_D |
23:12e6183f04d4 | 24 | #define B1_HP (X * 0x80000000)/2 |
Kovalev_D |
23:12e6183f04d4 | 25 | |
Kovalev_D |
23:12e6183f04d4 | 26 | #define MULT_7680_12500 26667 |
Kovalev_D |
23:12e6183f04d4 | 27 | |
Kovalev_D |
23:12e6183f04d4 | 28 | #define Saturation(Uin, UpSat, DownSat) if (Uin > UpSat) Uin = UpSat; \ |
Kovalev_D |
23:12e6183f04d4 | 29 | if (Uin < DownSat) Uin = DownSat; |
Kovalev_D |
23:12e6183f04d4 | 30 | |
Kovalev_D |
23:12e6183f04d4 | 31 | #define Cnt_Overload(Uin, UpSat, DwnSat) if (Uin > UpSat) Uin -= INT32_MAX; if (Uin < DwnSat) Uin += INT32_MAX; |
Kovalev_D |
23:12e6183f04d4 | 32 | |
Kovalev_D |
23:12e6183f04d4 | 33 | #define CPL_reset_calc(U0, Kgrad, Ti, T0) U0 + L_mult( Kgrad, (Ti - T0) ) |
Kovalev_D |
23:12e6183f04d4 | 34 | |
Kovalev_D |
23:12e6183f04d4 | 35 | int HFO_MovAverFilt (int ); |
Kovalev_D |
23:12e6183f04d4 | 36 | |
Kovalev_D |
23:12e6183f04d4 | 37 | int VibroReduce (int input); |
Kovalev_D |
23:12e6183f04d4 | 38 | void init_VibroReduce(void); |
Kovalev_D |
23:12e6183f04d4 | 39 | int PLC_PhaseDetFilt (int input); |
Kovalev_D |
23:12e6183f04d4 | 40 | int DUP_Filt (int input); |
Kovalev_D |
23:12e6183f04d4 | 41 | void init_BandPass(double CenterFreq, double BandWidth, BAND_PASS_TYPE ); |
Kovalev_D |
23:12e6183f04d4 | 42 |