{"id":13577260,"url":"https://github.com/orhun/rtl_map","last_synced_at":"2025-10-09T02:22:18.843Z","repository":{"id":51294166,"uuid":"166885047","full_name":"orhun/rtl_map","owner":"orhun","description":"FFT-based visualizer for RTL-SDR devices. (RTL2832/DVB-T)","archived":false,"fork":false,"pushed_at":"2023-01-01T16:22:35.000Z","size":82,"stargazers_count":80,"open_issues_count":3,"forks_count":13,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-16T00:07:33.335Z","etag":null,"topics":["fft","r820t","radio","rtl-sdr","rtl2832u","sdr","visualizer"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orhun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"orhun","patreon":"orhunp"}},"created_at":"2019-01-21T21:44:27.000Z","updated_at":"2024-11-08T20:30:12.000Z","dependencies_parsed_at":"2023-01-31T23:46:52.260Z","dependency_job_id":null,"html_url":"https://github.com/orhun/rtl_map","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Frtl_map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Frtl_map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Frtl_map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Frtl_map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orhun","download_url":"https://codeload.github.com/orhun/rtl_map/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173084,"owners_count":21224483,"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":["fft","r820t","radio","rtl-sdr","rtl2832u","sdr","visualizer"],"created_at":"2024-08-01T15:01:19.870Z","updated_at":"2025-10-09T02:22:13.817Z","avatar_url":"https://github.com/orhun.png","language":"C","readme":"# rtl_map \u003ca href=\"https://github.com/orhun/rtl_map/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/orhun/rtl_map.svg\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/orhun/rtl_map/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/orhun/rtl_map.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/orhun/rtl_map/pulls\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-pr/orhun/rtl_map.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/orhun/rtl_map/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/orhun/rtl_map.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/orhun/rtl_map/network\"\u003e\u003cimg src=\"https://img.shields.io/github/forks/orhun/rtl_map.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/orhun/rtl_map/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/orhun/rtl_map.svg\"/\u003e\u003c/a\u003e\n\n### FFT-based visualizer for RTL-SDR devices. (RTL2832/DVB-T)\n\n![820t2](https://user-images.githubusercontent.com/24392180/51805531-935c4700-227f-11e9-8249-44b849b8e757.jpg)\n\nDVB-T dongles based on the `Realtek RTL2832U` can be used as a cheap SDR (_Software-defined radio_), since the chip allows transferring the raw I/Q (_In-phase / Quadrature_) samples to the host, which is officially used for DAB/DAB+/FM demodulation. \n([More about history \u0026 discovery of rtl-sdr](http://rtlsdr.org/#history_and_discovery_of_rtlsdr))\n\nThere is various software for DSP (_Digital signal processing_), spectral analysis and signal intelligence using RTL-SDR such as [SDR#](https://airspy.com/download/), [gqrx](http://gqrx.dk/) and [gnuradio](https://www.gnuradio.org/). \nApart from these, there is [librtlsdr](https://github.com/steve-m/librtlsdr) which most of the user-level packages rely because of the reason that librtlsdr comes as a part of the rtl-sdr codebase. \nThis codebase contains both the library itself and also a number of command line tools such as rtl_test, rtl_sdr, rtl_tcp, and rtl_fm for testing RTL2832 and performing basic data transfer functions.\nTherefore, librtlsdr is one of the major tools in RTL-SDR community.\n\nMost of the technically questions RTL-SDR enthusiasts ask is about reading samples from device and processing raw I/Q samples. I wanted to answer that kind of questions and demonstrate a implementation of this with `rtl_map project` which is built on top of librtlsdr. Also, I went a step further and added graph feature that creates amplitude (dB) - frequency (MHz) graph using [gnuplot](http://www.gnuplot.info/) and [FFT](https://en.wikipedia.org/wiki/Fast_Fourier_transform) (_Fast Fourier transform_) algorithm. ([fftw](http://www.fftw.org/) used for this approach) I can list other useful open-source projects as [#1](https://gist.github.com/creaktive/7eeaeb76de26ca39dc3f), [#2](https://github.com/xofc/rtl_fftmax) and [#3](https://github.com/roger-/pyrtlsdr). \n\nAnother purpose of this project is making a testing tool \u0026 frequency scanner application for security researches.\n\n[https://www.rtl-sdr.com/rtl_map-a-simple-fft-visualizer-for-rtl-sdr/](https://www.rtl-sdr.com/rtl_map-a-simple-fft-visualizer-for-rtl-sdr/)\n\n## Installation\n\n### Dependencies\n* libusb1.0 (development packages must be installed manually, see [libusb.info](https://libusb.info/))\n* gnuplot (must be installed manually, see [installation page](http://gausssum.sourceforge.net/DocBook/ch01s03.html))\n* librtlsdr (cmake / automatic installation \u0026 linking)\n* fftw3 (cmake / automatic installation \u0026 linking)\n\n### Clone Repository\n\n```\ngit clone https://github.com/orhun/rtl_map\n```\n\n### Building with CMake (recommended)\n\n```\ncd rtl_map\nmkdir build\ncd build\ncmake ../\nmake\nsudo make install\nsudo ldconfig\n```\n### Building with GCC\n\n```\ngcc rtl_map.c -o rtl_map -lrtlsdr -lfftw3 -lm\n```\n\n## Usage\n### Command Line Arguments\n```\n-d, set device index (default: 0)\n-s, set sample rate (default: 2048000 Hz)\n-f, center frequency (Hz) [mandatory argument]\n-g gain (0 for auto) (default: ~1-3)\n-n number of reads (default: int_max.)\n-r, refresh rate for continuous read (default: 500ms)\n-D, don't show gnuplot graph (default: show)\n-C, continuously read samples (default: off)\n-M, show magnitude graph (default graph: dB)\n-O, disable offset tuning (default: on)\n-T, turn off terminal log colors (default: on)\n-h, show help message and exit\nfilename (a '-' dumps samples to stdout)\n```\n\n### Example: Print samples to file\n\n```\n[k3@arch ~]$ rtl_map -f 88000000 -D capture.dat\n[01:00:26] INFO Starting rtl_map ~\n[01:00:26] INFO Found 1 device(s):\n[01:00:26] INFO #0: Generic RTL2832U OEM\nFound Rafael Micro R820T tuner\n[01:00:27] INFO Using device: #0\n[01:00:27] INFO Gain set to 14.\nSupported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 \n128.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 \n[01:00:27] INFO Center frequency set to 88000000 Hz.\n[01:00:27] INFO Sampling at 2048000 S/s\n[01:00:27] INFO Reading samples...\n[01:00:27] INFO Done, exiting...\n```\n\n### Example: Print samples to stdout\n\n```\nrtl_map -f 88000000 -D -\n```\n\n![print samples to stdout](https://user-images.githubusercontent.com/24392180/51807038-b0e6dc00-2292-11e9-9978-e2ddf5852e7d.gif)\n\n### Example: Print 10x512 samples to stdout\n\n```\nrtl_map -f 88000000 -D -C -n 10 -\n```\n\n### Example: Create FFT graph from samples\n```\n[k3@arch ~]$ rtl_map -f 88000000\n[01:00:28] INFO Starting rtl_map ~\n[01:00:28] INFO Found 1 device(s):\n[01:00:28] INFO #0: Generic RTL2832U OEM\nFound Rafael Micro R820T tuner\n[01:00:28] INFO Using device: #0\n[01:00:28] INFO Gain set to 14.\nSupported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 \n28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 \n[01:00:29] INFO Center frequency set to 88000000 Hz.\n[01:00:29] INFO Sampling at 2048000 S/s\n[01:00:29] INFO Creating FFT graph from samples using gnuplot...\n[01:00:29] INFO Done, exiting...\n```\n![fft graph](https://user-images.githubusercontent.com/24392180/52183411-c3c05a00-2818-11e9-8883-cdddd2c7376e.jpg)\n\n\n### Example: Continuously read samples and create FFT graph\n\n```\nrtl_map -f 88000000 -C -r 100\n```\n\n![continuously read](https://user-images.githubusercontent.com/24392180/52239109-bbcaed80-28de-11e9-921e-7c438f42a4c9.gif)\n\n\n## DC Offset \u0026 I/Q Imbalance\n\nThere is a common issue with cheap RTL-SDR receivers which is `center frequency spike` or `central peak` problem related to I/Q imbalance. This problem can be solved with a implementation of some algorithms. (For more details: [#1](https://github.com/roger-/pyrtlsdr/issues/94), [#2](https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms1-ebz/iq_correction))\n\n## TODO(s)\n1. Implement I/Q correction\n2. Find the maximum value of samples, show it on graph with a different color.  Might be useful for frequency scanner.\n3. Frequency scanner feature\n4. Check correctness of min/max point calculation.\n5. Check correctness of amplitude (dB) calculation.\n* 820T2 tuner used for testing. Other RTL-SDR devices must be tested.\n\n## Contribution\n\nYou can contribute to this project if you are a RTL-SDR enthusiast or researcher. Fork the repository and start coding.\nI hope some people on this planet will consider my TODO(s) and help me build the frequency scanner tool :)\n\n## License\n\nGNU General Public License ([v3](https://www.gnu.org/licenses/gpl.txt))\n\n## Copyright\n\nCopyright (c) 2019-2023, [orhun](https://www.github.com/orhun)\n","funding_links":["https://github.com/sponsors/orhun","https://patreon.com/orhunp"],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhun%2Frtl_map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forhun%2Frtl_map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhun%2Frtl_map/lists"}