capture: dedicate IQ segment (tee throttled writes to 1.5%), bound IQ window
This commit is contained in:
+13
-6
@@ -17,6 +17,7 @@ cd "$(dirname "$0")/.."
|
|||||||
DUR=$1; OUT=$2; IQ=$3; GAIN=${4:-42.1}; IQ_SEGMENTS=${5:-1}
|
DUR=$1; OUT=$2; IQ=$3; GAIN=${4:-42.1}; IQ_SEGMENTS=${5:-1}
|
||||||
|
|
||||||
SEG=${SEG_SECONDS:-140} # below the observed tuner death point
|
SEG=${SEG_SECONDS:-140} # below the observed tuner death point
|
||||||
|
IQ_SEG=${IQ_SEG_SECONDS:-90} # bounded IQ window (~290 MB)
|
||||||
RATE=1600000
|
RATE=1600000
|
||||||
|
|
||||||
: > "$OUT"
|
: > "$OUT"
|
||||||
@@ -52,12 +53,18 @@ while :; do
|
|||||||
echo "--- segment $segments: ${this}s (gain $GAIN)" >> "$ERR"
|
echo "--- segment $segments: ${this}s (gain $GAIN)" >> "$ERR"
|
||||||
t0=$(date +%s)
|
t0=$(date +%s)
|
||||||
if [ "$segments" -le "$IQ_SEGMENTS" ]; then
|
if [ "$segments" -le "$IQ_SEGMENTS" ]; then
|
||||||
# keep IQ for the first segments only; bounded so disk use is known
|
# IQ segment: write samples straight to disk with no decoder in the
|
||||||
timeout $((this + 20)) rtl_sdr -f 868950000 -s "$RATE" -g "$GAIN" \
|
# pipeline. Feeding rtl_wmbus through tee throttled the writer and
|
||||||
-n $((this * RATE)) - 2>>"$ERR" \
|
# only 1.5 % of the samples reached the file. The IQ proof needs
|
||||||
| tee -a "$IQ" \
|
# firmware TX timestamps, not decodes, so the two do not have to be
|
||||||
| rtl_wmbus -f >> "$OUT" 2>/dev/null || true
|
# simultaneous -- and the IQ still contains both our transmissions
|
||||||
iq_seconds=$((iq_seconds + this))
|
# and meter bursts, so relative levels remain measurable.
|
||||||
|
iqlen=$(( this < IQ_SEG ? this : IQ_SEG ))
|
||||||
|
timeout $((iqlen + 20)) rtl_sdr -f 868950000 -s "$RATE" -g "$GAIN" \
|
||||||
|
-n $((iqlen * RATE)) "$IQ.seg" 2>>"$ERR" || true
|
||||||
|
cat "$IQ.seg" >> "$IQ" 2>/dev/null || true
|
||||||
|
rm -f "$IQ.seg"
|
||||||
|
iq_seconds=$((iq_seconds + iqlen))
|
||||||
else
|
else
|
||||||
timeout $((this + 20)) rtl_sdr -f 868950000 -s "$RATE" -g "$GAIN" \
|
timeout $((this + 20)) rtl_sdr -f 868950000 -s "$RATE" -g "$GAIN" \
|
||||||
-n $((this * RATE)) - 2>>"$ERR" \
|
-n $((this * RATE)) - 2>>"$ERR" \
|
||||||
|
|||||||
Reference in New Issue
Block a user