Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test find impulse response delay complex #573

Merged

Conversation

tluebeck
Copy link

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

Closes #

Changes proposed in this pull request:

@tluebeck tluebeck requested review from f-brinkmann, ahms5, mberz and sikersten and removed request for f-brinkmann and ahms5 April 10, 2024 12:28
Copy link
Member

@ahms5 ahms5 left a comment

Choose a reason for hiding this comment

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

I have just the confusion about the 'psd' for normalization, otherwise its fine.

if self._complex and fft_norm == "rms":
raise ValueError(("'rms' normalization is not valid for "
"complex time signals"))
if self._complex and fft_norm in ["rms", "power"]:
Copy link
Member

Choose a reason for hiding this comment

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

how about 'psd'?

Copy link
Member

Choose a reason for hiding this comment

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

This is part of #567 - should be fixe after that one is merged...

@@ -957,8 +957,8 @@ def fft_norm(self, value):
raise ValueError(("Invalid FFT normalization. Has to be "
f"{', '.join(self._VALID_FFT_NORMS)}, but found "
f"'{value}'"))
if self._complex and value == "rms":
raise ValueError(("'rms' normalization is not valid for "
if self._complex and value in ["rms", "power"]:
Copy link
Member

Choose a reason for hiding this comment

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

how about 'psd'?

Copy link
Member

Choose a reason for hiding this comment

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

see above

Copy link
Member

@f-brinkmann f-brinkmann left a comment

Choose a reason for hiding this comment

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

Are all of those changes required for the delay estimation? There might be other changes in this PR.

pyfar/dsp/dsp.py Outdated
for ch in np.ndindex(impulse_response.cshape):
# Calculate the correlation between the impulse response and its
# minimum phase equivalent. This requires a minimum phase equivalent
# in the strict sense, instead of the appriximation implemented in
# pyfar.
n_samples = impulse_response.n_samples
for idx, mode in zip(range(0, len(modes)), modes):
Copy link
Member

Choose a reason for hiding this comment

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

This looks better

Suggested change
for idx, mode in zip(range(0, len(modes)), modes):
for idx, mode in enumerate(modes):

Copy link
Author

Choose a reason for hiding this comment

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

thanks, your're right.

Copy link
Author

Choose a reason for hiding this comment

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

I think we need all these changes, see the discussion in slack:
We want to calculate the delay independently for real and imaginary part, and return the minimum of both. I don't see a more elegant way.

Base automatically changed from complex_deconvolution to develop_complex_signals April 25, 2024 14:00
@tluebeck tluebeck merged commit 2430d3c into develop_complex_signals Apr 25, 2024
8 checks passed
@tluebeck tluebeck deleted the test_find_impulse_response_delay_complex branch April 25, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants