FEAT: General auralization #90
Merged
mberz merged 12 commits intoengd_project_2026from May 10, 2026
Merged
Conversation
5d1d4a9 to
fb9cdc7
Compare
There was a problem hiding this comment.
Pull request overview
Adds a generalized auralization/export path so simulations produce a standardized impulse-response WAV on completion, and auralizations can be generated via a simplified convolution-based pipeline (intended to replace method-specific implementations).
Changes:
- Add
pyfardependency for WAV IO, normalization, resampling, and convolution. - Generate an impulse-response
.wavafter solver completion inSimulationService. - Add
mono_aural_auralizationto convolve a dry input signal with an exported IR WAV for non-DE/DG methods.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| requirements.txt | Adds pyfar dependency used for audio processing and WAV export. |
| app/services/simulation_service.py | Writes impulse-response WAV after solver run; refactors export flow and cancellation handling. |
| app/services/auralization_service.py | Adds generalized convolution-based auralization path and helper function for non-DE/DG methods. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
291
to
+309
| match simulation.simulationMethod: | ||
| case "DE": | ||
| _, _ = auralization_calculation(signal_file_name, pressure_file_name, wav_output_file_name) | ||
| case "DG": | ||
| _, _ = auralization_calculation_DG(signal_file_name, pressure_file_name, wav_output_file_name) | ||
|
|
||
| case _: | ||
| #TODO: We want a single universal auralization method, | ||
| # without having to switch logic between them for each simulation method. | ||
| # This will be implemented in the function mono_aural_auralization, which will be a | ||
| # general convolution-based auralization method using the RIR. | ||
| # This method does not rely on the pressure.csv file, but the wav file directly | ||
| pressure_file_name_wav = os.path.join( | ||
| DefaultConfig.UPLOAD_FOLDER_NAME, export.name.replace(".xlsx", ".wav") | ||
| ) | ||
| mono_aural_auralization( | ||
| signal_file_name, | ||
| pressure_file_name_wav, | ||
| wav_output_file_name | ||
| ) |
### Proposed changes It seems they were not updated on code refactoring. I'm marking them to skip and create an issue to keep track of the issue.
The executor tests require setting up Mocks and Docker. The set-up for these is currently located in .github/workflows/engd2026.yml
### Proposed changes - Remove the documentation entries for removed simulation backends - Remove obsolete entries for example gallery - Remove example gallery plugin
…ods returning a RIR
…tion method and result export in the SimulationService and AuralizationService)
…oach. Also refactored a bit so that a not-working xlsx export will not break the auralization.
…t normalise a signal filled with 0s.
fb9cdc7 to
3d829d2
Compare
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.
Changes
These new functions should replace individual/method specific implementations which are based on simple convolution with the RIR returned by the simulation methods.
Replaces #83