0
0

pythonでgnuradio その15

Posted at

概要

pythonでgnuradioやってみた。
練習問題やってみた。

練習問題

sin波を再生せよ。

サンプルコード

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 = 48000
		self.audio_sink_0 = audio.sink(samp_rate, '', True)
		self.wavfile_source_0 = blocks.wavfile_source("a1.wav", True)
		self.connect((self.wavfile_source_0, 0), (self.audio_sink_0, 0))

if __name__ == '__main__':
	try:
		my_block().run()
	except KeyboardInterrupt:
		pass




以上。

0
0
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
0