Rename and improve freq parameter in the edc module#152
Open
Rename and improve freq parameter in the edc module#152
freq parameter in the edc module#152Conversation
…cept an array-like `smoothing_parameter`.
h-chmeruk
commented
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( |
Author
There was a problem hiding this comment.
I'm not entirely satisfied with this cumbersome if statement, so I would appreciate a suggestion for improvement
h-chmeruk
commented
Mar 13, 2026
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( |
Author
There was a problem hiding this comment.
I'm not satisfied with this if statement either, so feel free to suggest something else :)
freq paramter in the edc modulefreq parameter in the edc module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue(s) are closed by this pull request?
Closes #123
Changes proposed in this pull request:
freqparameter tosmoothing_parametereverywhere in the code, including in the filesexamples/energy_decay_curves_and_reverberation_time.ipynbandtests/test_data/test_notebook.ipynbsmoothing_parameterdsp._smooth_rir(data, sampling_rate, smooth_block_length=0.075)so thatsmooth_block_lengthcan be an array-like value.test_intersection_time_smoothing_parameter_error()andtest_intersection_time_smoothing_parameter_array_like()