fix first point

This commit is contained in:
awe
2026-06-09 19:00:40 +03:00
parent 1fd0f05d66
commit 41274b6e39

View File

@ -134,9 +134,9 @@ def process_main(main_ch1, main_ch2, ref_amplitude, ref_phase_aligned):
z_main = ch1_v + 1j * ch2_v
main_amp = np.abs(z_main)
# Normalize by ref amplitude and subtract ref phase
# Normalize by ref amplitude and subtract ref phase of first point
ref_amp_safe = np.where(ref_amplitude > 1e-12, ref_amplitude, 1e-12)
z_norm = (ch1_v / ref_amp_safe + 1j * ch2_v / ref_amp_safe) * np.exp(-1j * ref_phase_aligned)
z_norm = (ch1_v / ref_amp_safe + 1j * ch2_v / ref_amp_safe) * np.exp(-1j * ref_phase_aligned[0])
norm_ch1 = np.real(z_norm)
norm_ch2 = np.imag(z_norm)