lockin-internal: align processing with lockin-external
This commit is contained in:
parent
f9b5d29450
commit
9ee60824d4
|
@ -107,12 +107,18 @@ const APP: () = {
|
||||||
.last()
|
.last()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
// convert i/q to power/phase,
|
||||||
|
let power_phase = true; // TODO: expose
|
||||||
|
|
||||||
|
let output = if power_phase {
|
||||||
// Convert from IQ to power and phase.
|
// Convert from IQ to power and phase.
|
||||||
let _power = output.abs_sqr();
|
[output.abs_sqr(), output.arg()]
|
||||||
let phase = output.arg() >> 16;
|
} else {
|
||||||
|
[output.0, output.1]
|
||||||
|
};
|
||||||
|
|
||||||
for value in dac_samples[1].iter_mut() {
|
for value in dac_samples[1].iter_mut() {
|
||||||
*value = phase as u16 ^ 0x8000;
|
*value = (output[1] >> 16) as u16 ^ 0x8000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue