Skip to content

Rename and improve freq parameter in the edc module#152

Open
h-chmeruk wants to merge 5 commits intodevelopfrom
fix/rename_freq_parameter
Open

Rename and improve freq parameter in the edc module#152
h-chmeruk wants to merge 5 commits intodevelopfrom
fix/rename_freq_parameter

Conversation

@h-chmeruk
Copy link

Which issue(s) are closed by this pull request?

Closes #123

Changes proposed in this pull request:

  • Renamed the freq parameter to smoothing_parameter everywhere in the code, including in the files examples/energy_decay_curves_and_reverberation_time.ipynb and tests/test_data/test_notebook.ipynb
  • Improved the docstring describing the smoothing_parameter
  • Modified the function dsp._smooth_rir(data, sampling_rate, smooth_block_length=0.075) so that smooth_block_length can be an array-like value.
  • Added two new test functions: test_intersection_time_smoothing_parameter_error() and test_intersection_time_smoothing_parameter_array_like()

…cept an array-like `smoothing_parameter`.
@h-chmeruk h-chmeruk added this to the v1.0.0 milestone Mar 13, 2026
@h-chmeruk h-chmeruk added the enhancement New feature or request label Mar 13, 2026
Comment on lines +449 to +459
if n_channels > 1:
for ch in range(n_channels):
reshaped_array = np.reshape(
data[ch, :n_samples_actual[ch]],
(n_blocks_min, n_samples_per_block[ch]))
time_window_data[ch, :] = np.mean(reshaped_array, axis=-1)
time_vector_window = (
(0.5+np.arange(0, n_blocks_min)).reshape(1, -1) * (
n_samples_per_block/sampling_rate).reshape(-1, 1))
else:
reshaped_array = np.reshape(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely satisfied with this cumbersome if statement, so I would appreciate a suggestion for improvement

pyrato/edc.py Outdated
Comment on lines +947 to +955
if len(np.atleast_1d(smoothing_parameter)) > 1:
output = _intersection_time_lundby(
time_window_data[ch], noise_estimation[ch], energy_data[ch],
np.squeeze(np.atleast_2d(time_vector_window)[ch, :]),
dB_above_noise, n_intervals_per_10dB,
use_dyn_range_for_regression, sampling_rate,
ch, failure_policy)
else:
output = _intersection_time_lundby(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not satisfied with this if statement either, so feel free to suggest something else :)

@h-chmeruk h-chmeruk changed the title Rename and improve freq paramter in the edc module Rename and improve freq parameter in the edc module Mar 13, 2026
@mberz mberz removed this from the v1.0.0 milestone Mar 18, 2026
@h-chmeruk h-chmeruk added this to the v1.1.0 milestone Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants