0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

pythonでgnuradio その3

Posted at

#概要

pythonでgnuradioやってみた。
サイン波を録音。

#サンプルコード

from gnuradio import gr
from gnuradio import blocks
from gnuradio import analog

class my_top_block(gr.top_block):
	def __init__(self):
		gr.top_block.__init__(self)
		samples = sample_rate = 48000
		ampl = 0.3
		src = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, ampl)
		head = blocks.head(gr.sizeof_float, samples)
		dst = blocks.wavfile_sink("a1.wav", 1, sample_rate, 8)
		self.connect(src, head, (dst, 0))

if __name__ == '__main__':
	try:
		my_top_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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?