KerberosSDR code notes (2) code structure

Visit the following webpage, which is the main program of kerberossdr.

https://github.com/rtlsdrblog/kerberossdr

There are several folders under the root directory. The codes we focus on are under _GUI, _signalProcessing, and _receiver. Their respective functions are the python interface code, various processing algorithms, and the interaction with the receiver hardware. In addition, _webDisplay and static are both used for web pages, which are the dynamic part and the static part respectively. _views is the previous page and also the web page. Finally, there is a folder _dataFiles, where the python program can generate simulation data, which is used to debug the program without the kerberossdr hardware.

There are also several files in the root directory, run.sh for running, setup_init.sh for installation, as mentioned in the last two articles, sim.sh is running simulation mode, it will not call RTL hardware, but use The data generated by oneself can debug other parts of the program. kill.sh is to exit the program.

Click the _GUI folder, there are several files, Main_hydra_dev.ui should be the interface design file dragged out by hand, convert.sh can automatically generate hydra_mainwindow_layout.py, what we need to care about is only the hydra_main_window.py file, which is responsible When interacting with the interface, every displayed waveform or button clicked is interacting with this file. There are two python programs in the _dataFiles folder, which can generate two types of test data respectively. What sim_gen.py generates is relatively simple random data, but it includes sampling time delay and phase difference. The data generated by DOA_sim_gen.py can be used to test the DOA algorithm. There is only one python file in _signalProcessing, which can realize delay calculation, phase difference calculation, DOA calculation and passive radar calculation. There is a C folder under the _receiver folder, and another hydra_receiver.py. The programs in the C folder are relatively low-level and involve direct hardware interaction. hydra_receiver.py implements an object-oriented receiver, which can be called by algorithms, it can control the underlying C program, and it can do some data preprocessing, including filtering, dc offset removal, phase difference correction and other functions.

There are more c programs in _receiver/C. rtl_daq.c is the most directly interacting with rtlsdr. It calls rtlsdr's api, and then transmits data to python code through stdout. Rtl_rec.h implements a structure that encapsulates the rtlsdr hardware. Each of the 4 receivers can have different Gain and center frequency, sampling rate, buffer, etc., its function is to pack these variables in a structure, so that it is convenient to distinguish. rtl_daq.c uses this structure to interact with the rtlsdr hardware api. Sync.c and sync.h use the results of the delay calculation to delay the iq data received in stdin and output to stdout. gate.c is equivalent to a gate, which reads data from stdin and selectively outputs it to stdout. The function of sim.c is that when there is no actual hardware, it can replace rtl_daq.c to simulate and provide the simulated iq data to the python code.

Guess you like

Origin blog.csdn.net/shukebeta008/article/details/104031377