X-Git-Url: https://code.octet-stream.net/m17rt/blobdiff_plain/61c96b473ce4d5dec8c46235595c519e7f868cd5..8d1ce395337cf7d508500b13c574eaeb401f1e77:/m17core/src/modem.rs diff --git a/m17core/src/modem.rs b/m17core/src/modem.rs index 35a23a7..b459826 100644 --- a/m17core/src/modem.rs +++ b/m17core/src/modem.rs @@ -65,9 +65,9 @@ impl Demodulator for SoftDemodulator { return None; } - let mut burst_window = [0f32; 71]; - for i in 0..71 { - let c = (self.rx_cursor + i) % 1920; + let mut burst_window = [0f32; 8]; + for i in 0..8 { + let c = (self.rx_cursor + (i * 10)) % 1920; burst_window[i] = self.rx_win[c]; } @@ -419,7 +419,7 @@ impl Modulator for SoftModulator { // if we have pre-TX padding to accommodate TxDelay then expend that first if self.tx_delay_padding > 0 { - let len = out.len().max(self.tx_delay_padding); + let len = out.len().min(self.tx_delay_padding); self.tx_delay_padding -= len; for x in 0..len { out[x] = 0;