Relative functions:
Relative functions:
Relative functions:
Relative functions:
Relative functions:
Relative functions:
Relative functions:
Functions | |
void | dsp16_win_bart (dsp16_t *vect1, int size) |
16-bit fixed point version of the bartlett windowing function. | |
void | dsp16_win_black (dsp16_t *vect1, int size) |
16-bit fixed point version of the blackman windowing function. | |
void | dsp16_win_gauss (dsp16_t *vect1, int size) |
16-bit fixed point version of the gaussian windowing function. | |
void | dsp16_win_hamm (dsp16_t *vect1, int size) |
16-bit fixed point version of the hamming windowing function. | |
void | dsp16_win_hann (dsp16_t *vect1, int size) |
16-bit fixed point version of the hann windowing function. | |
void | dsp16_win_kaiser (dsp16_t *vect1, int size, int alpha) |
16-bit fixed point version of the kaiser windowing function. | |
void | dsp16_win_rect (dsp16_t *vect1, int size) |
16-bit fixed point version of the rectangular windowing function. | |
void | dsp16_win_welch (dsp16_t *vect1, int size) |
16-bit fixed point version of the welch windowing function. | |
void | dsp32_win_bart (dsp32_t *vect1, int size) |
32-bit fixed point version of the bartlett windowing function. | |
void | dsp32_win_black (dsp32_t *vect1, int size) |
32-bit fixed point version of the blackman windowing function. | |
void | dsp32_win_gauss (dsp32_t *vect1, int size) |
32-bit fixed point version of the gaussian windowing function. | |
void | dsp32_win_hamm (dsp32_t *vect1, int size) |
32-bit fixed point version of the hamming windowing function. | |
void | dsp32_win_hann (dsp32_t *vect1, int size) |
32-bit fixed point version of the hann windowing function. | |
void | dsp32_win_kaiser (dsp32_t *vect1, int size, int alpha) |
32-bit fixed point version of the kaiser windowing function. | |
void | dsp32_win_rect (dsp32_t *vect1, int size) |
32-bit fixed point version of the rectangular windowing function. | |
void | dsp32_win_welch (dsp32_t *vect1, int size) |
32-bit fixed point version of the welch windowing function. |
void dsp16_win_bart | ( | dsp16_t * | vect1, | |
int | size | |||
) |
16-bit fixed point version of the bartlett windowing function.
vect1 | A pointer on the 16-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 52 of file win_bartlett.c.
References DSP16_Q.
00053 { 00054 dsp16_t s, t; 00055 int i; 00056 00057 // Initialization 00058 t = DSP16_Q(0.); 00059 // Increment 00060 s = (DSP16_Q(1.) / size) << 1; 00061 // Compute the 1st half 00062 for(i=0; i<(size >> 1); i++) 00063 { 00064 vect1[i] = t; 00065 vect1[size-i-1] = t; 00066 t += s; 00067 } 00068 00069 // If the size is odd 00070 if (size & 1) 00071 vect1[size >> 1] = DSP16_Q(1.); 00072 }
void dsp16_win_black | ( | dsp16_t * | vect1, | |
int | size | |||
) |
16-bit fixed point version of the blackman windowing function.
vect1 | A pointer on the 16-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 62 of file win_blackman.c.
References dsp16_op_cos(), DSP16_Q, DSP16_QB, WIN_BLACK_A0, WIN_BLACK_A1, and WIN_BLACK_A2.
00063 { 00064 dsp16_t s, t, w; 00065 // To avoid a avr32-gcc 4.12 bug 00066 volatile S32 temp32; 00067 int i; 00068 00069 // Initialization 00070 t = DSP16_Q(0.); 00071 // Calculation of 2/(N-1) <- because a cos is in the range [-1; 1], 00072 // therefore -1 equals -PI and 1, PI. 00073 s = (DSP16_Q(1.)/(size - 1)) << 1; 00074 00075 // Compute the window 00076 for(i=0; i<(size >> 1); i++) 00077 { 00078 w = DSP16_Q(WIN_BLACK_A0); 00079 00080 temp32 = DSP16_Q(WIN_BLACK_A1); 00081 temp32 *= dsp16_op_cos(t); 00082 temp32 >>= DSP16_QB; 00083 w -= temp32; 00084 00085 temp32 = DSP16_Q(WIN_BLACK_A2); 00086 temp32 *= dsp16_op_cos(t << 1); 00087 temp32 >>= DSP16_QB; 00088 w += temp32; 00089 00090 vect1[i] = w; 00091 vect1[size-i-1] = w; 00092 t += s; 00093 } 00094 00095 // If the size is odd 00096 if (size & 1) 00097 vect1[size >> 1] = DSP16_Q(1.); 00098 }
void dsp16_win_gauss | ( | dsp16_t * | vect1, | |
int | size | |||
) |
16-bit fixed point version of the gaussian windowing function.
vect1 | A pointer on the 16-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 59 of file win_gauss.c.
References CST_LN_2, dsp16_op_abs(), dsp16_op_exp(), DSP16_Q, DSP16_QB, DSP_GAUSS_TETA, and DSP_Q.
00060 { 00061 int k, i; 00062 S32 x, res; 00063 dsp16_t s, t; 00064 // CST = 1/(2*ln(2)) 00065 const S32 cst_a = (S32) DSP_Q(32-DSP16_QB, DSP16_QB, 1./CST_LN_2) >> 1; 00066 // CST = ln(2) 00067 const S32 cst_b = (S32) DSP16_Q(CST_LN_2); 00068 // CST = 1./DSP_GAUSS_TETA*2^-floor(DSP16_QB/2) 00069 const S32 cst_c = (S32) DSP_Q(32-DSP16_QB, DSP16_QB, 1./DSP_GAUSS_TETA) >> (DSP16_QB >> 1); 00070 00071 // Initialization 00072 t = DSP16_Q(0.); 00073 // Increment 1/((N-1)/2) 00074 s = (DSP16_Q(1.)/(size-1)) << 1; 00075 00076 // Take advantage of the symmetry 00077 for(i=0; i<(size >> 1); i++) 00078 { 00079 // res = (n-(size-1)/2)/((size-1)/2*TETA)/2 00080 res = (((S32) (t - DSP16_Q(1.)))) >> ((DSP16_QB >> 1) + 1); 00081 #if (DSP16_QB & 1) 00082 res >>= 1; 00083 #endif 00084 res *= cst_c; 00085 00086 // res = -res^2 00087 res = res >> (DSP16_QB >> 1); 00088 #if (DSP16_QB & 1) 00089 res *= -(res >> 1); 00090 #else 00091 res *= -res; 00092 #endif 00093 00094 // Calculation of exp(res), where x <= 0 00095 // i.e. x = -25 00096 // k = floor(res/((log(2)))); 00097 x = res >> (DSP16_QB - 2); 00098 k = (x*cst_a) >> (DSP16_QB + 1); 00099 00100 if (k < -31) 00101 x = 0; 00102 else 00103 { 00104 // x = (k*log(2)) - res; 00105 x = ((S32) res) - cst_b*((S32) ++k); 00106 // Adjust 00107 if (x > 0) 00108 x = ((S32) res) - cst_b*((S32) ++k); 00109 // x = exp(x)*2^k 00110 x = dsp16_op_exp(x) >> dsp16_op_abs(k); 00111 } 00112 00113 // Compute the first half of the window 00114 vect1[i] = x; 00115 // Compute the rest of the window 00116 vect1[size-i-1] = x; 00117 00118 t += s; 00119 } 00120 00121 // If the size is odd 00122 if (size & 1) 00123 vect1[size >> 1] = DSP16_Q(1.); 00124 }
void dsp16_win_hamm | ( | dsp16_t * | vect1, | |
int | size | |||
) |
16-bit fixed point version of the hamming windowing function.
vect1 | A pointer on the 16-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 60 of file win_hamming.c.
References dsp16_op_cos(), DSP16_Q, DSP16_QB, WIN_HAMM_A0, and WIN_HAMM_A1.
Referenced by dsp_process_init().
00061 { 00062 dsp16_t s, t, w; 00063 int i; 00064 00065 // Initialization 00066 t = DSP16_Q(0.); 00067 // Calculation of 2/(N-1) <- because a cos is in the range [-1; 1], 00068 // therefore -1 equals -PI and 1, PI. 00069 s = (DSP16_Q(1.)/(size - 1)) << 1; 00070 00071 // Compute the window 00072 for(i=0; i<(size >> 1); i++) 00073 { 00074 w = DSP16_Q(WIN_HAMM_A0); 00075 w -= (((S32) DSP16_Q(WIN_HAMM_A1))*((S32) dsp16_op_cos(t))) >> DSP16_QB; 00076 vect1[i] = w; 00077 vect1[size-i-1] = w; 00078 t += s; 00079 } 00080 00081 // If the size is odd 00082 if (size & 1) 00083 vect1[size >> 1] = DSP16_Q(1.); 00084 }
void dsp16_win_hann | ( | dsp16_t * | vect1, | |
int | size | |||
) |
16-bit fixed point version of the hann windowing function.
vect1 | A pointer on the 16-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 58 of file win_hann.c.
References dsp16_op_cos(), DSP16_Q, DSP16_QB, and WIN_HANN_A0.
Referenced by resampling_windowing().
00059 { 00060 S32 w; 00061 dsp16_t s, t; 00062 int i; 00063 00064 // Initialization 00065 t = DSP16_Q(0.); 00066 // Calculation of 2/(N-1) <- because a cos is in the range [-1; 1], 00067 // therefore -1 equals -PI and 1, PI. 00068 s = (DSP16_Q(1.)/(size - 1)) << 1; 00069 00070 // Compute the window 00071 for(i=0; i<(size >> 1); i++) 00072 { 00073 w = DSP16_Q(1.); 00074 w -= (S32) dsp16_op_cos(t); 00075 w = (w*((S32) DSP16_Q(WIN_HANN_A0))) >> DSP16_QB; 00076 vect1[i] = w; 00077 vect1[size-i-1] = w; 00078 t += s; 00079 } 00080 00081 // If the size is odd 00082 if (size & 1) 00083 vect1[size >> 1] = DSP16_Q(1.); 00084 }
void dsp16_win_kaiser | ( | dsp16_t * | vect1, | |
int | size, | |||
int | alpha | |||
) |
16-bit fixed point version of the kaiser windowing function.
vect1 | A pointer on the 16-bit real vector that will contain the window. | |
size | The size of the output buffer. | |
alpha | The alpha coefficient which must be greater than 0. |
Definition at line 152 of file win_dsp16_kaiser.c.
References CST_PI, dsp16_op_kaiser_i0(), DSP16_Q, DSP16_QB, dsp32_op_sqrt(), DSP32_QB, and DSP_Q.
00153 { 00154 int n, power_num, power_den; 00155 S32 pi_alpha, pi_alpha_div; 00156 S32 temp32; 00157 dsp16_t s, t, temp16, num, den; 00158 00159 // 2/(N-1) 00160 s = (DSP16_Q(1.) / (size - 1)) << 1; 00161 // PI*alpha 00162 pi_alpha = ((S32) DSP_Q(32-DSP16_QB, DSP16_QB, CST_PI))*alpha; 00163 // PI*alpha >> floor(DSP16_QB/2) 00164 pi_alpha_div = pi_alpha >> (DSP16_QB >> 1); 00165 // I0(PI*alpha); 00166 den = dsp16_op_kaiser_i0(pi_alpha, &power_den); 00167 00168 t = 0; 00169 // Take advantage of the symmetry 00170 for(n=0; n<(size >> 1); n++) 00171 { 00172 // 2*n/(N-1)-1 00173 temp16 = t - DSP16_Q(1); 00174 // (2*n/(N-1)-1)^2 00175 temp16 = (((S32) temp16) * ((S32) temp16)) >> DSP16_QB; 00176 // sqrt(1-(2*n/(N-1)-1)^2) 00177 // Uses 32-bit sqrt because of precision needed 00178 temp16 = dsp32_op_sqrt((DSP16_Q(1.) - temp16) << (DSP32_QB - DSP16_QB)) >> (DSP32_QB - DSP16_QB); 00179 00180 // PI*alpha*sqrt(1-(2*n/(N-1)-1)^2) 00181 #if (DSP16_QB & 1) 00182 temp32 = (pi_alpha_div * ((S32) temp16)) >> ((DSP16_QB >> 1) + 1); 00183 #else 00184 temp32 = (pi_alpha_div * ((S32) temp16)) >> (DSP16_QB >> 1); 00185 #endif 00186 // I0(temp); 00187 num = dsp16_op_kaiser_i0(temp32, &power_num); 00188 00189 // Perform the division 00190 power_num = power_den - power_num; 00191 00192 temp32 = ((S32) num) << (DSP16_QB); 00193 temp32 = temp32 / (S32) den; 00194 temp32 >>= power_num; 00195 00196 vect1[n] = temp32; 00197 vect1[size-n-1] = temp32; 00198 00199 // t = 2/(N-1)*n 00200 t += s; 00201 } 00202 00203 // If the size is odd 00204 if (size & 1) 00205 vect1[size >> 1] = DSP16_Q(1.); 00206 }
void dsp16_win_rect | ( | dsp16_t * | vect1, | |
int | size | |||
) |
16-bit fixed point version of the rectangular windowing function.
vect1 | A pointer on the 16-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 53 of file win_rectangular.c.
References DSP16_Q.
00054 { 00055 while(size--) 00056 vect1[size] = DSP16_Q(1.); 00057 }
void dsp16_win_welch | ( | dsp16_t * | vect1, | |
int | size | |||
) |
16-bit fixed point version of the welch windowing function.
vect1 | A pointer on the 16-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 53 of file win_welch.c.
References DSP16_Q, and DSP16_QB.
00054 { 00055 dsp16_t s, t, w; 00056 int i; 00057 00058 // Initialization 00059 t = DSP16_Q(0.); 00060 // Increment 1/(size*0.5) 00061 s = (DSP16_Q(1.) / size) << 1; 00062 // Compute the 1st half 00063 for(i=0; i<(size >> 1); i++) 00064 { 00065 w = t - DSP16_Q(1.); 00066 w = (((S32) w)*((S32) w)) >> DSP16_QB; 00067 w = DSP16_Q(1.) - w; 00068 vect1[i] = w; 00069 vect1[size-i-1] = w; 00070 t += s; 00071 } 00072 00073 // If the size is odd 00074 if (size & 1) 00075 vect1[size >> 1] = DSP16_Q(1.); 00076 }
void dsp32_win_bart | ( | dsp32_t * | vect1, | |
int | size | |||
) |
32-bit fixed point version of the bartlett windowing function.
vect1 | A pointer on the 32-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 80 of file win_bartlett.c.
References DSP32_Q.
00081 { 00082 dsp32_t s, t; 00083 int i; 00084 00085 // Initialization 00086 t = DSP32_Q(0.); 00087 // Increment 00088 s = (DSP32_Q(1.) / size) << 1; 00089 // Compute the 1st half 00090 for(i=0; i<(size >> 1); i++) 00091 { 00092 vect1[i] = t; 00093 vect1[size-i-1] = t; 00094 t += s; 00095 } 00096 00097 // If the size is odd 00098 if (size & 1) 00099 vect1[size >> 1] = DSP32_Q(1.); 00100 00101 }
void dsp32_win_black | ( | dsp32_t * | vect1, | |
int | size | |||
) |
32-bit fixed point version of the blackman windowing function.
vect1 | A pointer on the 32-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 106 of file win_blackman.c.
References dsp32_op_cos(), DSP32_Q, DSP32_QB, WIN_BLACK_A0, WIN_BLACK_A1, and WIN_BLACK_A2.
00107 { 00108 dsp32_t s, t, w; 00109 S64 temp64; 00110 int i; 00111 00112 // Initialization 00113 t = DSP32_Q(0.); 00114 // Calculation of 2/(N-1) <- because a cos is in the range [-1; 1], 00115 // therefore -1 equals -PI and 1, PI. 00116 s = (DSP32_Q(1.)/(size - 1)) << 1; 00117 00118 // Compute the window 00119 for(i=0; i<(size >> 1); i++) 00120 { 00121 w = DSP32_Q(WIN_BLACK_A0); 00122 00123 temp64 = DSP32_Q(WIN_BLACK_A1); 00124 temp64 *= dsp32_op_cos(t); 00125 temp64 >>= DSP32_QB; 00126 w -= temp64; 00127 00128 temp64 = DSP32_Q(WIN_BLACK_A2); 00129 temp64 *= dsp32_op_cos(t << 1); 00130 temp64 >>= DSP32_QB; 00131 w += temp64; 00132 00133 vect1[i] = w; 00134 vect1[size-i-1] = w; 00135 t += s; 00136 } 00137 00138 // If the size is odd 00139 if (size & 1) 00140 vect1[size >> 1] = DSP32_Q(1.); 00141 }
void dsp32_win_gauss | ( | dsp32_t * | vect1, | |
int | size | |||
) |
32-bit fixed point version of the gaussian windowing function.
vect1 | A pointer on the 32-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 137 of file win_gauss.c.
References CST_LN_2, dsp32_op_abs(), dsp32_op_exp(), DSP32_Q, DSP32_QB, and DSP_GAUSS_TETA.
00138 { 00139 int k, i; 00140 dsp32_t s, t; 00141 S64 x, res; 00142 // CST = 1/(2*ln(2)) 00143 const S64 cst_a = (S64) ((1LL/CST_LN_2)*(1LL << (DSP32_QB-1))); 00144 // CST = ln(2) 00145 const S64 cst_b = (S64) DSP32_Q(CST_LN_2); 00146 // CST = 1./DSP_GAUSS_TETA*2^-floor(DSP16_QB/2) 00147 const S64 cst_c = (S64) ((1LL/DSP_GAUSS_TETA)*(1LL << (DSP32_QB-(DSP32_QB >> 1)))); 00148 00149 // Initialization 00150 t = DSP32_Q(0.); 00151 // Increment 1/((N-1)/2) 00152 s = (DSP32_Q(1.)/(size-1)) << 1; 00153 00154 // Take advantage of the symmetry 00155 for(i=0; i<(size >> 1); i++) 00156 { 00157 // res = (n-(size-1)/2)/((size-1)/2*TETA)/2 00158 res = (((S64) (t - DSP32_Q(1.)))) >> ((DSP32_QB >> 1) + 1); 00159 #if (DSP32_QB & 1) 00160 res >>= 1; 00161 #endif 00162 res *= cst_c; 00163 00164 // res = -res^2 00165 res = res >> (DSP32_QB >> 1); 00166 #if (DSP32_QB & 1) 00167 res *= -(res >> 1); 00168 #else 00169 res *= -res; 00170 #endif 00171 00172 // Calculation of exp(res), where x <= 0 00173 // i.e. x = -25 00174 // k = floor(res/((log(2)))); 00175 x = res >> (DSP32_QB - 2); 00176 k = (x*cst_a) >> (DSP32_QB + 1); 00177 00178 if (k < -31) 00179 x = 0; 00180 else 00181 { 00182 // x = (k*log(2)) - res; 00183 x = ((S64) res) - cst_b*((S64) ++k); 00184 // Adjust 00185 if (x > 0) 00186 x = ((S64) res) - cst_b*((S64) ++k); 00187 // x = exp(x)*2^k 00188 x = dsp32_op_exp(x) >> dsp32_op_abs(k); 00189 } 00190 00191 // Compute the first half of the window 00192 vect1[i] = x; 00193 // Compute the rest of the window 00194 vect1[size-i-1] = x; 00195 00196 t += s; 00197 } 00198 00199 // If the size is odd 00200 if (size & 1) 00201 vect1[size >> 1] = DSP32_Q(1.); 00202 }
void dsp32_win_hamm | ( | dsp32_t * | vect1, | |
int | size | |||
) |
32-bit fixed point version of the hamming windowing function.
vect1 | A pointer on the 32-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 92 of file win_hamming.c.
References dsp32_op_cos(), DSP32_Q, DSP32_QB, WIN_HAMM_A0, and WIN_HAMM_A1.
00093 { 00094 dsp32_t s, t, w; 00095 int i; 00096 00097 // Initialization 00098 t = DSP32_Q(0.); 00099 // Calculation of 2/(N-1) <- because a cos is in the range [-1; 1], 00100 // therefore -1 equals -PI and 1, PI. 00101 s = (DSP32_Q(1.)/(size - 1)) << 1; 00102 00103 // Compute the window 00104 for(i=0; i<(size >> 1); i++) 00105 { 00106 w = DSP32_Q(WIN_HAMM_A0); 00107 w -= (((S64) DSP32_Q(WIN_HAMM_A1))*((S64) dsp32_op_cos(t))) >> DSP32_QB; 00108 vect1[i] = w; 00109 vect1[size-i-1] = w; 00110 t += s; 00111 } 00112 00113 // If the size is odd 00114 if (size & 1) 00115 vect1[size >> 1] = DSP32_Q(1.); 00116 }
void dsp32_win_hann | ( | dsp32_t * | vect1, | |
int | size | |||
) |
32-bit fixed point version of the hann windowing function.
vect1 | A pointer on the 32-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 92 of file win_hann.c.
References dsp32_op_cos(), DSP32_Q, DSP32_QB, and WIN_HANN_A0.
00093 { 00094 S64 w; 00095 dsp32_t s, t; 00096 int i; 00097 00098 // Initialization 00099 t = DSP32_Q(0.); 00100 // Calculation of 2/(N-1) <- because a cos is in the range [-1; 1], 00101 // therefore -1 equals -PI and 1, PI. 00102 s = (DSP32_Q(1.)/(size - 1)) << 1; 00103 00104 // Compute the window 00105 for(i=0; i<(size >> 1); i++) 00106 { 00107 w = DSP32_Q(1.); 00108 w -= (S64) dsp32_op_cos(t); 00109 w = (w*((S64) DSP32_Q(WIN_HANN_A0))) >> DSP32_QB; 00110 vect1[i] = w; 00111 vect1[size-i-1] = w; 00112 t += s; 00113 } 00114 00115 // If the size is odd 00116 if (size & 1) 00117 vect1[size >> 1] = DSP32_Q(1.); 00118 }
void dsp32_win_kaiser | ( | dsp32_t * | vect1, | |
int | size, | |||
int | alpha | |||
) |
32-bit fixed point version of the kaiser windowing function.
vect1 | A pointer on the 32-bit real vector that will contain the window. | |
size | The size of the output buffer. | |
alpha | The alpha coefficient which must be greater than 0. |
Definition at line 161 of file win_dsp32_kaiser.c.
References CST_PI, dsp32_op_kaiser_i0(), dsp32_op_sqrt(), DSP32_Q, and DSP32_QB.
00162 { 00163 int n, power_num, power_den; 00164 S64 pi_alpha, pi_alpha_div; 00165 S64 temp64; 00166 dsp32_t s, t, temp32, num, den; 00167 00168 // 2/(N-1) 00169 s = (DSP32_Q(1.) / (size - 1)) << 1; 00170 // PI*alpha 00171 pi_alpha = (S64) (CST_PI*(1LL << DSP32_QB))*alpha; 00172 // PI*alpha >> floor(DSP32_QB/2) 00173 pi_alpha_div = pi_alpha >> (DSP32_QB >> 1); 00174 // I0(PI*alpha); 00175 den = dsp32_op_kaiser_i0(pi_alpha, &power_den); 00176 00177 t = 0; 00178 // Take advantage of the symmetry 00179 for(n=0; n<(size >> 1); n++) 00180 { 00181 // 2*n/(N-1)-1 00182 temp32 = t - DSP32_Q(1); 00183 // (2*n/(N-1)-1)^2 00184 temp32 = (((S64) temp32) * ((S64) temp32)) >> DSP32_QB; 00185 // sqrt(1-(2*n/(N-1)-1)^2) 00186 temp32 = dsp32_op_sqrt(DSP32_Q(1.) - temp32); 00187 00188 // PI*alpha*sqrt(1-(2*n/(N-1)-1)^2) 00189 #if (DSP32_QB & 1) 00190 temp64 = (pi_alpha_div * ((S64) temp32)) >> ((DSP32_QB >> 1) + 1); 00191 #else 00192 temp64 = (pi_alpha_div * ((S64) temp32)) >> (DSP32_QB >> 1); 00193 #endif 00194 // I0(temp); 00195 num = dsp32_op_kaiser_i0(temp64, &power_num); 00196 00197 // Perform the division 00198 power_num = power_den - power_num; 00199 00200 temp64 = ((S64) num) << (DSP32_QB); 00201 temp64 = temp64 / (S64) den; 00202 temp64 >>= power_num; 00203 00204 vect1[n] = temp64; 00205 vect1[size-n-1] = temp64; 00206 00207 // t = 2/(N-1)*n 00208 t += s; 00209 } 00210 00211 // If the size is odd 00212 if (size & 1) 00213 vect1[size >> 1] = DSP32_Q(1.); 00214 }
void dsp32_win_rect | ( | dsp32_t * | vect1, | |
int | size | |||
) |
32-bit fixed point version of the rectangular windowing function.
vect1 | A pointer on the 32-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 65 of file win_rectangular.c.
References DSP32_Q.
00066 { 00067 while(size--) 00068 vect1[size] = DSP32_Q(1.); 00069 }
void dsp32_win_welch | ( | dsp32_t * | vect1, | |
int | size | |||
) |
32-bit fixed point version of the welch windowing function.
vect1 | A pointer on the 32-bit real vector that will contain the window. | |
size | The size of the output buffer. |
Definition at line 84 of file win_welch.c.
References DSP32_Q, and DSP32_QB.
00085 { 00086 dsp32_t s, t, w; 00087 int i; 00088 00089 // Initialization 00090 t = DSP32_Q(0.); 00091 // Increment 1/(size*0.5) 00092 s = (DSP32_Q(1.) / size) << 1; 00093 // Compute the 1st half 00094 for(i=0; i<(size >> 1); i++) 00095 { 00096 w = t - DSP32_Q(1.); 00097 w = (((S64) w)*((S64) w)) >> DSP32_QB; 00098 w = DSP32_Q(1.) - w; 00099 vect1[i] = w; 00100 vect1[size-i-1] = w; 00101 t += s; 00102 } 00103 00104 // If the size is odd 00105 if (size & 1) 00106 vect1[size >> 1] = DSP32_Q(1.); 00107 }