- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试用 python 编写 GNURadio 脚本。我的最终目标是有一个例程,可以定期将 GNUradio 进程内的浮点结果写入串行端口。作为第一步,我想简单地暂停一个简单的例程以下代码通过声卡播放 1kHz 音调:
`#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: simpleTone
# Generated: Wed Jun 29 07:26:02 2016
##################################################
from gnuradio import analog
from gnuradio import audio
from gnuradio import blocks
from gnuradio import gr
import time
class simpleTone(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
##################################################
# Variables
##################################################
self.samp_rate = samp_rate = 32000
##################################################
# Blocks
##################################################
self.blocks_throttle_0 = blocks.throttle(gr.sizeof_float*1, samp_rate)
self.audio_sink_0 = audio.sink(samp_rate, "", True)
self.analog_sig_source_x_0 = analog.sig_source_f(samp_rate, analog.GR_COS_WAVE, 1000, 1, 0)
##################################################
# Connections
##################################################
self.connect((self.analog_sig_source_x_0, 0), (self.blocks_throttle_0, 0))
self.connect((self.blocks_throttle_0, 0), (self.audio_sink_0, 0))
if __name__ == '__main__':
simpleTone().run()`
上面的代码工作正常,除了一些溢出和音频点击之外。但是,如果我进行以下替换:
`
if __name__ == '__main__':
simpleTone().start()
time.sleep(3)
simpleTone().stop()`
结果是文件运行,并在 3 秒后结束,但没有产生任何音频。
我确信我错过了一些相当基本的东西,任何帮助将不胜感激。谢谢。
-编辑
最佳答案
这个问题也在这里提出:
http://lists.gnu.org/archive/html/discuss-gnuradio
并得到答复。如果有人遇到这个问题,我将在这里分享这个答案:
Your problem is that you're constructing three unrelated top blocks: you have three separate occurrences of "simpleTone()". Instead you need to create one and continue to use it, like so:
tb = simpleTone()
tb.start()
...
tb.stop()You have another problem, too, which you will find after fixing the first one. .wait() means to wait for the flowgraph to finish all processing, and your flowgraph has no elements within it to finish such as a Head block, so the .stop() will never be reached.
Instead, you need to proceed like this:
tb = simpleTone()
tb.start()
# the flowgraph is now running independently
time.sleep(3)
tb.stop()
tb.wait()The final .wait() is not actually necessary in this case -- what it does is wait for the flowgraph to finish, which will happen shortly after .stop() is called, but if you later wish to start the same top block again, you must have called .wait() before you call .start(), so always having a matched set of [start, stop, wait] or [start, wait, stop] is good practice.
关于gnuradio - 中断简单的 GNURadio 流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38099471/
我正在尝试用 python 编写 GNURadio 脚本。我的最终目标是有一个例程,可以定期将 GNUradio 进程内的浮点结果写入串行端口。作为第一步,我想简单地暂停一个简单的例程以下代码通过声卡
我正在尝试用 python 编写 GNURadio 脚本。我的最终目标是有一个例程,可以定期将 GNUradio 进程内的浮点结果写入串行端口。作为第一步,我想简单地暂停一个简单的例程以下代码通过声卡
我是 GNUradio 的新手,我正在制作一个 FM 接收器。我正在将数据记录到文件接收器中。但是我只需要1毫秒的数据。我如何指定这个时间,以便我的流程图在这个时间之后自动停止? 我还阅读了一些关于调
这是我的简单流程图。 文件源>节流>文件接收器 当文件源的重复值打开时,它工作正常。当我关闭文件源的重复值时,不会写入任何内容。这可能是什么原因? 最佳答案 block 之间 GNU Radio 调度
我想使用 PyBombs ( https://github.com/gnuradio/pybombs ) 安装特定的 gnuradio 库版本 (3.7.10)。我已完成以下步骤: sudo pip
我正在(生命周期结束的)GNU Radio 3.7 中与 gnuradio-companion 合作,第一次从事一个包含很多 block 的更大项目。工作台上的空间越来越少。 您知道是否可以增加工作台
我有这样一个文件( ~/Pobrane/multi-rtl/swig/multi_rtl_swig.i ): /* -*- c++ -*- */ #define MULTI_RTL_API %incl
大家,我有一个困难。 当我成功安装 GunRadio 时,, 我找不到数百个示例文件 在 /usr/local/share/gnuradio/examples , 在 office wiki 中描述.
USRP2 可以处理的最大带宽是多少? 最佳答案 100MS/s I & Q 下的 USRP2 A/D 样本被缩减为 25MS/s 复杂。我们使用 16 位 I & Q。 这在 USRP2 的千兆以太
我试图理解 GNURadio 中的浮点运算并开始研究他们的测试。测试生成随机浮点输入和随机抽头,然后将所有内容传递给过滤器。稍后它使用一些余量比较预期输出和实际输出。 关于那个有一个神秘的评论marg
编译时出现如下错误: undefined reference to `gr::fft::window::blackman_harris(int, int) 我知道这个链接器错误是由于我的 g++ 命令
我正在尝试了解 gnuradio 源代码块的工作原理。我知道如何制作一个简单的 outputs a constant并且我了解采样率的含义,但我不确定如何(或在何处)将两者结合起来。 源 block
我有一个通用的工作功能,为此我将使用 GNU Radio 的历史记录功能。在 block 的构造函数中,我调用了 set_history( m )。我以标准方式转换输入缓冲区: const flo
我刚刚能够构建和安装自己的信号 block 。我只是想制作一个转发数据的 block ,但在某个定义的长度上添加一个标签。然后,在调制数据后,我开发了一个 block ,可以将标签读回给我。当 blo
我正在尝试在 gnuradio 中创建一个简单的源代码块。我已经使用 gr_modtool 创建了基本的模块和 block ,但是每当我尝试运行测试时,它很快就会耗尽我所有的内存并且我的计算机开始滞后
我正在为同事开发的 GNU Radio 应用程序开发网络前端。 我有一个 TCP 客户端连接到两个 TCP Sink block 的输出,但数据编码与我预期的不同。 一个 TCP Sink 发送复数数
在使用 build-gnuradio 脚本 ( Using the build-gnuradio script ) 成功构建 gnuradio 之后,有没有一种方法可以在不重新开始的情况下更新和构建所
运行 cmake 时出现以下错误并且不确定如何修复它。似乎它确切地告诉我该做什么,但对 Linux 不是很熟悉。 CMake Error at CMakeLists.txt:153 (find_pa
您知道 GNU Radio(GNU Radio Companion 中的文件接收器)在二进制文件中存储样本的格式吗? 我需要在Matlab中读取这些示例,但问题是文件太大而无法在Matlab中读取。
我正在尝试使用 GNU Radio 解扰 block 。我有一个由第三方编写的需要解扰的 block 。使用的多项式为 x17 + x12 + 1。 代码如下 descrambler_cc_impl:
我是一名优秀的程序员,十分优秀!