…
|
||
---|---|---|
.. | ||
README.md | ||
iq_base.c | ||
iq_base.h | ||
iq_client.c | ||
iq_fm.c | ||
iq_server.c | ||
iq_svcl.h | ||
plot_fft.py | ||
scan_fft.c |
README.md
IQ server/client
receive IF stream from baseband IQ via TCP, default PORT=1280 (iq_svcl.h)
Compile
gcc -Ofast -c iq_base.c
gcc -O2 iq_server.c iq_base.o -lm -pthread -o iq_server
gcc -O2 iq_client.c -o iq_client
Usage/Examples
-
T1$ ./iq_server [--port <pn>] <iq_baseband.wav>
T2$ ./iq_client [--ip <ip_adr>] [--port <pn>] --freq <fq>
-
Ex.1
[terminal 1]
T1$ ./iq_server --bo 32 <iq_baseband.wav>
(or$ ./iq_server --bo 32 - <sr> <bs> <iq_baseband.raw>
)
[terminal 2]
T2$ ./iq_client --freq <fq> | ./rs41mod -vx --IQ 0.0 --lp - <if_sr> <bo>
where
-0.5 < fq < 0.5
: (relative) frequency,fq=frequency/sr
<if_sr>
: IF sample rate
<bo>=8,16,32
: output/IF bits per (real) sample (u8, s16 or f32)
down-converts up toMAX_FQ=(4+1) (iq_base.h)
channels/signals. More signals than number of CPUs/cores is not recommended.
(Note: If the baseband sample rate has no appropriate factors (e.g. if prime), the IF sample rate might be high and IF-processing slow.)
One channel can be used for scanning,--fft <fft.txt>
makes FFT (2 seconds average). The FFT is saved in<fft.txt>
as<fq>;<dB>
, approx. 200 Hz per bin.
If no output bps is chosen (--bo [8,16,32]
), the IF bps is equal to the baseband bps. It is recommended to use--bo 32
(i.e. float32) output, then no quantization noise is introduced when converting from internal float32 samples. -
Ex.2
[terminal 1]
T1$ rtl_sdr -f 403.0M -s 1920000 - | ./iq_server --fft fft_server.txt --bo 32 - 1920000 8
[terminal 2]
T2$ ./iq_client --freq -0.3125 | ./m10mod -c -vv --IQ 0.0 - 48000 32
[terminal 3]
T3$ ./iq_client --freq 0.0 | ./rs41mod -vx --IQ 0.0 - 48000 32
[terminal 4]
T4$ ./iq_client -1
(close channel 1)
T4$ ./iq_client --stop
(close all clients and stop server)
The iq_server
--fft
option immediately starts reading the IQ stream (so buffering is reduced).
./iq_client --fft <fft_cl.txt>
can also request FFT.
The IF sample rate if_sr
is at least 48000 such that the baseband sample rate sr
is a multiple of if_sr
.