swap sin and cos for demodulation

The in-phase component should be multiplied by the sin value and the
quadrature component should be multiplied by the cos value.
master
Matt Huszagh 2021-01-14 14:49:07 -08:00
parent 9a3c9afa7e
commit f0eb58dfb2
1 changed files with 2 additions and 2 deletions

View File

@ -1019,9 +1019,9 @@ const APP: () = {
// shift cos/sin before multiplying to avoid i64 multiplication
signal.0 =
adc_samples[0][i] as i16 as i32 * shift_round(cos, 16);
signal.1 =
adc_samples[0][i] as i16 as i32 * shift_round(sin, 16);
signal.1 =
adc_samples[0][i] as i16 as i32 * shift_round(cos, 16);
signal.0 =
iir_lockin.update(&mut iir_state_lockin[0], signal.0);