From a20c653351a201b7fd3d0c706f957d77959d0c7e Mon Sep 17 00:00:00 2001 From: dernasherbrezon Date: Sat, 2 Nov 2024 00:33:30 +0000 Subject: [PATCH] support custom frame length for stratosattk1 --- src/main/java/ru/r2cloud/jradio/source/RtlSdr.java | 2 +- src/main/java/ru/r2cloud/jradio/sstk1/StratosatTk1.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/ru/r2cloud/jradio/source/RtlSdr.java b/src/main/java/ru/r2cloud/jradio/source/RtlSdr.java index f691ee23..a800e1cc 100644 --- a/src/main/java/ru/r2cloud/jradio/source/RtlSdr.java +++ b/src/main/java/ru/r2cloud/jradio/source/RtlSdr.java @@ -37,7 +37,7 @@ public RtlSdr(InputStream iqStream, float sampleRate, Long totalSamples) { buffer = new byte[BUFFER_SIZE]; maxBytes = buffer.length; lookupTable = new float[0x100]; - for (int i = 0; i < 256; ++i) { + for (int i = 0; i < lookupTable.length; ++i) { lookupTable[i] = (i - 127.5f) / 128.0f; } context = new Context(); diff --git a/src/main/java/ru/r2cloud/jradio/sstk1/StratosatTk1.java b/src/main/java/ru/r2cloud/jradio/sstk1/StratosatTk1.java index 55073e89..853eb230 100644 --- a/src/main/java/ru/r2cloud/jradio/sstk1/StratosatTk1.java +++ b/src/main/java/ru/r2cloud/jradio/sstk1/StratosatTk1.java @@ -15,12 +15,16 @@ import ru.r2cloud.jradio.fec.ccsds.UncorrectableException; public class StratosatTk1 extends BeaconSource { - + private static final Logger LOG = LoggerFactory.getLogger(StratosatTk1.class); private final AdditiveScrambler scrambler; public StratosatTk1(ByteInput demod) { - super(new CorrelateSyncword(new SoftToHard(demod), 4, "10010011000010110101000111011110", 66 * 8)); + this(demod, 66); + } + + public StratosatTk1(ByteInput demod, int beaconSizeBytes) { + super(new CorrelateSyncword(new SoftToHard(demod), 4, "10010011000010110101000111011110", beaconSizeBytes * 8)); scrambler = new AdditiveScrambler(0x21, 0x1ff, 8, 8); }