cpm mode plots
This commit is contained in:
parent
cbb6462106
commit
ac9cfa58b7
|
@ -162,6 +162,13 @@ class wrap_gp(object):
|
||||||
s += '\n'.join(['%f' % self.buf[i*self.sps+j] for j in range(self.sps+1)])
|
s += '\n'.join(['%f' % self.buf[i*self.sps+j] for j in range(self.sps+1)])
|
||||||
s += '\ne\n'
|
s += '\ne\n'
|
||||||
plots.append('"-" with lines')
|
plots.append('"-" with lines')
|
||||||
|
elif mode == 'cpm':
|
||||||
|
nplots = len(self.buf)
|
||||||
|
ab = np.abs(self.buf)
|
||||||
|
for i in range(len(ab)):
|
||||||
|
s += '%f\n' % ab[i]
|
||||||
|
s += '\ne\n'
|
||||||
|
plots.append('"-" with lines')
|
||||||
elif mode == 'constellation':
|
elif mode == 'constellation':
|
||||||
plot_size = (240,240)
|
plot_size = (240,240)
|
||||||
self.buf = self.buf[:100]
|
self.buf = self.buf[:100]
|
||||||
|
@ -317,6 +324,11 @@ class wrap_gp(object):
|
||||||
h+= 'set yrange [-4:4]\n'
|
h+= 'set yrange [-4:4]\n'
|
||||||
h+= 'set title "Datascope %s" %s\n' % (self.title, label_color)
|
h+= 'set title "Datascope %s" %s\n' % (self.title, label_color)
|
||||||
plot_color = ''
|
plot_color = ''
|
||||||
|
elif mode == 'cpm':
|
||||||
|
h+= background
|
||||||
|
#h+= 'set yrange [-4:4]\n'
|
||||||
|
h+= 'set title "CPM RSSI %s" %s\n' % (self.title, label_color)
|
||||||
|
#plot_color = ''
|
||||||
elif mode == 'sync':
|
elif mode == 'sync':
|
||||||
h += 'set object 1 rect from screen 0,0 to screen 1,1 %s behind\n' % (background_color)
|
h += 'set object 1 rect from screen 0,0 to screen 1,1 %s behind\n' % (background_color)
|
||||||
h += 'set size square\n'
|
h += 'set size square\n'
|
||||||
|
@ -420,6 +432,30 @@ class eye_sink_f(gr.sync_block):
|
||||||
def kill(self):
|
def kill(self):
|
||||||
self.gnuplot.kill()
|
self.gnuplot.kill()
|
||||||
|
|
||||||
|
class cpm_sink_c(gr.sync_block):
|
||||||
|
"""
|
||||||
|
"""
|
||||||
|
def __init__(self, debug = _def_debug, sps = _def_sps):
|
||||||
|
gr.sync_block.__init__(self,
|
||||||
|
name="cpm_sink_c",
|
||||||
|
in_sig=[np.complex64],
|
||||||
|
out_sig=None)
|
||||||
|
self.debug = debug
|
||||||
|
self.sps = sps
|
||||||
|
self.gnuplot = wrap_gp(sps=self.sps)
|
||||||
|
|
||||||
|
def work(self, input_items, output_items):
|
||||||
|
in0 = input_items[0]
|
||||||
|
l = len(in0)
|
||||||
|
consumed = self.gnuplot.plot(in0, self.sps*3000, mode='cpm')
|
||||||
|
return consumed ### len(input_items[0])
|
||||||
|
|
||||||
|
def set_title(self, title):
|
||||||
|
self.gnuplot.set_title(title)
|
||||||
|
|
||||||
|
def kill(self):
|
||||||
|
self.gnuplot.kill()
|
||||||
|
|
||||||
class constellation_sink_c(gr.sync_block):
|
class constellation_sink_c(gr.sync_block):
|
||||||
"""
|
"""
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -50,6 +50,7 @@ from gr_gnuplot import symbol_sink_f
|
||||||
from gr_gnuplot import eye_sink_f
|
from gr_gnuplot import eye_sink_f
|
||||||
from gr_gnuplot import setup_correlation
|
from gr_gnuplot import setup_correlation
|
||||||
from gr_gnuplot import sync_plot
|
from gr_gnuplot import sync_plot
|
||||||
|
from gr_gnuplot import cpm_sink_c
|
||||||
|
|
||||||
from nxdn_trunking import cac_message
|
from nxdn_trunking import cac_message
|
||||||
|
|
||||||
|
@ -289,6 +290,14 @@ class channel(object):
|
||||||
self.sinks.append(sink)
|
self.sinks.append(sink)
|
||||||
self.demod.connect_bb('symbol_filter', sink)
|
self.demod.connect_bb('symbol_filter', sink)
|
||||||
self.kill_sink.append(sink)
|
self.kill_sink.append(sink)
|
||||||
|
elif plot.startswith('cpm'):
|
||||||
|
if self.symbol_rate != 6000: # fixed rate value for p25p2
|
||||||
|
sys.stderr.write('warning: symbol rate %d may be incorrect for CPM channel %s\n' % (self.symbol_rate, self.name))
|
||||||
|
sink = cpm_sink_c(sps=config['if_rate'] // self.symbol_rate)
|
||||||
|
sink.set_title(self.name)
|
||||||
|
self.sinks.append(sink)
|
||||||
|
self.demod.connect_complex('if_out', sink)
|
||||||
|
self.kill_sink.append(sink)
|
||||||
elif plot == 'symbol':
|
elif plot == 'symbol':
|
||||||
sink = symbol_sink_f()
|
sink = symbol_sink_f()
|
||||||
sink.set_title(self.name)
|
sink.set_title(self.name)
|
||||||
|
|
Loading…
Reference in New Issue