Fixed i and q being swapped in multiple places
This commit is contained in:
parent
c3886bf888
commit
d19c799151
|
@ -297,8 +297,8 @@ mod app {
|
|||
|
||||
let mut samples = [Complex::<f32>::default(); 128];
|
||||
for idx in 0..buffer.len() / 2 {
|
||||
let q_raw = buffer[idx * 2];
|
||||
let i_raw = buffer[idx * 2 + 1];
|
||||
let i_raw = buffer[idx * 2];
|
||||
let q_raw = buffer[idx * 2 + 1];
|
||||
|
||||
*cx.local.i_offset = 0.95 * *cx.local.i_offset + 0.05 * (i_raw as f32);
|
||||
*cx.local.q_offset = 0.95 * *cx.local.q_offset + 0.05 * (q_raw as f32);
|
||||
|
@ -306,7 +306,7 @@ mod app {
|
|||
let i_sample = (i_raw as f32) - *cx.local.i_offset;
|
||||
let q_sample = (q_raw as f32) - *cx.local.q_offset;
|
||||
|
||||
samples[idx] = Complex::new(q_sample as f32 / 4096.0, i_sample as f32 / 4096.0);
|
||||
samples[idx] = Complex::new(i_sample as f32 / 4096.0, q_sample as f32 / 4096.0);
|
||||
}
|
||||
|
||||
let mut fft_input = [Complex::<f32>::default(); 128];
|
||||
|
|
Loading…
Reference in New Issue