Showing the changes to src (1 of 1 file). Show all
Unified · Split
| @@ -222,28 +222,20 @@ static void dft_stage_init( · 221 unmodified lines | |||
| 222 | if (!f->num_taps) { | 222 | if (!f->num_taps) { |
| 223 | int num_taps = 0, dft_length, i; | 223 | int num_taps = 0, dft_length, i; |
| 224 | int k = phase == 50 && lsx_is_power_of_2(L) && Fn == L? L << 1 : 4; | 224 | int k = phase == 50 && lsx_is_power_of_2(L) && Fn == L? L << 1 : 4; |
| 225 | fprint(2, "#0\n"); | ||
| 226 | double * h = lsx_design_lpf(Fp, Fs, Fn, att, &num_taps, -k, -1.); | 225 | double * h = lsx_design_lpf(Fp, Fs, Fn, att, &num_taps, -k, -1.); |
| 227 | fprint(2, "#1\n"); | ||
| 228 | if (phase != 50) | 226 | if (phase != 50) |
| 229 | lsx_fir_to_phase(&h, &num_taps, &f->post_peak, phase); | 227 | lsx_fir_to_phase(&h, &num_taps, &f->post_peak, phase); |
| 230 | else f->post_peak = num_taps / 2; | 228 | else f->post_peak = num_taps / 2; |
| 231 | fprint(2, "#A\n"); | ||
| 232 | 229 | ||
| 233 | dft_length = lsx_set_dft_length(num_taps); | 230 | dft_length = lsx_set_dft_length(num_taps); |
| 234 | fprint(2, "#B\n"); | ||
| 235 | f->coefs = calloc(dft_length, sizeof(*f->coefs)); | 231 | f->coefs = calloc(dft_length, sizeof(*f->coefs)); |
| 236 | fprint(2, "#C\n"); | ||
| 237 | for (i = 0; i < num_taps; ++i) | 232 | for (i = 0; i < num_taps; ++i) |
| 238 | f->coefs[(i + dft_length - num_taps + 1) & (dft_length - 1)] | 233 | f->coefs[(i + dft_length - num_taps + 1) & (dft_length - 1)] |
| 239 | = h[i] / dft_length * 2 * L; | 234 | = h[i] / dft_length * 2 * L; |
| 240 | fprint(2, "#D\n"); | ||
| 241 | free(h); | 235 | free(h); |
| 242 | f->num_taps = num_taps; | 236 | f->num_taps = num_taps; |
| 243 | f->dft_length = dft_length; | 237 | f->dft_length = dft_length; |
| 244 | fprint(2, "#E\n"); | ||
| 245 | lsx_safe_rdft(dft_length, 1, f->coefs); | 238 | lsx_safe_rdft(dft_length, 1, f->coefs); |
| 246 | fprint(2, "#F\n"); | ||
| 247 | lsx_debug("fir_len=%i dft_length=%i Fp=%g Fs=%g Fn=%g att=%g %i/%i", | 239 | lsx_debug("fir_len=%i dft_length=%i Fp=%g Fs=%g Fn=%g att=%g %i/%i", |
| 248 | num_taps, dft_length, Fp, Fs, Fn, att, L, M); | 240 | num_taps, dft_length, Fp, Fs, Fn, att, L, M); |
| 249 | } | 241 | } |
| @@ -411,9 +403,7 @@ static void rate_init( · 161 unmodified lines | |||
| 411 | phases = !rational? (1 << phase_bits) : arbL; | 403 | phases = !rational? (1 << phase_bits) : arbL; |
| 412 | if (!f->interp[0].scalar) { | 404 | if (!f->interp[0].scalar) { |
| 413 | int phases0 = max(phases, 19), n0 = 0; | 405 | int phases0 = max(phases, 19), n0 = 0; |
| 414 | fprint(2, "#2\n"); | ||
| 415 | lsx_design_lpf(Fp, Fs, -Fn, attArb, &n0, phases0, f->beta); | 406 | lsx_design_lpf(Fp, Fs, -Fn, attArb, &n0, phases0, f->beta); |
| 416 | fprint(2, "#3\n"); | ||
| 417 | num_coefs = n0 / phases0 + 1, num_coefs += num_coefs & !preM; | 407 | num_coefs = n0 / phases0 + 1, num_coefs += num_coefs & !preM; |
| 418 | } | 408 | } |
| 419 | if ((num_coefs & 1) && rational && (arbL & 1)) | 409 | if ((num_coefs & 1) && rational && (arbL & 1)) |
| @@ -426,10 +416,8 @@ fprint(2, "#3\n"); · 6 unmodified lines | |||
| 426 | 416 | ||
| 427 | if (!arb_stage.shared->poly_fir_coefs) { | 417 | if (!arb_stage.shared->poly_fir_coefs) { |
| 428 | int num_taps = num_coefs * phases - 1; | 418 | int num_taps = num_coefs * phases - 1; |
| 429 | fprint(2, "#4\n"); | ||
| 430 | raw_coef_t * coefs = lsx_design_lpf( | 419 | raw_coef_t * coefs = lsx_design_lpf( |
| 431 | Fp, Fs, Fn, attArb, &num_taps, phases, f->beta); | 420 | Fp, Fs, Fn, attArb, &num_taps, phases, f->beta); |
| 432 | fprint(2, "#5\n"); | ||
| 433 | arb_stage.shared->poly_fir_coefs = prepare_coefs( | 421 | arb_stage.shared->poly_fir_coefs = prepare_coefs( |
| 434 | coefs, num_coefs, phases, order, 1); | 422 | coefs, num_coefs, phases, order, 1); |
| 435 | lsx_debug("fir_len=%i phases=%i coef_interp=%i size=%s", | 423 | lsx_debug("fir_len=%i phases=%i coef_interp=%i size=%s", |