Zdrojový kód k projektu Řízeni protetické ruky pomocí K64F do předmětu MPOA 2015

Dependencies:   mbed

Committer:
customer10123
Date:
Sun Jan 17 20:51:22 2016 +0000
Revision:
2:d59911284528
Parent:
0:5007c2a9b9d1
Update 2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
customer10123 0:5007c2a9b9d1 1 /******************************* SOURCE LICENSE *********************************
customer10123 0:5007c2a9b9d1 2 Copyright (c) 2015 MicroModeler.
customer10123 0:5007c2a9b9d1 3
customer10123 0:5007c2a9b9d1 4 A non-exclusive, nontransferable, perpetual, royalty-free license is granted to the Licensee to
customer10123 0:5007c2a9b9d1 5 use the following Information for academic, non-profit, or government-sponsored research purposes.
customer10123 0:5007c2a9b9d1 6 Use of the following Information under this License is restricted to NON-COMMERCIAL PURPOSES ONLY.
customer10123 0:5007c2a9b9d1 7 Commercial use of the following Information requires a separately executed written license agreement.
customer10123 0:5007c2a9b9d1 8
customer10123 0:5007c2a9b9d1 9 This Information is distributed WITHOUT ANY WARRANTY; without even the implied warranty of
customer10123 0:5007c2a9b9d1 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
customer10123 0:5007c2a9b9d1 11
customer10123 0:5007c2a9b9d1 12 ******************************* END OF LICENSE *********************************/
customer10123 0:5007c2a9b9d1 13
customer10123 0:5007c2a9b9d1 14 // A commercial license for MicroModeler DSP can be obtained at http://www.micromodeler.com/launch.jsp
customer10123 0:5007c2a9b9d1 15
customer10123 0:5007c2a9b9d1 16 // Begin header file, filter1.h
customer10123 0:5007c2a9b9d1 17
customer10123 0:5007c2a9b9d1 18 #ifndef FILTER1_H_ // Include guards
customer10123 0:5007c2a9b9d1 19 #define FILTER1_H_
customer10123 0:5007c2a9b9d1 20
customer10123 0:5007c2a9b9d1 21 static const int filter1_numStages = 4;
customer10123 0:5007c2a9b9d1 22 static const int filter1_coefficientLength = 20;
customer10123 0:5007c2a9b9d1 23 extern float filter1_coefficients[20];
customer10123 0:5007c2a9b9d1 24
customer10123 0:5007c2a9b9d1 25 typedef struct
customer10123 0:5007c2a9b9d1 26 {
customer10123 0:5007c2a9b9d1 27 float state[16];
customer10123 0:5007c2a9b9d1 28 float output;
customer10123 0:5007c2a9b9d1 29 } filter1Type;
customer10123 0:5007c2a9b9d1 30
customer10123 0:5007c2a9b9d1 31 typedef struct
customer10123 0:5007c2a9b9d1 32 {
customer10123 0:5007c2a9b9d1 33 float *pInput;
customer10123 0:5007c2a9b9d1 34 float *pOutput;
customer10123 0:5007c2a9b9d1 35 float *pState;
customer10123 0:5007c2a9b9d1 36 float *pCoefficients;
customer10123 0:5007c2a9b9d1 37 short count;
customer10123 0:5007c2a9b9d1 38 } filter1_executionState;
customer10123 0:5007c2a9b9d1 39
customer10123 0:5007c2a9b9d1 40
customer10123 0:5007c2a9b9d1 41 filter1Type *filter1_create( void );
customer10123 0:5007c2a9b9d1 42 void filter1_destroy( filter1Type *pObject );
customer10123 0:5007c2a9b9d1 43 void filter1_init( filter1Type * pThis );
customer10123 0:5007c2a9b9d1 44 void filter1_reset( filter1Type * pThis );
customer10123 0:5007c2a9b9d1 45 #define filter1_writeInput( pThis, input ) \
customer10123 0:5007c2a9b9d1 46 filter1_filterBlock( pThis, &input, &pThis->output, 1 );
customer10123 0:5007c2a9b9d1 47
customer10123 0:5007c2a9b9d1 48 #define filter1_readOutput( pThis ) \
customer10123 0:5007c2a9b9d1 49 pThis->output
customer10123 0:5007c2a9b9d1 50
customer10123 0:5007c2a9b9d1 51 int filter1_filterBlock( filter1Type * pThis, float * pInput, float * pOutput, unsigned int count );
customer10123 0:5007c2a9b9d1 52 #define filter1_outputToFloat( output ) \
customer10123 0:5007c2a9b9d1 53 (output)
customer10123 0:5007c2a9b9d1 54
customer10123 0:5007c2a9b9d1 55 #define filter1_inputFromFloat( input ) \
customer10123 0:5007c2a9b9d1 56 (input)
customer10123 0:5007c2a9b9d1 57
customer10123 0:5007c2a9b9d1 58 void filter1_filterBiquad( filter1_executionState * pExecState );
customer10123 0:5007c2a9b9d1 59 #endif // FILTER1_H_
customer10123 0:5007c2a9b9d1 60