When summing sectorized signals, a compensation factor $\beta$ is required to ensure the reconstructed signal preserves either the total amplitude or the total energy.
Amplitude Reconstruction
To preserve amplitude, use $\beta_a$. The reconstructed signal is obtained by performing an Inverse Spherical Harmonic Transform (iSHT) on the sum of the sectorized signals multiplied by $\beta_a$.
Energy Reconstruction
To preserve energy, use $\beta_e$. The reconstructed signal is obtained by performing an SHT on the sum of the squared magnitudes of the sectorized signals multiplied by $\beta_e$.
Workflow:
- Transform SH coefficients to the discrete domain using
spa.sph.inverse_sht. - Sum the discrete sector signals.
- Apply the appropriate $\beta$ factor.
- Transform back to the SH domain using
spa.sph.sht.
# 1. iSHT to discrete domain
trans_azi, trans_zen, _ = spa.utils.cart2sph(*spa.grids.load_t_design(2*N_sph_sec).T)
secs = spa.sph.inverse_sht(w_sec_nm.T, trans_azi, trans_zen, 'real')
# 2. Amplitude Reconstruction
# beta_a calculation (example logic)
beta_a = np.sqrt(4*np.pi) / (w_sec_nm[0, 0] * len(secs))
w0_a = spa.sph.sht(np.sum(beta_a * secs, axis=1),
N_sph_sec, trans_azi, trans_zen, 'real')
# 3. Energy Reconstruction
# beta_e calculation (example logic)
beta_e = 1 / (w_sec_nm[0, :].conj() @ w_sec_nm[0, :] / np.sqrt(4*np.pi) * len(secs)/np.sqrt(4*np.pi))
w0_e = spa.sph.sht(beta_e * np.sum(np.abs(secs)**2, axis=1),
N_sph_sec, trans_azi, trans_zen, 'real')