Compare commits

..

37 commits
master ... qsd

Author SHA1 Message Date
06695041ba Fix sin/cos 2024-08-14 00:30:02 +02:00
c9da22afec Convert to QSD 2024-08-05 00:44:18 +02:00
1fe4633601 Fix gain, DC offset 2024-08-03 14:58:10 +02:00
347582cfc1 Optimize decimation performance 2024-08-03 09:54:21 +02:00
49cf85006d Implement full-blown NCO using DMA sniffer 2024-08-03 02:36:35 +02:00
f866c97fcb Swap SM constant names 2024-08-03 00:10:12 +02:00
82c1c12195 Save memory on RX, use it for LO 2024-08-03 00:08:39 +02:00
5868a1ade9 Fix PIO code origins handling 2024-08-03 00:01:22 +02:00
3410740b4a Avoid losing sampling timer on reset 2024-08-02 23:16:00 +02:00
6b444587b6 Remember frequency correctly 2024-07-31 23:49:15 +02:00
7382677af8 Fix initial frequency 2024-07-31 23:12:36 +02:00
71543c70da Increase decimation, remove filter 2024-07-31 22:54:59 +02:00
2068d3a01f Improve bit counting 2024-07-31 20:53:05 +02:00
0db366b602 Track vendor/pico-stdio-usb-simple 2024-07-30 21:01:09 +02:00
f5fb02c190 Avoid sleeps to prevent low-frequency artifacts
Replace them with busy looks that do not lower the current draw.
It still prevent memory saturation as the loops do not touch memory.
2024-07-27 15:43:32 +02:00
24d6acdb53 Improve LO synthesis precision to 17.9 Hz 2024-07-27 15:43:28 +02:00
f7d2dd3629 Limit LO drive for less spurs 2024-07-26 21:37:15 +02:00
f294b09c98 Refactor sample processing 2024-07-23 21:51:48 +02:00
178ba7bee0 Clear DMA chaining before abort 2024-07-23 20:30:54 +02:00
63ca3c6439 Improve the FIR filter a bit 2024-07-23 20:29:52 +02:00
884d84bbf9 Fix gain 2024-07-23 20:15:43 +02:00
5a9a0f7acc Move gain application to limit clipping 2024-07-22 20:39:40 +02:00
b52f772845 Increase queue length to avoid dropping 2024-07-22 20:37:13 +02:00
8974b812f2 Prevent too tight loop on the 1st core 2024-07-22 20:37:13 +02:00
3054904768 Lower the FB resistor value 2024-07-22 20:37:13 +02:00
821cd9189d Move feedback pin farther to prevent crosstalk
Now this was just silly of me.
2024-07-22 20:37:13 +02:00
9997b63c7e Update README 2024-07-22 20:37:13 +02:00
518d6f55db Fix gain 2024-07-22 20:37:13 +02:00
4e6a29abbc Replace BPF with LPF after I/Q conversion 2024-07-18 12:15:43 +02:00
09b4c2c169 Use a more stable bias 2024-07-17 22:20:45 +02:00
34a4df9b1a Use slightly harder bias to avoid clipping 2024-07-17 20:29:35 +02:00
dd66571945 Sample at full speed 2024-07-17 20:25:50 +02:00
bc96b5a9ee Implement a fast band-pass filter for better SNR 2024-07-17 20:04:45 +02:00
0e1fc91279 Remove LO dithering for better SNR 2024-07-17 18:58:28 +02:00
eaad670abb Adjust FB slew rate for better SNR 2024-07-17 11:43:30 +02:00
574c474c6e Reduce jitter and use HPF to improve SNR 2024-07-16 19:24:16 +02:00
38b7ec34f6 Experiment with a superhet approach 2024-07-16 11:03:22 +02:00
7 changed files with 618 additions and 316 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/build/ /build/
/grc/*.py /grc/*.py
/src/.clangd

View file

@ -2,11 +2,9 @@
Using RP2040 / Raspberry Pi Pico as a software-defined radio receiver. Using RP2040 / Raspberry Pi Pico as a software-defined radio receiver.
See the [blog post](https://blog.porucha.net/2024/pico-sdr/) for more information. Older code the article is mostly referring to can be found in the branch `old`. See the [blog post](https://blog.porucha.net/2024/pico-sdr/) for more information. Older code the article is mostly referring to can be found in the branch `old` and a more up-to-date approach in the branch `master`.
## Circuit This branch contains code to use RP2040 with a 1:4 multiplexer and some passives as a quadrature sampling decoder receiver. It is still very much work in progress.
![](circuit.svg)
## Software ## Software
@ -32,4 +30,4 @@ See the [blog post](https://blog.porucha.net/2024/pico-sdr/) for more informatio
4. Open `grc/PicoSDR-WBFM.grc` in GNU Radio Companion, adjust carrier frequency to match your favorite FM radio station and press `F6`. 4. Open `grc/PicoSDR-WBFM.grc` in GNU Radio Companion, adjust carrier frequency to match your favorite FM radio station and press `F6`.
5. Alternatively [gqrx](https://www.gqrx.dk/) works fine with `rtl_tcp` input mode. Maximum sample rate seem to be 400 ksps, above that the samples are dropped. Make sure to adjust LNA gain to +30 dB. It's not accurate, but it does control bias strength which in turn does affect analog gain. 5. Alternatively [gqrx](https://www.gqrx.dk/) works fine with `rtl_tcp` input mode. Maximum sample rate seem to be 400 ksps, above that the samples are dropped. Make sure to experiment with LNA gain. It might be digital, but it's supposed to be somewhere north of 12 dB.

View file

@ -49,7 +49,7 @@ blocks:
id: variable id: variable
parameters: parameters:
comment: '' comment: ''
value: '192_000' value: '200_000'
states: states:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
@ -374,7 +374,7 @@ blocks:
freq7: 100e6 freq7: 100e6
freq8: 100e6 freq8: 100e6
freq9: 100e6 freq9: 100e6
gain0: '0' gain0: '6'
gain1: '10' gain1: '10'
gain10: '10' gain10: '10'
gain11: '10' gain11: '10'

View file

@ -401,7 +401,7 @@ blocks:
freq7: 100e6 freq7: 100e6
freq8: 100e6 freq8: 100e6
freq9: 100e6 freq9: 100e6
gain0: '0' gain0: '30'
gain1: '10' gain1: '10'
gain10: '10' gain10: '10'
gain11: '10' gain11: '10'

File diff suppressed because it is too large Load diff

50
tools/clangd.py Normal file
View file

@ -0,0 +1,50 @@
#!/usr/bin/env python
import os.path
import sys
from glob import glob
import click
import yaml
@click.command()
def clangd():
"""Generate .clangd file for local development."""
assert "PICO_SDK_PATH" in os.environ, "PICO_SDK_PATH not set"
pico_sdk_path = os.path.realpath(os.environ["PICO_SDK_PATH"])
cwd = os.path.realpath(os.getcwd())
includes = [
*glob(f"{pico_sdk_path}/src/common/*/include"),
*glob(f"{pico_sdk_path}/src/rp2040/*/include"),
*glob(f"{pico_sdk_path}/src/rp2_common/*/include"),
f"{pico_sdk_path}/lib/tinyusb/src",
*glob(f"{cwd}/src/**/include", recursive=True),
f"{cwd}/build/generated/pico_base",
f"{cwd}/build/sdk",
]
flags = [
"-Wall",
"-Wextra",
"-xc",
"-DCFG_TUSB_MCU=OPT_MCU_RP2040",
"-I/usr/arm-none-eabi/include",
]
yaml.safe_dump(
{
"CompileFlags": {
"Compiler": "arm-none-eabi-gcc",
"Add": [*flags, *[f"-I{inc}" for inc in includes]],
}
},
sys.stdout,
)
if __name__ == "__main__":
clangd()

View file

@ -62,6 +62,10 @@ def bridge(frequency, device):
print("Begin") print("Begin")
header = fp.read(12)
if header:
peer.send(header)
try: try:
cmd = b"" cmd = b""