Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 69 lines (57 sloc) 2.819 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Top Block
# Generated: Fri Oct 12 17:56:45 2012
##################################################

from gnuradio import eng_notation
from gnuradio import gr, digital
from gnuradio.eng_option import eng_option
from gnuradio.gr import firdes
from grc_gnuradio import wxgui as grc_wxgui
from optparse import OptionParser
import baz
import wx

class my_top_block(gr.top_block):

def __init__(self):
gr.top_block.__init__(self)

##################################################
# Blocks
##################################################
#self.pow_cc_0 = baz.pow_cc(2.0, 0.0)
#self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*1, "/home/alexzh/Dropbox/Public/temp.dat", False)
self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*1, "/home/alexzh/gr_alex/gnuradio/gr-digital/examples/narrowband/file.dat", False)
self.gr_file_sink1 = gr.file_sink(gr.sizeof_gr_complex*32*32, "sampcov.dat")
  self.gr_file_sink2 = gr.file_sink(gr.sizeof_char*32*32, "sampcovind.dat")
self.gr_file_sink3 = gr.file_sink(gr.sizeof_float, "trace.dat")
self.gr_file_sink4 = gr.file_sink(gr.sizeof_float*32, "eigenvalue.dat")

#self.gr_file_sink_2 = gr.file_sink(gr.sizeof_gr_complex*1, "test.dat")
#self.gr_file_sink_2.set_unbuffered(False)
self.tracer = digital.digital_swig.trace_calculator(32)
#self.eval = digital.digital_swig.eigen_herm(32)

self.s2v = gr.stream_to_vector(gr.sizeof_gr_complex, 32)
self.sampcov = digital.digital_swig.sampcov_matrix_calculator(32, 800)
##################################################
# Connections
##################################################
#self.connect((self.pow_cc_0, 0), (self.gr_file_sink_2, 0))
#self.connect((self.gr_file_source_0, 0), (self.pow_cc_0, 0))


self.connect((self.gr_file_source_0, 0), self.s2v)
self.connect(self.s2v, self.sampcov)
#self.connect(self.gr_file_source_0, gr.file_sink(gr.sizeof_gr_complex, "origin.dat"))
#self.connect(self.s2v, gr.file_sink(gr.sizeof_gr_complex*32, "vector.dat"))
self.connect((self.sampcov, 0), self.gr_file_sink1)
self.connect((self.sampcov, 1), self.gr_file_sink2)
self.connect((self.sampcov, 0), (self.tracer, 0))
self.connect((self.sampcov, 1), (self.tracer, 1))
#self.connect((self.sampcov, 0), (self.eval, 0))
#self.connect((self.sampcov, 1), (self.eval, 1))
self.connect(self.tracer, self.gr_file_sink3)
#self.connect(self.eval, self.gr_file_sink4)


if __name__ == '__main__':
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
(options, args) = parser.parse_args()
if gr.enable_realtime_scheduling() != gr.RT_OK:
print "Error: failed to enable realtime scheduling."
tb = my_top_block()
tb.run()

Something went wrong with that request. Please try again.