#include "typetools.h" #include "phal_sw_api.h" /****************************** * CONVOLUTION FUNCTION * ******************************/ int convii(int *filter, int *state, int length, int din) { int i; int res=0; for (i=length-1; i>0; i--) state[i]=state[i-1]; state[0]=din; for (i=0; i0; i--) state[i]=state[i-1]; state[0]=din; for (i=0; i0; i--) state[i]=state[i-1]; state[0]=din; for (i=0; i>7; x<<=1; } } void bin2int8 (char *input, int *output, int outputlength) { char x; int i; for (i=0; i>7; x<<=1; } } void bin2float (char *input, float *output, int length) { char x; int i; for (i=0; i>7; x<<=1; } } void char2bin (char *input, char *output, int inputlength) { int x; int i,c; x=0; c=0; for (i=0; imaxIN)maxIN=temp[i]; if(-temp[i]>maxIN)maxIN=-temp[i]; } escale=(float)maxint/maxIN; for(i=0; imaxINi)maxINi=ini[i]; if(-ini[i]>maxINi)maxINi=-ini[i]; } escale=(float)maxint/maxINi; for(i=0; imaxIN)maxIN=inf[i]; if(-inf[i]>maxIN)maxIN=-inf[i]; } escale=(float)maxint/maxIN; for(i=0; i0){ output[l]=x; x=0x00; l++; } } else x<<=1; x=(char)(input[n] & 0x01) | x; n++; } return(length/8); } /*MSB bit first binari output*/ int MSBfirstchar2bin (unsigned char *input, int *output, int length) { int x; int i,c; x=0; c=0; for (i=0; i>7); } return(length*8); }