{"id":13586717,"url":"https://github.com/space-physics/piradar","last_synced_at":"2025-04-07T18:34:36.304Z","repository":{"id":80566369,"uuid":"55513689","full_name":"space-physics/piradar","owner":"space-physics","description":"Radar using Red Pitaya for RF: using Raspberry Pi 3 for quad-core radar signal processing","archived":true,"fork":false,"pushed_at":"2021-05-26T03:44:28.000Z","size":3296,"stargazers_count":68,"open_issues_count":0,"forks_count":14,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-05-02T03:09:47.849Z","etag":null,"topics":["geoscience","ionosphere","radar","raspberry-pi","red-pitaya","remote-sensing","space-physics"],"latest_commit_sha":null,"homepage":"https://www.scivision.dev/pi-radar","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/space-physics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-04-05T14:13:46.000Z","updated_at":"2024-01-24T17:31:33.000Z","dependencies_parsed_at":"2023-09-24T16:57:22.449Z","dependency_job_id":null,"html_url":"https://github.com/space-physics/piradar","commit_stats":{"total_commits":233,"total_committers":2,"mean_commits":116.5,"dds":0.008583690987124415,"last_synced_commit":"4ac239ec7afdc45fa1af16e6ce74b57eaabeb7cd"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-physics%2Fpiradar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-physics%2Fpiradar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-physics%2Fpiradar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-physics%2Fpiradar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/space-physics","download_url":"https://codeload.github.com/space-physics/piradar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247707770,"owners_count":20982847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geoscience","ionosphere","radar","raspberry-pi","red-pitaya","remote-sensing","space-physics"],"created_at":"2024-08-01T15:05:45.727Z","updated_at":"2025-04-07T18:34:35.537Z","avatar_url":"https://github.com/space-physics.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![image](https://travis-ci.org/scivision/piradar.svg?branch=master)](https://travis-ci.org/scivision/piradar)\n[![image](https://coveralls.io/repos/github/scivision/piradar/badge.svg?branch=master)](https://coveralls.io/github/scivision/piradar?branch=master)\n\n# PiRadar\n\n[Project Wiki](https://github.com/scivision/piradar/wiki)\n\n[Executive summary](https://www.scivision.dev/pi-radar/)\n\nRadar using Red Pitaya for RF and Raspberry Pi 3 / 4 for quad-core signal\nprocessing. Initially used for ionospheric imaging at HF but via\nfrequency translation could be used at microwave and other frequencies.\nAlso can be used at [low-band VHF for short-range compact radar\nwork](https://www.scivision.dev/narrowband-lowband-vhf-software-defined-radar-simulation/).\n\n::: {.contents}\n:::\n\nSetup Red Pitaya Radar software\n-------------------------------\n\nTo connect over Ethernet from GNU Radio to the Red Pitaya, setup an\nimage on the Red Pitaya\\'s micro SD card and setup GNU Radio on your\nLinux laptop.\n\n### Install Red Pitaya GNU Radio image\n\nThis assumes a brand new Red Pitaya with blank micro SD card.\n\n1.  format a micro SD card to FAT32\n2.  unzip [Pavel Demins SD Card GNU Radio\n    image](https://pavel-demin.github.io/red-pitaya-notes/sdr-transceiver/)\n    (Under \\\"getting started with GNU Radio\\\") to this SD card:\n\n        unzip ecosystem-0.95-1-6deb253-sdr-transceiver.zip -d /media/sd-card\n\n    where `/media/sd-card` is the mounted SD card path to the\n    FAT32-formatted SD card on your laptop. You can find this path with\n    the command `df`.\n\n3.  boot the Red Pitaya with this micro SD card. login/password `root`\n\n### Install GNU Radio Red Pitaya tools\n\nOn your laptop:\n\n    mkdir ~/code\n\n    cd ~/code\n\n    git clone https://github.com/pavel-demin/red-pitaya-notes\n\nOn your laptop, create an executable file `~/rpgr` with contents:\n\n    #!/bin/bash\n    export GRC_BLOCKS_PATH=$HOME/code/red-pitaya-notes/projects/sdr_transceiver/gnuradio\n    gnuradio-companion\n\nThen in the future to startup GNU Radio with the modules for the Red\nPitaya, just type on your laptop:\n\n    ~/rpgr\n\nCW Radar using Red Pitaya\n-------------------------\n\n* `CW_Doppler.py` models beat frequency vs. radar frequency\nand target radial velocity.\n* `CW_red-pitaya.grc` demos a [CW radar using Red Pitaya](https://www.scivision.dev/cw-radar-red-pitaya).\n\n![Red Pitaya CW Radar GNU Radio](doc/CW_red-pitaya.png)\n\nRadar beat frequency finding\n----------------------------\n\nBeat frequency estimation demonstration:\n\n    python CWsubspace.py\n\n    python CWsubspace.py\n\nFMCW Radar using Red Pitaya\n---------------------------\n\nThe program `FMCW_sim.grc` is a simulation of FMCW radar, as simple as\npossible. It leaves the receive signal glitches inherent to the\nresetting of the sawtooth and triangle waveforms. These would be\neliminated by dropping those samples in post-processing as an easy\nsolution.\n\nThe program `FMCW_red-pitaya.grc` operates at low-band VHF in the\n[license-free bands available globally](https://www.scivision.dev/license-free-global-25-60-mhz/).\n\nDSSS Transmit waveform generation\n---------------------------------\n\nYou can just generate the DSSS waveforms in memory or to disk on your\nPC. You don\\'t actually need the Red Pitaya to work with these offline,\nto test your algorithms in the computer alone.\n\nTo run the Red Pitaya radar with DSSS on the bench, you need to\n\n1.  generate a binary file containing a psuedorandom phase modulated\n    signal with `create_waveform`\n2.  use GNU Radio to read that file and transmit it\n3.  either on the same or separate Red Pitaya, receive the transmitted\n    waveform and save it to file\n4.  use a Python (or whatever) script to process the transmit and\n    receive waveforms together e.g. cross-correlation, estimate number\n    of lags to peak.\n\nTo transmit these waveforms with the Red Pitaya, tell GNU Radio to read\nthe waveform file you generated and transmit it with the appropriate\nblock diagram.\n\n### Generate phase modulation in RAM and plot spectrum\n\nif no options specified, it plots only:\n\n    python create_waveform.py\n\n-o directory saves binary psuedorandom phase modulated signal to\n*directory* for use with GNU Radio -q quiet, no plotting \\--filter\nsmoothes transmit waveform, reducing splatter \\--fs fsampleHz sample\nfrequency in Hz of baseband waveform\n\nThe following option is for Raspberry Pi only; no longer used\n\n-f frequencyMHz center frequency in MHz to transmit from Raspberry Pi\nGPIO\n\n### Simulate Psuedorandom PM transceiver\n\nThis is to get started with GRC, to see how it reads/writes files\ngenerated in an offline program such as `create_waveform.py`:\n\n    ~/rpgr PM_sim.grc\n\nvariable `dist_m` is adjusted to make a simulated point target.\n\nThe output is processed with `receive.py`, which should match the\ndistance specified in `dist_m` in `PM_sim.grc`.\n\nNOTE: there may be a bug with GRC Delay Block in GNU Radio 3.7.9; it\nseems to truncate the file causing a 120 km bias. We can just workaround\nthis for now, because maybe it was fixed in GNU Radio 3.7.10.\n\n### Actual psuedorandom PM with Red Pitaya\n\nNow we put the psuedorandom PM on the hardware transmitter/receiver with\nthe Red Pitaya DAC and ADC respectively:\n\n    ~/rpgr PM_red-pitaya.grc\n\nReference\n---------\n\nThis info is for Red Pitaya, but not necessarily what will be used for\nPiRadar. Just informational.\n\n### Simulate BPSK transceiver\n\nNote, this is not the CDMA waveform, just for testing/understanding how\nto send/receive phase modulated signals:\n\n    ~/rpgr PSK_sim.grc\n\n### Actual BPSK transceiver with Red Pitaya\n\nThis saves the received packets to a file. They should match the\ntransmitted packets. Again, this is not the actual on-air format we\\'ll\nuse:\n\n    ~/rpgr PSK_red-pitaya.grc\n\n### GNU Radio\n\nThe `.grc` are for GNU Radio Companion (GRC), the graphical IDE.\nCurrently we are using GRC 3.7.9 on Ubuntu 16.04 for bench development.\nOf course, GNU Radio also runs on\n\n-   [Mac](http://gnuradio.org/redmine/projects/gnuradio/wiki/MacInstall)\n-   [Windows](http://gnuradio.org/redmine/projects/gnuradio/wiki/windowsinstall)\n-   [Windows Subsystem for\n    Linux](https://www.scivision.dev/gnu-radio-companion-windows-subsystem-for-linux/).\n\nOf course, the actual fielded system will be on the Red Pitaya without\nthe GUI.\n\n-   \\\"signal source\\\" is simulating a DDS\n-   \\\"multiply\\\" is simulating DUC (with the DDS).\n-   \\\"rational resampler\\\" controls how fast the bits are played back\n    and hence the instantaneous bandwidth of the signal.\n-   \\\"multiply const\\\" controls the transmitter power. It would need to\n    be like 0.01 or less to avoid overloading the Red Pitaya input if\n    connecting output to input.\n\n**NOTE**: you must have a [softlink to red\\_pitaya.py in your project\ndirectory](https://www.scivision.dev/red-pitaya-gnuradio-setup/) where\nthe `.grc` files are, or you will get\n\n\u003e ImportError: module red\\_pitaya not found.\n\n#### How GRC blocks work\n\nThese paths are for GNU radio 3.7.9 on Ubuntu 16.04.\n\n1.  Graphical block based on .xml in `/usr/share/gnuradio/grc/blocks`\n2.  Corresponding Python code in\n    `/usr/lib/python2.7/dist-packages/gnuradio`\n3.  Python code calls C++ code under `/usr/include/gnuradio` compiled\n    with SWIG\n\nWhen using GNU Radio without GRC from Python, you are using \\#2 and \\#3.\n\nTesting code\n------------\n\nTransponder (acts as a frequency-translating, amplifying target back to\nthe radar source) [xpond\\_red-pitaya.grc]{.title-ref}\n\nReference (obsolete)\n--------------------\n\nThe material in this section is for using Raspberry Pi as the\ntransmitter, which we no longer use.\n\n-   Raspberry Pi module has been added to\n    \u003chttps://github.com/jvierine/digital_rf\u003e\n-   can use \u003chttps://github.com/jvierine/gr-drf\u003e\n\n### Raspberry Pi Transmit Install\n\nWe use the Red Pitaya to transmit instead. The program below uses Rpi\nGPIO to transmit waveforms, but we found the jitter way too high to use\nfor radar.\n\nOn your Raspberry Pi (it will ask for sudo password):\n\n    ./setup_raspberrypi.sh\n\n    python install -e .\n\nOr on your PC:\n\n    python install -e .\n\n### Raspi transmit PM\n\ncentered @ 100.1MHz:\n\n    ./create_waveform.py -f 100.1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspace-physics%2Fpiradar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspace-physics%2Fpiradar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspace-physics%2Fpiradar/lists"}