0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

pythonでgnuradio その19

Last updated at Posted at 2024-08-17

概要

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

練習問題

AM変調を録音した、wavファイル読み込んでAM復調して、聞く。
信号は、440Hzのサイン波、搬送波は、5KHz。

方針

  • hilbert使う。
  • am demod使う。

サンプルコード


from gnuradio import gr, blocks, analog, audio
from gnuradio import filter
from gnuradio.filter import firdes
from gnuradio.fft import window

class my_top_block(gr.top_block):
	def __init__(self):
		gr.top_block.__init__(self)
		samp_rate = 32000
		self.hilbert_fc_0 = filter.hilbert_fc(65, window.WIN_HAMMING, 6.76)
		self.blocks_wavfile_source_0 = blocks.wavfile_source('a2.wav', True)
		self.audio_sink_0 = audio.sink(samp_rate, '', True)
		self.analog_am_demod_cf_0 = analog.am_demod_cf(channel_rate = 48000, audio_decim = 1, audio_pass = 5000, audio_stop = 5500, )
		self.connect((self.blocks_wavfile_source_0, 0), (self.hilbert_fc_0, 0))
		self.connect((self.hilbert_fc_0, 0), (self.analog_am_demod_cf_0, 0))
		self.connect((self.analog_am_demod_cf_0, 0), (self.audio_sink_0, 0))

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?