概要
pythonでgnuradioやってみた。
1khzのサイン波を聞く。
環境
windows 7 64bit
GNU Radio Companion 3.7.10.1
Python 2.7.10
サンプルコード
from gnuradio import analog, audio, blocks, gr
class my_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self, "top0")
self.samp_rate = samp_rate = 32000
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)
self.connect((self.analog_sig_source_x_0, 0), (self.audio_sink_0, 0))
if __name__ == '__main__':
try:
my_block().run()
except KeyboardInterrupt:
pass
以上。