Commit graph

226 commits

Author SHA1 Message Date
Thomas Kolb a6f12d876b sdr: fixed RX sample data conversion 2024-01-05 13:48:41 +01:00
Thomas Kolb be5fa06950 Handle SIGTERM and SIGINT for graceful shutdown 2024-01-03 22:03:19 +01:00
Thomas Kolb ee63483b8f sdr: scale sample for HackRF API 2024-01-03 17:41:35 +01:00
Thomas Kolb ac087634dd sdr: ensure that all samples were transmitted before TX is stopped
This is done by tracking the time that the transmitter must stay on based on
the number of samples to be transmitted and the sampling rate.
2024-01-03 17:32:51 +01:00
Thomas Kolb 8689ed5b27 Use fsleep instead of nanosleep 2024-01-03 17:29:51 +01:00
Thomas Kolb fb9c26ccd5 make.sh: allow passing parameters to make 2024-01-03 17:29:05 +01:00
Thomas Kolb 5564f1751a Fixed TX gain setting 2024-01-03 17:04:47 +01:00
Thomas Kolb c9d53ed96e Ensure that buffer is full when transmission starts 2024-01-03 00:33:54 +01:00
Thomas Kolb 628659511c sdr: properly flush the transmit buffers 2024-01-03 00:25:55 +01:00
Thomas Kolb 497498acd2 rx: fix overflow in symbol buffer 2024-01-03 00:01:27 +01:00
Thomas Kolb ef0fad4335 Improved handling of up- and downsampling 2024-01-02 23:49:55 +01:00
Thomas Kolb d55e3ab902 sdr: release buffered data; set sampling rate 2024-01-02 23:25:14 +01:00
Thomas Kolb 2b741acd8a Use libhackrf directly (not tested yet) 2024-01-02 22:49:16 +01:00
Thomas Kolb 7995f5bef0 Print RX stats periodically instead of debug logging 2024-01-02 19:04:19 +01:00
Thomas Kolb 112a8a1215 Improved logging and soapy stream handling 2023-05-20 22:01:26 +02:00
Thomas Kolb 2b078a4147 Settings updated: 2 Msps, 10 ms TX backoff 2023-05-20 21:59:40 +02:00
Thomas Kolb a6530da0d0 make.sh: set build type to RelWithDebInfo 2023-05-20 21:58:16 +02:00
Thomas Kolb f5a367464f Optimized one-shot frequency synchronization
- Ramp-up length increased to 128 symbols (here is room for
  improvement!)
- Try to detect the frequency once during ramp-up. To do so, every
  second symbol is inverted (to remove the +/-1 symbol toggling) and the
  phase difference between neigboring resulting symbols is checked. When
  it is low enough for all symbols, the frequency is estimated and
  corrected. When frequency estimation was done, it is not retried for a
  number of incoming symbols in order to allow the timing estimator to
  converge again.
- This approach was verified in a simulated loopback test with frequency
  offset and AWGN.
2023-05-17 22:28:18 +02:00
Thomas Kolb b5bae84994 utils: new and improved plotting scripts 2023-05-17 22:27:40 +02:00
Thomas Kolb a7db93ab9e Added test for frequency estimator 2023-05-17 22:26:46 +02:00
Thomas Kolb e42602633e freq_est: implement L&R-based symbol-independent frequency estimation
The RX chain uses this to acquire an initial estimate of the carrier frequency. The estimate is adjusted on every incoming symbol until a preamble is found.
2023-05-14 15:53:14 +02:00
Thomas Kolb 3b7628882c utils: open output file in binary mode 2023-05-12 13:49:20 +02:00
Thomas Kolb d17b7b3309 RX: added some asserts 2023-05-12 13:48:18 +02:00
Thomas Kolb afb25a69d8 Use dynamic linking for liquid-dsp again 2023-05-12 13:47:05 +02:00
Thomas Kolb 7d5b67a257 Add layer 1 software loopback test 2023-05-12 13:46:02 +02:00
Thomas Kolb c8e0516e80 Implement time-based carrier sensing
In the following events, the modem cannot switch to transmit mode for the
given time:

