n

Dependencies:   mbed

Fork of LG by igor Apu

Committer:
igor_v
Date:
Sat Jan 30 13:53:19 2016 +0000
Revision:
1:f2adcae3d304
Parent:
0:8ad47e2b6f00
Child:
21:bc8c1cec3da6
123

Who changed what in which revision?

UserRevisionLine numberNew 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 1:f2adcae3d304 4
igor_v 1:f2adcae3d304 5
igor_v 0:8ad47e2b6f00 6 #include "dspfns.h"
igor_v 0:8ad47e2b6f00 7
igor_v 0:8ad47e2b6f00 8 typedef enum BAND_PASS_TYPE_{PLC, DUP} BAND_PASS_TYPE;
igor_v 0:8ad47e2b6f00 9
igor_v 0:8ad47e2b6f00 10 extern BAND_PASS_TYPE BandPassType;
igor_v 0:8ad47e2b6f00 11 extern unsigned int Vibro_Filter_Aperture;
igor_v 0:8ad47e2b6f00 12
igor_v 0:8ad47e2b6f00 13 #define PI 3.14159265
igor_v 0:8ad47e2b6f00 14
igor_v 0:8ad47e2b6f00 15 //e. constants for the filter in the CPLC regulator //r. ��������� ��� ������� � ������� ���
igor_v 0:8ad47e2b6f00 16 #define NUMB_OF_BIQUADS_PLC 2
igor_v 0:8ad47e2b6f00 17 #define TAPS_PLC 5*NUMB_OF_BIQUADS_PLC
igor_v 0:8ad47e2b6f00 18 #define DELAY_LEN_PLC (2*NUMB_OF_BIQUADS_PLC+2)
igor_v 0:8ad47e2b6f00 19
igor_v 0:8ad47e2b6f00 20 //e. constants for the filter in the APS regulator //r. ��������� ��� ������� � ������� ���
igor_v 0:8ad47e2b6f00 21 #define NUM_OF_BIQUADS_DUP 2
igor_v 0:8ad47e2b6f00 22 #define TAPS_DUP 5*NUM_OF_BIQUADS_DUP
igor_v 0:8ad47e2b6f00 23 #define DELAY_LEN_DUP (2*NUM_OF_BIQUADS_DUP+2)
igor_v 0:8ad47e2b6f00 24
igor_v 0:8ad47e2b6f00 25 #define X 0.98 //0.96 //0.86
igor_v 0:8ad47e2b6f00 26 #define A0_HP ((1 + X)/2) * 0x40000000
igor_v 0:8ad47e2b6f00 27 #define A1_HP (-(1 + X)/2) * 0x40000000
igor_v 0:8ad47e2b6f00 28 #define B1_HP (X * 0x80000000)/2
igor_v 0:8ad47e2b6f00 29
igor_v 0:8ad47e2b6f00 30 #define MULT_7680_12500 26667
igor_v 0:8ad47e2b6f00 31
igor_v 0:8ad47e2b6f00 32 #define Saturation(Uin, UpSat, DownSat) if (Uin > UpSat) Uin = UpSat; \
igor_v 0:8ad47e2b6f00 33 if (Uin < DownSat) Uin = DownSat;
igor_v 0:8ad47e2b6f00 34
igor_v 0:8ad47e2b6f00 35 #define Cnt_Overload(Uin, UpSat, DwnSat) if (Uin > UpSat) Uin -= INT32_MAX; if (Uin < DwnSat) Uin += INT32_MAX;
igor_v 0:8ad47e2b6f00 36
igor_v 0:8ad47e2b6f00 37 #define CPL_reset_calc(U0, Kgrad, Ti, T0) U0 + L_mult( Kgrad, (Ti - T0) )
igor_v 0:8ad47e2b6f00 38
igor_v 0:8ad47e2b6f00 39 int HFO_MovAverFilt (int );
igor_v 0:8ad47e2b6f00 40
igor_v 0:8ad47e2b6f00 41 int VibroReduce (int input);
igor_v 0:8ad47e2b6f00 42 void init_VibroReduce(void);
igor_v 0:8ad47e2b6f00 43 int PLC_PhaseDetFilt (int input);
igor_v 0:8ad47e2b6f00 44 int DUP_Filt (int input);
igor_v 1:f2adcae3d304 45 void init_BandPass(double CenterFreq, double BandWidth, BAND_PASS_TYPE FiltType);
igor_v 0:8ad47e2b6f00 46
igor_v 1:f2adcae3d304 47 #endif // mathDSP_H