Subversion Repositories svnkaklik

Rev

Rev 515 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 515 Rev 524
Line 2... Line 2...
2
##################################################
2
##################################################
3
# Gnuradio Python Flow Graph
3
# Gnuradio Python Flow Graph
4
# Title: Sonar
4
# Title: Sonar
5
# Author: Kaklik
5
# Author: Kaklik
6
# Description: Sonar waform generator
6
# Description: Sonar waform generator
7
# Generated: Fri Feb 20 19:31:13 2009
7
# Generated: Sat Feb 21 11:50:42 2009
8
##################################################
8
##################################################
9
 
9
 
10
from gnuradio import audio
10
from gnuradio import audio
11
from gnuradio import gr
11
from gnuradio import gr
12
from gnuradio.wxgui import scopesink2
12
from gnuradio.wxgui import scopesink2
-
 
13
from gnuradio.wxgui import waterfallsink2
13
from grc_gnuradio import wxgui as grc_wxgui
14
from grc_gnuradio import wxgui as grc_wxgui
14
import wx
15
import wx
15
 
16
 
16
class Sonar(grc_wxgui.top_block_gui):
17
class Sonar(grc_wxgui.top_block_gui):
17
 
18
 
Line 70... Line 71...
70
			t_scale=.0001,
71
			t_scale=.0001,
71
			num_inputs=2,
72
			num_inputs=2,
72
		)
73
		)
73
		self.wxgui_scopesink2_0.win.set_format_line()
74
		self.wxgui_scopesink2_0.win.set_format_line()
74
		self.Add(self.wxgui_scopesink2_0.win)
75
		self.Add(self.wxgui_scopesink2_0.win)
-
 
76
		self.wxgui_waterfallsink2_0 = waterfallsink2.waterfall_sink_f(
-
 
77
			self.GetWin(),
-
 
78
			baseband_freq=0,
-
 
79
			y_per_div=10,
-
 
80
			ref_level=50,
-
 
81
			sample_rate=samp_rate,
-
 
82
			fft_size=512,
-
 
83
			fft_rate=15,
-
 
84
			average=True,
-
 
85
			avg_alpha=None,
-
 
86
			title="Waterfall Plot",
-
 
87
		)
-
 
88
		self.Add(self.wxgui_waterfallsink2_0.win)
75
 
89
 
76
		##################################################
90
		##################################################
77
		# Connections
91
		# Connections
78
		##################################################
92
		##################################################
79
		self.connect((self.gr_sig_source_x, 0), (self.audio_sink, 0))
93
		self.connect((self.gr_sig_source_x, 0), (self.audio_sink, 0))
80
		self.connect((self.gr_sig_source_x, 0), (self.wxgui_scopesink2_0, 0))
94
		self.connect((self.gr_sig_source_x, 0), (self.wxgui_scopesink2_0, 0))
81
		self.connect((self.audio_source_0, 0), (self.wxgui_scopesink2_0, 1))
95
		self.connect((self.audio_source_0, 0), (self.wxgui_scopesink2_0, 1))
-
 
96
		self.connect((self.audio_source_0, 0), (self.wxgui_waterfallsink2_0, 0))
82
 
97
 
83
	def set_samp_rate(self, samp_rate):
98
	def set_samp_rate(self, samp_rate):
84
		self.samp_rate = samp_rate
99
		self.samp_rate = samp_rate
85
		self.gr_sig_source_x.set_sampling_freq(self.samp_rate)
100
		self.gr_sig_source_x.set_sampling_freq(self.samp_rate)
86
		self.wxgui_scopesink2_0.set_sample_rate(self.samp_rate*2)
101
		self.wxgui_scopesink2_0.set_sample_rate(self.samp_rate*2)
-
 
102
		self.wxgui_waterfallsink2_0.set_sample_rate(self.samp_rate)
87
 
103
 
88
	def set_frequency(self, frequency):
104
	def set_frequency(self, frequency):
89
		self.frequency = frequency
105
		self.frequency = frequency
90
		self.gr_sig_source_x.set_frequency(self.frequency)
106
		self.gr_sig_source_x.set_frequency(self.frequency)
91
 
107