Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fakufaku committed Aug 7, 2024
1 parent 55f6289 commit a72eda7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pyroomacoustics/libroom_src/rir_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,22 @@ void threaded_fractional_delay_impl(
// relase the GIL from here on
py::gil_scoped_release release;

for (size_t idx = 0; idx < n_times; idx++) {
// LUT interpolation
T x_off_frac = (1. - tim_acc(idx)) * lut_gran_f;
T lut_gran_off = std::floor(x_off_frac);
T x_off = (x_off_frac - lut_gran_off);

int lut_pos = int(lut_gran_off);
for (size_t k = 0; k < fdl; lut_pos += lut_gran, k++)
out_acc(idx, k) =
hann[k] *
(sinc_lut[lut_pos] +
x_off * (sinc_lut[lut_pos + 1] - sinc_lut[lut_pos]));
}

// build the RIR
/*
ThreadPool pool(num_threads);
std::vector<std::future<void>> results;
for (size_t t_idx = 0; t_idx < num_threads; t_idx++) {
Expand All @@ -351,6 +366,7 @@ void threaded_fractional_delay_impl(
}
for (auto &&result : results) result.get();
*/
}

void fractional_delay(py::buffer out, const py::buffer time, size_t lut_gran,
Expand Down

0 comments on commit a72eda7

Please sign in to comment.