Our code is as follows:
from gnuradio import gr, usrp
class carrier_sense:
def __init__(self):
self.fg = gr.flow_graph ()
self.u = usrp.source_c()
self.complex_mag = gr.complex_to_mag_squared()
self.iir_filt = gr.single_pole_iir_filter_ff(0.5)
self.dest = gr.vector_sink_f()
self.u.tune(0, self.u.db[0][0], 2.4e9)
#Connect all of the blocks together
self.fg.connect(self.u, self.complex_mag, self.iir_filt, self.dest)
def main():
testgraph = carrier_sense()
testgraph.fg.start()
print testgraph.dest.data()
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
pass
Trying to run this code gives us this printed output : ()
Our logic was that since the output of the single_pole_iir_filter is a float, we could simply attach the vector_sink_c block to the end of it. We get the same results when attaching the sink to the complex_mag block, or a complex vector sink to the usrp board.
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio