|
From: | David Adrian |
Subject: | Re: [Discuss-gnuradio] Spectrum_sense of a smaller banwidth |
Date: | Tue, 10 Mar 2009 10:48:10 -0700 (PDT) |
Thanks for the reply Eric, here is what I have now: #!/usr/bin/env python from gnuradio import gr, gru, window from gnuradio import usrp from gnuradio.wxgui import stdgui, fftsink, scopesink import wx class topBlock(gr.top_block): def __init__(self): gr.top_block.__init__(self) fftsize = 256 udecim = 256 mywin = window.blackmanharris(fftsize) fft = gr.fft_vcc(fftsize, True, mywin) signal = usrp.source_c(0,udecim) # signal from Basic RX, decimation=256 ss2v = gr.stream_to_vector(gr.sizeof_gr_complex, fftsize) v2ss = gr.vector_to_stream(gr.sizeof_gr_complex, fftsize) f_sink = gr.file_sink(gr.sizeof_gr_complex,"output.dat") self.connect(signal, ss2v, fft, v2ss, f_sink) # Do stuff with fsink.data() def main(): print "Initilizing.." tb = topBlock() print "Flowgraph start.." tb.start() print "Exiting.." if __name__ == "__main__": main() But the output.dat file is empty. What I want to do here is to calculate the fft of a bunch of samples and from there to extract the bin with the maximum value in order to be able later to "follow" that signal in a aprox 200 Hz bandwidth Adrian
|
[Prev in Thread] | Current Thread | [Next in Thread] |