discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] About gr.buffer


From: Zhonghua
Subject: [Discuss-gnuradio] About gr.buffer
Date: Thu, 22 Sep 2011 16:11:21 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13

Hi every one,
Now I am trying to use gr.buffer. I wrote some very simple codes to test how to use gr.buffer correctly. The main codes are as below: self.u=gr.sig_source_c(1e4,gr.GR_SIN_WAVE,1e3,1) #to create a sin source self.buf=gr.buffer(1000,gr.sizeof_gr_complex,self.u) #create a buffer by applying gr.buffer
     self.csink=gr.vector_sink_c()
self.connect(self.buf,self.csink) #send buffer volume to the sink

But unfortunately, I got a despondent error reply says: in method 'buffer', argument 3 of type 'gr_block_sptr'. I looked up the gr_buffer class and found that the so called argument 3 is a link to a block which writes data to this buffer. As my understanding, the sig_source block should write data to the buffer so I write self.buf as above way. From the error hint, I ever thought perhaps the error just comes from the incorrect type. Because the sin_source object is pointed by the pointer type of "gr_sin_source_c_sptr". But how can I get an object that merely inherited from gr.block class? I tried to construct a class inherits from gr.block but there exists another error says that "'module' object has no attribute 'block' ". I checked the internet but found nothing helpful. A surprising fact is that looks no one ever used gr.buffer in gnuradio by adopting python way. Is there anybody know how to use it correctly?
Your instruction is fairly appreciated.

Br,
Zhonghua






reply via email to

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