00001 #include "afw.h"
00002 #include <filter.h>
00003
00004
00005
00006
00007
00008
00009 namespace afw{
00010
00011
00012
00013 const int taps = 63;
00014
00015
00016
00017
00018
00019
00020
00021
00022 short coeff[taps] = {
00023 277,
00024 - 1263,
00025 398,
00026 534,
00027 324,
00028 50,
00029 - 196,
00030 - 343,
00031 - 330,
00032 - 152,
00033 121,
00034 365,
00035 446,
00036 295,
00037 - 42,
00038 - 411,
00039 - 611,
00040 - 505,
00041 - 91,
00042 459,
00043 862,
00044 862,
00045 357,
00046 - 495,
00047 - 1316,
00048 - 1624,
00049 - 1042,
00050 521,
00051 2788,
00052 5177,
00053 6988,
00054 7663,
00055 6988,
00056 5177,
00057 2788,
00058 521,
00059 - 1042,
00060 - 1624,
00061 - 1316,
00062 - 495,
00063 357,
00064 862,
00065 862,
00066 459,
00067 - 91,
00068 - 505,
00069 - 611,
00070 - 411,
00071 - 42,
00072 295,
00073 446,
00074 365,
00075 121,
00076 - 152,
00077 - 330,
00078 - 343,
00079 - 196,
00080 50,
00081 324,
00082 534,
00083 398,
00084 - 1263,
00085 277
00086 };
00087
00088
00089
00090 short delayline[taps];
00091
00092
00093
00094 fir_state_fr16 state;
00095
00096
00097
00098
00099
00100 void initProcessData(void)
00101 {
00102
00103 state.h = coeff;
00104 state.d = delayline;
00105 state.p = delayline;
00106 state.k = taps;
00107 state.l = 0;
00108
00109 for ( int i=0; i < taps; i ++ )
00110 delayline[i] = 0;
00111 }
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 void processData(
00133 const shortfract leftIn[],
00134 const shortfract rightIn[],
00135 shortfract leftOut[],
00136 shortfract rightOut[],
00137 int count
00138 )
00139 {
00140
00141 fir_fr16( (fract16*)leftIn, (fract16*)leftOut, count, &state );
00142
00143
00144 for( int i=0; i<count; i++ )
00145 rightOut[i] = leftIn[i];
00146 }
00147
00148 };