[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Spectrum_sense of a smaller banwidth
From: |
Tom Rondeau |
Subject: |
Re: [Discuss-gnuradio] Spectrum_sense of a smaller banwidth |
Date: |
Wed, 11 Mar 2009 10:46:04 -0400 |
On Tue, Mar 10, 2009 at 6:33 AM, Adi85 <address@hidden> 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!
It's a slight misunderstanding of the word "vector." The FFT outputs a
vector of size (sizeof(datatype)*fftsize). The vector sink is really
just a sink that stuffs a stream of items into a vector object. What
it really wants to see is a stream in, not a vector in.
Simply put, add a gr.vector_to_stream between the fft block and vector
sink block.
Tom