LoginSignup
0
1

More than 3 years have passed since last update.

pythonでgnuradio

Posted at

概要

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


以上。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1