通过网络更新GNU Radio中的变量 [英] update a variable in GNU Radio over the network

查看:398
本文介绍了通过网络更新GNU Radio中的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用GNU Radio通过UDP接收器流式传输RF数据.数据流式传输到控制程序.作为此过程的一部分,我将进行频移(带乘法块),滤波和下采样.<​​/p>

我想在运行时更改频移的值.

我是否可以将UDP源中的值直接保存到变量中?我现在能想到的唯一解决方案是永远产生一个正弦波,然后将其通过管道传输到GNU Radio,然后将其与之相乘.但这似乎是对资源的巨大浪费.我希望能够发送一个数据包,将该值"latch"存入GNU Radio变量,然后在我的块中使用该变量.

解决方案

有多种解决方法:

  1. 如果您要坚持使用GNU Radio Companion变量"概念,则可以使用XMLRPC块.用法非常简单明了,GNU Radio GRC示例(通常在/usr/share/gnuradio/examples/grc下找到.)
  2. 如果您想自己编写一些代码,则可以编写一个python hier块,它实际上仅包含一个信号源,但还具有一个消息端口,其消息端口处理程序可修改信号源的频率.这样,您还可以使用ZeroMQ块,它们非常棒:)
  3. 假设,您当然也可以从2开始实现hier块.但是,与其给它提供消息端口和消息处理程序,不如让它对来自外部的网络消息做出异步反应,以更改信号的设置.来源.需要说明的是python多线程有点棘手,您基本上将重新实现从1开始的XMLRPC块.

I am using GNU Radio to stream RF data out using a UDP sink. The data is streamed to a controlling program. As part of this process I am frequency shifting (with a multiply block), filtering and down sampling.

I would like to change the values of frequency shift at run time.

Is there a way for me to have values from a UDP source saved directly to a variable? The only solution I can think of now is to forever generate a sine wave and then pipe that into GNU Radio, and then multiply my signal with that. But that seems like a huge waste of resources. I would like to be able to send a single packet, have that value "latch" into a GNU Radio variable, and then use that variable in my blocks.

解决方案

There's multiple approaches for that:

  1. If you want to stick with the GNU Radio Companion "variable" concept, you can use the XMLRPC blocks. Usage is pretty straightforward, and the GNU Radio GRC example (often found under /usr/share/gnuradio/examples/grc cover that.
  2. If you want to write a little code for yourself, you could write a python hier block that really just contains a signal source, but also has a message port, with a message port handler that modifies the frequency of the signal source. That way, you could also the ZeroMQ blocks, which are pretty awesome :)
  3. Hypothetically, you could of course also implement the hier block from 2., but instead of giving it a message port and a message handler, make it asynchronously react to network messages coming from the outside, to change the settings of the signal source. Caveat here is that python multithreading is a bit tricky, and you'd be basically re-implementing the XMLRPC blocks from 1.

这篇关于通过网络更新GNU Radio中的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