Skip to content

Conversation

@tluebeck
Copy link

@tluebeck tluebeck commented Jun 3, 2025

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

Closes #133

Changes proposed in this pull request:

@tluebeck tluebeck self-assigned this Jun 3, 2025
@tluebeck tluebeck added the enhancement New feature or request label Jun 3, 2025
@xefonon
Copy link
Member

xefonon commented Jun 14, 2025

@tluebeck #101 has been merged! 👍

@tluebeck tluebeck marked this pull request as ready for review July 1, 2025 07:16
@f-brinkmann f-brinkmann added this to the v1.0.0 milestone Jul 2, 2025
@f-brinkmann f-brinkmann moved this from Backlog to Require review in Weekly Planning Jul 2, 2025
Copy link
Member

@mberz mberz left a comment

Choose a reason for hiding this comment

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

I think we should review the concept again. Specifying all properties again does not use the power of the SH class at all from a users perspective.
Passing the SH class instead of creating it within the function would make things much easier in my opinion.

@mberz mberz moved this from Require review to Open Discussion in Weekly Planning Jul 2, 2025
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.

Thanks for the effort. Functionality is great to have and looks good to me. I only marked two points for reducing code for now.

Comment on lines +69 to +76
# move spherical samples to -2
data = np.moveaxis(data, axis, -2)

# perform transform
data_nm = np.tensordot(Y_inv, data, [1, -2])

# move SH channels to -2
data_nm = np.moveaxis(data_nm, 0, -2)
Copy link
Member

Choose a reason for hiding this comment

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

We have matrix multiplication implemented in pyfar arithmetics. If we use this, we can maybe avoid moving the axis by passing the axes parameter.

Comment on lines +82 to +111
if isinstance(signal, Signal):
sh_signal = SphericalHarmonicSignal(
data=data_nm,
basis_type=spherical_harmonics.basis_type,
normalization=spherical_harmonics.normalization,
channel_convention=spherical_harmonics.channel_convention,
condon_shortley=spherical_harmonics.condon_shortley,
sampling_rate=signal.sampling_rate,
fft_norm=signal.fft_norm,
is_complex=signal.complex,
comment=signal.comment)
elif isinstance(signal, TimeData):
sh_signal = SphericalHarmonicTimeData(
data=data_nm,
times=signal.times,
basis_type=spherical_harmonics.basis_type,
normalization=spherical_harmonics.normalization,
channel_convention=spherical_harmonics.channel_convention,
condon_shortley=spherical_harmonics.condon_shortley,
comment=signal.comment,
is_complex=False)
elif isinstance(signal, FrequencyData):
sh_signal = SphericalHarmonicFrequencyData(
data=data_nm,
frequencies=signal.frequencies,
basis_type=spherical_harmonics.basis_type,
normalization=spherical_harmonics.normalization,
channel_convention=spherical_harmonics.channel_convention,
condon_shortley=spherical_harmonics.condon_shortley,
comment=signal.comment)
Copy link
Member

Choose a reason for hiding this comment

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

After we have implemented the from_defition methods for the SHAudio classes, this could probably be shortened significantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature

Projects

Status: Implementation in progress

Development

Successfully merging this pull request may close these issues.

5 participants