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 その22

Last updated at Posted at 2024-08-17

概要

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

練習問題

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

方針

  • hilbert使う。
  • fm demod使う。

サンプルコード

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

class my_top_block(gr.top_block):
	def __init__(self):
		gr.top_block.__init__(self)
		self.samp_rate = samp_rate = 32000
		self.hilbert_fc_0 = filter.hilbert_fc(65, window.WIN_HAMMING, 6.76)
		self.blocks_wavfile_source_0 = blocks.wavfile_source('f5.wav', True)
		self.audio_sink_0 = audio.sink(samp_rate, '', True)
		self.analog_fm_demod_cf_0 = analog.fm_demod_cf(channel_rate = 48000, audio_decim = 1, deviation = 75000, audio_pass = 15000, audio_stop = 16000, gain = 1.0, tau = (75e-6),)
		self.connect((self.analog_fm_demod_cf_0, 0), (self.audio_sink_0, 0))
		self.connect((self.blocks_wavfile_source_0, 0), (self.hilbert_fc_0, 0))
		self.connect((self.hilbert_fc_0, 0), (self.analog_fm_demod_cf_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?