discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Spectrum_sense of a smaller banwidth


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Spectrum_sense of a smaller banwidth
Date: Tue, 10 Mar 2009 10:05:38 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

On Tue, Mar 10, 2009 at 03:33:32AM -0700, Adi85 wrote:
> 
> Still getting an error!
> thank you in advance
> 
> 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
> >        v_sink = gr.vector_sink_c()
> >
> >        self.connect(signal, fft, v_sink)
> >
> >        # Do stuff with v_sink.data()
> >        print v_sink.data()
> >
>  if __name__ == "__main__":
> >    print "Initilizing.."
> >    tb = topBlock()
> >    print "Flowgraph start.."
> >    tb.start()
> >    print "Exiting.."
> 
> 
> but i get the same error:
> 
> ValueError: itemsize mismatch: usrp1_source_c(2):0 using 8,
> fft_vcc_fftw(1):0 using 2048
> 
> 
> the value 2048 depends of the fft size 2048=8*256
> 
> thank you very much!

You need to insert a gr.stream_to_vector block between the usrp and
the fft.  Also, using vector_sink_c is not recommended for anything
but QA code that runs with a small number of samples.  If used like
you are trying to use it, it will consume all of the memory on your
system.  Use a gr.file_sink instead.

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]