- after a preamble has been received, for 500 ms
- after a packet has been successfully decoded, for 1 ms
- after receive mode was initially enabled, for 500 ms

Note that the times are that long to work around the RX/TX switching of
the hackrf and can be hopefully reduced to <10 milliseconds in a later
version.
2022-05-07 21:17:53 +02:00
Thomas Kolb 886a78018f RX: write correct sample rate to debug file 2022-05-07 20:13:01 +02:00
Thomas Kolb b2d6c713e1 Briefly start in TX mode to ensure correct RX frequency
Obviously SoapyHackRF does not set the correct RX frequency on startup.
This is a crude but effective workaround.
2022-05-07 20:12:03 +02:00
Thomas Kolb ec99cedaf4 rx: improvements made during on-air testing
- limit frequency adjustment range
- pre-filter the baseband signal to remove out-of-band interference
- reset the frequency acquisition periodically (every 30s) if no preamble is found
2022-04-10 21:58:32 +02:00
Thomas Kolb 2d0bf7eeda sdr: fixed enumeration output 2022-04-08 16:17:17 +02:00
Thomas Kolb 96f10f7fb6 sdr: add gain configuration 2022-04-08 16:17:00 +02:00
Thomas Kolb 715cda83a8 RX: process samples in larger chunks 2022-04-07 21:17:37 +02:00
Thomas Kolb 3e74093fc7 Retry transmitting zeros 2022-04-07 20:58:08 +02:00
Thomas Kolb 31475907d3 Switch to IPv6 2022-04-07 20:44:07 +02:00
Thomas Kolb bfe27d3ead Added script for setting up the tun device 2022-04-07 20:34:21 +02:00
Thomas Kolb 47fc177e87 Reorganize Soapy stream management; flush tx buffer 2022-04-03 18:11:52 +02:00
Thomas Kolb 152d2f02f6 Basic transmitter-only main loop 2022-03-05 21:38:05 +01:00
Thomas Kolb 3bc1d9625f sdr: various fixes; use Kaiser filter for resampling 2022-03-05 21:37:33 +01:00
Thomas Kolb 85663d5304 Added SDR abstraction layer 2022-03-03 22:19:03 +01:00
Thomas Kolb 88145d74ba rx: added function to determine whether rx is busy 2022-03-01 21:51:41 +01:00
Thomas Kolb 45156e64a0 Show packets as hexdump instead of text 2022-02-27 22:01:51 +01:00
Thomas Kolb 9817896914 rx: make receiver more robust 2022-02-27 21:25:33 +01:00
Thomas Kolb 934b18e382 Integrate TUN device interface
Packets are now read from the TUN device and transmitted. The signal
goes through a channel emulator and is then received + decoded. If
decoding is successful, the result is written back to the TUN device
(which does not make much sense, but works for testing).

Unfortunately, there still seems to be a problem in the receiver: packet
loss is very high even at extremely high SNRs.
2022-02-27 20:21:14 +01:00
Thomas Kolb 890baf577f Moved config.h to src/ top level 2022-02-27 18:41:16 +01:00
Thomas Kolb 8a8ddc5ea3 rx: integrate AGC 2022-02-27 16:59:14 +01:00
Thomas Kolb a60b8b1f87 Moved results.h to src/ top level 2022-02-27 16:02:51 +01:00
Thomas Kolb 1787d0d351 layer1: implement per-packet modulation/coding
This allows a higher layer to adjust data rate based on the current
channel conditions. For example, the SNR could be measured and if it
becomes too low for the current modulation/code, a lower-order
modulation or stronger code could be used.
2022-02-17 21:39:18 +01:00
Thomas Kolb 0ed7109335 Clean up debug output 2022-02-16 21:46:56 +01:00
Thomas Kolb 876bafd6f9 Moved receiver to separate module 2022-02-16 20:52:46 +01:00
Thomas Kolb a5634ed736 Move the transmission chain to a separate "tx" module 2022-02-13 21:29:35 +01:00