0
0

pythonでgnuradio その11

Last updated at Posted at 2024-08-14

概要

pythonでgnuradioやってみた。
windows10,windows11に開発環境構築してみた。

環境

windows10
windows11

手順

  • radioconda-2024.05.29-Windows-x86_64.exeをダウンロード

  • 実行する。

  • radioconda Promptを開く

>mkdir python

>cd python
  • test1.pyを書く
#!/usr/bin/env Python3
from gnuradio import gr
from gnuradio import audio
from gnuradio import analog

class my_top_block(gr.top_block):
	def __init__(self):
		gr.top_block.__init__(self)
		sample_rate = 32000
		ampl = 0.1
		src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 350, ampl)
		src1 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, ampl)
		dst = audio.sink(sample_rate, "")
		self.connect(src0, (dst, 0))
		self.connect(src1, (dst, 1))

if __name__ == '__main__':
	try:
		my_top_block().run()
	except [[KeyboardInterrupt]]:
		pass

  • 実行する。
>python test1.py

以上。

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