gnuradio各文件之间的关系:
C++算法模块 --> .xml文件 --> .grc --> 流图 --> .py
grc的.xml文件路径:/usr/local/share/gnuradio/grc/block
参考示波器、频谱仪、ais模块的.xml文件完成了AIS的信息显示模块。
教学平台的.xml文件路径:KZ-SDR-IDE1.4.1/sdk/grc/自定义/组件。
使用eigen库来进行矩阵处理。
gnuradio流图模板文件
文件名:flow_graph.tmpl
路径:gnuradio-3.7.11/grc/core/generator
CMakeLists.txt
记得在CMakeLists.txt的Complier specific setup部分添加:
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
add_definitions(-fvisibility=hidden)
add_definitions(-std=c++11)
endif()
使用GNURadio编写模块的方法
- Create (do this once per module):
gr_modtool create MODULENAME
- Add a block to the module:
gr_modtool add BLOCKNAME
- Create a build directory:
mkdir build/
- Invoke the make process:
cd build && cmake <OPTIONS> ../ && make
(Note that you only have to call cmake if you’ve changed the CMake files) cmake … - Invoke the testing:
make test
orctest
orctest -V
for more verbosity - Install (only when everything works and no tests fail):
sudo make install
. Remember to callgr_modtool makexml BLOCKNAME
orgr_modtool makeyaml BLOCKNAME
, to generate and if needed modify yaml file for your blocks before installing the module. - Ubuntu users: reload the libs:
sudo ldconfig
- Delete blocks from the source tree:
gr_modtool rm REGEX
- Disable blocks by removing them from the CMake files:
gr_modtool disable REGEX