[Discuss-gnuradio] preload tx buffer on USRP N210
Hey All, I was wondering if there was a way to preload samples onto the FIFO buffer on the FPGA, so that I could theoretically loop through those samples and keep transmitting them? The idea was mentioned in this thread: http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2012-October/005530.html , where the idea was briefly mentioned at the end, however I'm not sure if its actually possible or if anyone has done it before. If it is possible, can someone point me in the right direction? Thanks, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Can another DUC chain be added to USRP N210?
Thank you very much for your help Josh! I'll let you know if we end up going this way in our design. On Sun, Sep 30, 2012 at 7:01 PM, Josh Blum j...@ettus.com wrote: On 09/29/2012 09:45 AM, Anisha Gorur wrote: Thanks Josh, What I am looking for on the TX side of things is basically the same thing I have on the RX side. If I set the subdev spec on the basic RX to A:A A:B and then use usrp-set_rx_freq(uhd::tune_request_t(freq)) for each channel, I get two separate rx channels, both with their own IQ pairs. On the TX side I only manage to have one IQ pair, as in I through TX_A and Q through TX_B. We were trying for a 4 channel transmit on 2 USRPs, so that they could all be connected by s MIMO cable. One more question, when you say too complicated to be worth it, generally, what kind of modification would be necessary? The reason for the complication is there is this whole flow control implementation for the TX. Here is my suggestion: On the host, interleave your MIMO channels. So send 1 TX channel where the samples are ch0IQ0, ch1IQ0, ch0IQ1 In the FPGA, a good way is to modify the top level to have two DUC chains. See right here: http://code.ettus.com/redmine/ettus/projects/uhd/repository/revisions/master/entry/fpga/usrp2/top/N2x0/u2plus_core.v#L716 Instantiate two DUC chains. Most of the wires can stay the same. Since this is MIMO, you want both DUC chains to have the same settings anyways. What you want to do here is to play with the strobe_tx signal such that every even strobe is off for DUC0 and every off strobe is off for DUC1... thats effectively the deinterleave. Also notice how the tx_fe outputs are connected. reg even; always @(posedge dsp_clk) if (~run_tx) even = 0; else if (strobe_tx) even = ~even; duc_chain #(.BASE(SR_TX_DSP), .DSPNO(0)) duc_chain0 (.clk(dsp_clk),.rst(dsp_rst), .clr(clear_tx), .set_stb(set_stb_dsp),.set_addr(set_addr_dsp),.set_data(set_data_dsp), .set_stb_user(set_stb_user), .set_addr_user(set_addr_user), .set_data_user(set_data_user), .tx_fe_i(tx_fe_i),.tx_fe_q(), .sample(sample_tx), .run(run_tx), .strobe(strobe_tx even), .debug() ); duc_chain #(.BASE(SR_TX_DSP), .DSPNO(0)) duc_chain1 (.clk(dsp_clk),.rst(dsp_rst), .clr(clear_tx), .set_stb(set_stb_dsp),.set_addr(set_addr_dsp),.set_data(set_data_dsp), .set_stb_user(set_stb_user), .set_addr_user(set_addr_user), .set_data_user(set_data_user), .tx_fe_i(tx_fe_q),.tx_fe_q(), .sample(sample_tx), .run(run_tx), .strobe(strobe_tx ~even), .debug() ); -Josh Thanks for your time! -Anisha On Fri, Sep 28, 2012 at 6:36 PM, Josh Blum j...@ettus.com wrote: On 09/28/2012 08:49 AM, Anisha Gorur wrote: Hello All, I am using a USRP N210. When i set the subdev spec for my basic RX daughterboard as A:A A:B I can receive two channels. However, if I try to do something similar for the basic TX I get an error like The user specified 2 channels, but there are only 1 tx dsps on mboard 0. I assume this is because there is only one DUC chain in the N210. Is there a way to modify this so that I can have two DUC chains in the same way that I have two DDC chains? Thanks, Anisha I think adding two complete DUC chains into N210 would be too complicated to be worth it. Is there something specific that you cant do with the single DUC chain? As long as the cordic is set to zero, I and Q will remain completely separate from host samples, all the way to the SMA connectors A and B. Otherwise, perhaps you need a different rotation for I vs Q? I think that would be better accomplished by two different cordics. Then perhaps a custom DSP in the FPGA is for you: http://code.ettus.com/redmine/ettus/projects/uhd/repository/revisions/master/entry/fpga/README.txt#L29 I hope that helps. -josh ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] 8-channel receiver
Thank you very much again! On Sun, Sep 30, 2012 at 6:22 PM, Josh Blum j...@ettus.com wrote: On 09/29/2012 09:46 AM, Anisha Gorur wrote: Thanks Josh, that helps quite a bit! Our sampling frequency is not particularly fast, it will only be around 5 MS/S. Right now the send and receive frame size are still the defaults, 1472 for receive and 1444 for send. In the notes, it says to improve receive latency, configure the transport for a smaller frame size, will this work for send latency as well? Also is there an equation I can use to determine what the best frame sizes would be, or should I just go with trial and error and use latency_test.cpp to determine if it has shifted? If you change the frame size, how much improvement in latency do you usually see? Again, thank you so much. -Anisha The reason that shrinking the receive frame size reduces latency is that the RX DSP chain produces samples at a fixed rate. Therefore, the device cannot release a packet until samples_per_packet / sample_rate. The first sample is a packet is delayed by the time it takes to produce the last sample. However, in the case of transmission/send there is no such issue. Essentially your application is the pacer and producer of samples. So you have total control. -Josh On Fri, Sep 28, 2012 at 6:57 PM, Josh Blum j...@ettus.com wrote: On 09/28/2012 02:46 PM, Anisha Gorur wrote: Thanks Matt! Do you have any idea for what kind of latency we would expect? Also would The dominating factor in latency here is the gigabit ethernet, this tends to be around 100us. Here are a few notes about that: http://files.ettus.com/uhd_docs/manual/html/transport.html#latency-optimization the data be routed through the host? My Radio, We only have a couple months Normally the samples would all go to the host computer that configured the USRP. It is possible to configure the USRP with one machine but send the samples to an arbitrary network location: http://files.ettus.com/uhd_docs/manual/html/usrp2.html#alternative-stream-destination For that matter, there is nothing wrong with splitting up the USRP configuration among several computers. It all depends how you plan on using the data. to do this, but we have tried to synchronize USRPs before, so we are aware of some of the problems. Anything in particular that I could help to clarify? -josh Thanks, Anisha On Wed, Sep 26, 2012 at 3:51 PM, My Radio myradioplatf...@gmail.com wrote: One should remember the extremes involved in syncing all USRP'S which will lead to developing a new driver for USRP2. What about the your APP development time?. Are you interested in developing new driver or app ? On Thu, Sep 27, 2012 at 12:04 AM, Matt Ettus m...@ettus.com wrote: You can use a gigabit ethernet switch and put all the USRPs on there. You should be able to make USRPs send data to each other. You will of course need to do work to get your algorithms into the FPGA. Matt On Wed, Sep 26, 2012 at 12:38 PM, Anisha Gorur at...@virginia.edu wrote: I have a quick theoretical question. Is there any way to construct an 8-channel receiver using 4 USRPS without data going through the host computer? Basically some kind of way to daisy chain mimo cables (though I know this is not possible), or at least get the same benefits you would receive from daisy chaining mimo cables, without using a switch or network connections. Thank you, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Can another DUC chain be added to USRP N210?
Thanks Josh, What I am looking for on the TX side of things is basically the same thing I have on the RX side. If I set the subdev spec on the basic RX to A:A A:B and then use usrp-set_rx_freq(uhd::tune_request_t(freq)) for each channel, I get two separate rx channels, both with their own IQ pairs. On the TX side I only manage to have one IQ pair, as in I through TX_A and Q through TX_B. We were trying for a 4 channel transmit on 2 USRPs, so that they could all be connected by s MIMO cable. One more question, when you say too complicated to be worth it, generally, what kind of modification would be necessary? Thanks for your time! -Anisha On Fri, Sep 28, 2012 at 6:36 PM, Josh Blum j...@ettus.com wrote: On 09/28/2012 08:49 AM, Anisha Gorur wrote: Hello All, I am using a USRP N210. When i set the subdev spec for my basic RX daughterboard as A:A A:B I can receive two channels. However, if I try to do something similar for the basic TX I get an error like The user specified 2 channels, but there are only 1 tx dsps on mboard 0. I assume this is because there is only one DUC chain in the N210. Is there a way to modify this so that I can have two DUC chains in the same way that I have two DDC chains? Thanks, Anisha I think adding two complete DUC chains into N210 would be too complicated to be worth it. Is there something specific that you cant do with the single DUC chain? As long as the cordic is set to zero, I and Q will remain completely separate from host samples, all the way to the SMA connectors A and B. Otherwise, perhaps you need a different rotation for I vs Q? I think that would be better accomplished by two different cordics. Then perhaps a custom DSP in the FPGA is for you: http://code.ettus.com/redmine/ettus/projects/uhd/repository/revisions/master/entry/fpga/README.txt#L29 I hope that helps. -josh ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] 8-channel receiver
Thanks Josh, that helps quite a bit! Our sampling frequency is not particularly fast, it will only be around 5 MS/S. Right now the send and receive frame size are still the defaults, 1472 for receive and 1444 for send. In the notes, it says to improve receive latency, configure the transport for a smaller frame size, will this work for send latency as well? Also is there an equation I can use to determine what the best frame sizes would be, or should I just go with trial and error and use latency_test.cpp to determine if it has shifted? If you change the frame size, how much improvement in latency do you usually see? Again, thank you so much. -Anisha On Fri, Sep 28, 2012 at 6:57 PM, Josh Blum j...@ettus.com wrote: On 09/28/2012 02:46 PM, Anisha Gorur wrote: Thanks Matt! Do you have any idea for what kind of latency we would expect? Also would The dominating factor in latency here is the gigabit ethernet, this tends to be around 100us. Here are a few notes about that: http://files.ettus.com/uhd_docs/manual/html/transport.html#latency-optimization the data be routed through the host? My Radio, We only have a couple months Normally the samples would all go to the host computer that configured the USRP. It is possible to configure the USRP with one machine but send the samples to an arbitrary network location: http://files.ettus.com/uhd_docs/manual/html/usrp2.html#alternative-stream-destination For that matter, there is nothing wrong with splitting up the USRP configuration among several computers. It all depends how you plan on using the data. to do this, but we have tried to synchronize USRPs before, so we are aware of some of the problems. Anything in particular that I could help to clarify? -josh Thanks, Anisha On Wed, Sep 26, 2012 at 3:51 PM, My Radio myradioplatf...@gmail.com wrote: One should remember the extremes involved in syncing all USRP'S which will lead to developing a new driver for USRP2. What about the your APP development time?. Are you interested in developing new driver or app ? On Thu, Sep 27, 2012 at 12:04 AM, Matt Ettus m...@ettus.com wrote: You can use a gigabit ethernet switch and put all the USRPs on there. You should be able to make USRPs send data to each other. You will of course need to do work to get your algorithms into the FPGA. Matt On Wed, Sep 26, 2012 at 12:38 PM, Anisha Gorur at...@virginia.edu wrote: I have a quick theoretical question. Is there any way to construct an 8-channel receiver using 4 USRPS without data going through the host computer? Basically some kind of way to daisy chain mimo cables (though I know this is not possible), or at least get the same benefits you would receive from daisy chaining mimo cables, without using a switch or network connections. Thank you, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] Can another DUC chain be added to USRP N210?
Hello All, I am using a USRP N210. When i set the subdev spec for my basic RX daughterboard as A:A A:B I can receive two channels. However, if I try to do something similar for the basic TX I get an error like The user specified 2 channels, but there are only 1 tx dsps on mboard 0. I assume this is because there is only one DUC chain in the N210. Is there a way to modify this so that I can have two DUC chains in the same way that I have two DDC chains? Thanks, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] 8-channel receiver
Thanks Matt! Do you have any idea for what kind of latency we would expect? Also would the data be routed through the host? My Radio, We only have a couple months to do this, but we have tried to synchronize USRPs before, so we are aware of some of the problems. Thanks, Anisha On Wed, Sep 26, 2012 at 3:51 PM, My Radio myradioplatf...@gmail.com wrote: One should remember the extremes involved in syncing all USRP'S which will lead to developing a new driver for USRP2. What about the your APP development time?. Are you interested in developing new driver or app ? On Thu, Sep 27, 2012 at 12:04 AM, Matt Ettus m...@ettus.com wrote: You can use a gigabit ethernet switch and put all the USRPs on there. You should be able to make USRPs send data to each other. You will of course need to do work to get your algorithms into the FPGA. Matt On Wed, Sep 26, 2012 at 12:38 PM, Anisha Gorur at...@virginia.edu wrote: I have a quick theoretical question. Is there any way to construct an 8-channel receiver using 4 USRPS without data going through the host computer? Basically some kind of way to daisy chain mimo cables (though I know this is not possible), or at least get the same benefits you would receive from daisy chaining mimo cables, without using a switch or network connections. Thank you, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] 8-channel receiver
I have a quick theoretical question. Is there any way to construct an 8-channel receiver using 4 USRPS without data going through the host computer? Basically some kind of way to daisy chain mimo cables (though I know this is not possible), or at least get the same benefits you would receive from daisy chaining mimo cables, without using a switch or network connections. Thank you, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] 8-channel receiver
Clarification: This would be using USRP N210, not USRP1, where I know it is possible to have an 8 channel receive or transmit only using a mimo cable. On Wed, Sep 26, 2012 at 12:38 PM, Anisha Gorur at...@virginia.edu wrote: I have a quick theoretical question. Is there any way to construct an 8-channel receiver using 4 USRPS without data going through the host computer? Basically some kind of way to daisy chain mimo cables (though I know this is not possible), or at least get the same benefits you would receive from daisy chaining mimo cables, without using a switch or network connections. Thank you, Anisha -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] 2 complex receive channels on usrp n210
I am getting complex data around my center frequency, but only on one channel, RXA shows the data, while RXB is just zeros. In my code, I have just added a few lines from rx_samples_to_file.cpp to rx_multi_samples.cpp to make rx_multi_samples write out to a file. This is with the subdevice specs A:A and A:B, should I change those? On Wed, Sep 19, 2012 at 6:50 PM, Josh Blum j...@ettus.com wrote: On 09/19/2012 04:54 PM, Anisha Gorur wrote: I tried this out, and I am getting two real signals, while I want two complex signals. From dboards.rst: ^^^ Basic RX and LFRX ^^^ The Basic RX and LFRX boards have 4 frontends: * **Frontend A:** real signal on antenna RXA * **Frontend B:** real signal on antenna RXB * **Frontend AB:** quadrature frontend using both antennas (IQ) * **Frontend BA:** quadrature frontend using both antennas (QI) So choosing A and B as the subdevice specs would give me two real signals, correct? In this case, the DDC chains will zero out Q, and connect A or B to I. So you will get complex data centered at whatever you tune center frequency to. -josh On Wed, Sep 19, 2012 at 2:58 PM, Anisha Gorur at...@virginia.edu wrote: Great! So if i selected 0:A and 0:B as multiple subdevices, I would receive something like I0, Q0 and I1, Q1? On Wed, Sep 19, 2012 at 12:45 PM, Josh Blum j...@ettus.com wrote: On 09/19/2012 10:44 AM, Anisha Gorur wrote: Hello All, I know that on the USRP1, it was possible to have four seperate RX channels, and therefore receive two pairs of IQ samples. I was wondering if there were any way to do this on a USRP N210, using a basic RX daughterboard, even by possible changing the FPGA code, or it you could only have one pair of IQ samples. Yes. Same idea, except, the frontend names for Basic RX are A, B, and AB: http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2011-May/001271.html -josh Thanks, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] 2 complex receive channels on usrp n210
Hello All, I know that on the USRP1, it was possible to have four seperate RX channels, and therefore receive two pairs of IQ samples. I was wondering if there were any way to do this on a USRP N210, using a basic RX daughterboard, even by possible changing the FPGA code, or it you could only have one pair of IQ samples. Thanks, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] 2 complex receive channels on usrp n210
Great! So if i selected 0:A and 0:B as multiple subdevices, I would receive something like I0, Q0 and I1, Q1? On Wed, Sep 19, 2012 at 12:45 PM, Josh Blum j...@ettus.com wrote: On 09/19/2012 10:44 AM, Anisha Gorur wrote: Hello All, I know that on the USRP1, it was possible to have four seperate RX channels, and therefore receive two pairs of IQ samples. I was wondering if there were any way to do this on a USRP N210, using a basic RX daughterboard, even by possible changing the FPGA code, or it you could only have one pair of IQ samples. Yes. Same idea, except, the frontend names for Basic RX are A, B, and AB: http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2011-May/001271.html -josh Thanks, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] 2 complex receive channels on usrp n210
I tried this out, and I am getting two real signals, while I want two complex signals. From dboards.rst: ^^^ Basic RX and LFRX ^^^ The Basic RX and LFRX boards have 4 frontends: * **Frontend A:** real signal on antenna RXA * **Frontend B:** real signal on antenna RXB * **Frontend AB:** quadrature frontend using both antennas (IQ) * **Frontend BA:** quadrature frontend using both antennas (QI) So choosing A and B as the subdevice specs would give me two real signals, correct? On Wed, Sep 19, 2012 at 2:58 PM, Anisha Gorur at...@virginia.edu wrote: Great! So if i selected 0:A and 0:B as multiple subdevices, I would receive something like I0, Q0 and I1, Q1? On Wed, Sep 19, 2012 at 12:45 PM, Josh Blum j...@ettus.com wrote: On 09/19/2012 10:44 AM, Anisha Gorur wrote: Hello All, I know that on the USRP1, it was possible to have four seperate RX channels, and therefore receive two pairs of IQ samples. I was wondering if there were any way to do this on a USRP N210, using a basic RX daughterboard, even by possible changing the FPGA code, or it you could only have one pair of IQ samples. Yes. Same idea, except, the frontend names for Basic RX are A, B, and AB: http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2011-May/001271.html -josh Thanks, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] FPGA time
Hello, Sorry for the lack of response, I was on vacation. We actually managed to fix most of our problems, mostly due to hardware setup issues. Thank you for your help! On Wed, Aug 29, 2012 at 3:18 PM, mle...@ripnet.com wrote: ** On 29 Aug 2012 15:13, Josh Blum wrote: On 08/28/2012 03:24 PM, Anisha Gorur wrote: Sorry for the confusion. We are trying to synchronize 3 usrps for collect. The devices seem to be time aligned in that the samples are timestamped with the same metadata, so we believed that synchronization had been achieved. However, when the data collected from the usrps was correlated, samples that should have had 0 time difference of arrival were off by as many as 5 samples, at a sample rate of 6.25MS/S. So even though the timestamps are time aligned, the data does not seem to be. The devices have been synchronized PPS times, not uspr.get_time_now(). Thank you, Anisha Can you tell me more about the correlation? Are you sending a impulse split to all 3 devices and determining the pulse arrival. Is the error in time of arrival consistent between runs or does it seem to be random? If you ask all N USRPs to stream at time X, the time reported in the metadata will still be X, even if the internal tick count in each device is not marching in lock step. I have a few suggestions: 1) I think you have 1 GPSDO per USRP providing each a different reference. I would first try the experiment with a shared 10 MHz reference and PPS to all devices to confirm the algorithm. You will need to move the 10 MHz reference jumper back so you can provide an external ref via SMA. I've observed, in a previous life, phase-hits between two GPSDOs connected to the same antenna, watching the same cluster of satellites. Never figured out why, which is why for phase-sensitive work, it makes sense to use a common reference, (like an external GPSDO), rather than a GPSDO-per-unit. ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] FPGA time
Hello, We've been having some trouble with the synchronizing aspects of our project. What we want is the exact same time as the FPGA tick counter, not a time_spec_t representation of time. Where can we get access to that? Thanks! -Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] FPGA time
Thats actually what we are using, however, when printing out the tick count, we randomly, and only sometimes, see a jump of about 30 ticks, and if each tick is 10ns, that is a huge 300ns jump. Do you know why this could be happening? We are using gpsdo's as both a time and clock reference, though this problem seems to occur even if we set the clock and time reference to external. However, setting them to gpsdo seems to make it more stable, as we have seen the ~30 tick jump fewer times with those references. Another question is why would there be a big difference in what the reference is set as when either way, supposedly the internal GPSDO is being used. Thanks, On Tue, Aug 28, 2012 at 4:13 PM, Josh Blum j...@ettus.com wrote: On 08/28/2012 12:03 PM, Anisha Gorur wrote: Hello, We've been having some trouble with the synchronizing aspects of our project. What we want is the exact same time as the FPGA tick counter, not a time_spec_t representation of time. Where can we get access to that? Thanks! -Anisha call to_ticks with the clock rate of the device: http://files.ettus.com/uhd_docs/doxygen/html/classuhd_1_1time__spec__t.html#ad75960ba4c788cd30a5d0c8904888da3 -josh ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] FPGA time
Sorry for the confusion. We are trying to synchronize 3 usrps for collect. The devices seem to be time aligned in that the samples are timestamped with the same metadata, so we believed that synchronization had been achieved. However, when the data collected from the usrps was correlated, samples that should have had 0 time difference of arrival were off by as many as 5 samples, at a sample rate of 6.25MS/S. So even though the timestamps are time aligned, the data does not seem to be. The devices have been synchronized PPS times, not uspr.get_time_now(). Thank you, Anisha On Tue, Aug 28, 2012 at 5:40 PM, Josh Blum j...@ettus.com wrote: On 08/28/2012 01:39 PM, Anisha Gorur wrote: Thats actually what we are using, however, when printing out the tick count, we randomly, and only sometimes, see a jump of about 30 ticks, and if each tick is 10ns, that is a huge 300ns jump. Do you know why this could be happening? I'm very lost. Where are you getting the time_spec from? A receive packet? usrp.get_time_now()? Or is this a time difference between devices? get_time_now is completely asynchronous to the device, if thats what you are calling in a loop, I would expect to see a lot of variation in time deltas. -josh We are using gpsdo's as both a time and clock reference, though this problem seems to occur even if we set the clock and time reference to external. However, setting them to gpsdo seems to make it more stable, as we have seen the ~30 tick jump fewer times with those references. Another question is why would there be a big difference in what the reference is set as when either way, supposedly the internal GPSDO is being used. Thanks, On Tue, Aug 28, 2012 at 4:13 PM, Josh Blum j...@ettus.com wrote: On 08/28/2012 12:03 PM, Anisha Gorur wrote: Hello, We've been having some trouble with the synchronizing aspects of our project. What we want is the exact same time as the FPGA tick counter, not a time_spec_t representation of time. Where can we get access to that? Thanks! -Anisha call to_ticks with the clock rate of the device: http://files.ettus.com/uhd_docs/doxygen/html/classuhd_1_1time__spec__t.html#ad75960ba4c788cd30a5d0c8904888da3 -josh ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] LLLL error printout
Hello, Very quick question, I'm trying to transmit a signal that I have created, and in the console output at the beginning of the transmission, I get this printout: LL. The error is not continuous, it stops after about 10 L's. What does this mean? Thanks, -Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] preload a signal onto USRP
It was for use in a multi-usrp configuration, but actually no longer necessary. Thank you both! On Tue, Aug 7, 2012 at 4:57 PM, Robert Cicconetti gryth...@gmail.comwrote: If you really needed to use a USRP as a standalone signal generator you could probably encode the signal into a hardware block on the FPGA, depending on how much in the way of resources are left unused. It would be much more work than the file source method mentioned earlier. Why do you want it preloaded? Low latency? -R C On Tue, Aug 7, 2012 at 4:38 PM, Anisha Gorur at...@virginia.edu wrote: Hello All, I have a bit of a strange question. Is it possible to somehow preload a signal (it would be periodic) onto a USRP so that I would only have to send a signal saying begin transmit, and it would do so, without sending anything besides the begin transmit message over the Ethernet cable? I've been searching around and I haven't found anyone who wanted to do something like this. Thanks, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] preload a signal onto USRP
Hello All, I have a bit of a strange question. Is it possible to somehow preload a signal (it would be periodic) onto a USRP so that I would only have to send a signal saying begin transmit, and it would do so, without sending anything besides the begin transmit message over the Ethernet cable? I've been searching around and I haven't found anyone who wanted to do something like this. Thanks, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Creating a signal source block using Python
Thanks for the response! I can now see that output_items is getting properly filled, however, when I try to display the file, I'm still getting zero. Besides a throttle is there a way to control the frequency of the random numbers or whatever source I am creating? Thanks, Anisha On Thu, Jul 19, 2012 at 3:47 AM, Martin Braun (CEL) martin.br...@kit.eduwrote: On Wed, Jul 18, 2012 at 02:32:28PM -0400, Anisha Gorur wrote: I then write my constSource block to a file and I try to see the output of the file using a scope sink, but it is just a constant stream of zeros. Am I missing a key part of creating a source block? Also, the reason I don't use a file source is that the stream I am trying to create is dependent upon the time of day, so pulling it from a file source will mean that it is delayed somewhat. I will eventually want to transmit this data as well, not just put it in a file sink. GrExtras is really a test to figure out who's amazing at Python. I already failed once (same prob): http://lists.gnu.org/archive/html/discuss-gnuradio/2012-06/msg00143.html MB -- Karlsruhe Institute of Technology (KIT) Communications Engineering Lab (CEL) Dipl.-Ing. Martin Braun Research Associate Kaiserstraße 12 Building 05.01 76131 Karlsruhe Phone: +49 721 608-43790 Fax: +49 721 608-46071 www.cel.kit.edu KIT -- University of the State of Baden-Württemberg and National Laboratory of the Helmholtz Association ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Creating a signal source block using Python
It works now, thanks! It was a combination of a couple dumb errors on my part. One last thing, I was wondering if there was a way to change the length of output_items[0]? It is 4096 by default I believe. Thanks, Anisha On Thu, Jul 19, 2012 at 2:13 PM, Josh Blum j...@ettus.com wrote: On 07/18/2012 11:32 AM, Anisha Gorur wrote: Hello All, I've been attempting to create my own source block in Python. I have been reading the blocks coding guide here: https://github.com/guruofquality/grextras/wiki/Blocks-Coding-Guide#wiki-work-operation-modes , but so far my source only outputs zeros. An outline of my code is as follows: class constSource(gr.block): def __init__(self): gr.block.__init__(self, name = signal source, in_sig = None,out_sig = [numpy.complex64]) def work(self, input_items, output_items): num_output_items = len(output_items[0]) #I put the code to create what I want to stream here, the code creates a numpy.complex64 array with a length of 32. I then return num_output_items You didnt include the code, but I am guessing that you are not assigning anything to the output vector? numpy array assignment look like this output_items[0][some kind of index selection] = data Look closely at how the examples do this -josh return num_output_items I then write my constSource block to a file and I try to see the output of the file using a scope sink, but it is just a constant stream of zeros. Am ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Creating a signal source block using Python
Sorry, just to clarify, I get that error unless I fill output_items completely, no matter the length of x. Thanks, Anisha On Thu, Jul 19, 2012 at 3:00 PM, Anisha Gorur at...@virginia.edu wrote: I was trying that earlier, however, I get this error from my code output_items[0][:] = x #where x equals a numpy.complex64 array with a length of 32 ValueError: operands could not be broadcast together with shapes (4096) (32) On Thu, Jul 19, 2012 at 2:44 PM, Josh Blum j...@ettus.com wrote: On 07/19/2012 11:28 AM, Anisha Gorur wrote: It works now, thanks! It was a combination of a couple dumb errors on my part. One last thing, I was wondering if there was a way to change the length of output_items[0]? It is 4096 by default I believe. Thanks, Anisha The item length is basically randomly decided by the scheduler. However, you call set_output_multiple(x) and you will be guaranteed to get x*N items where N is an integer. Also, you dont have to actually fill all items, just fill the number you plan to produce. -josh On Thu, Jul 19, 2012 at 2:13 PM, Josh Blum j...@ettus.com wrote: On 07/18/2012 11:32 AM, Anisha Gorur wrote: Hello All, I've been attempting to create my own source block in Python. I have been reading the blocks coding guide here: https://github.com/guruofquality/grextras/wiki/Blocks-Coding-Guide#wiki-work-operation-modes , but so far my source only outputs zeros. An outline of my code is as follows: class constSource(gr.block): def __init__(self): gr.block.__init__(self, name = signal source, in_sig = None,out_sig = [numpy.complex64]) def work(self, input_items, output_items): num_output_items = len(output_items[0]) #I put the code to create what I want to stream here, the code creates a numpy.complex64 array with a length of 32. I then return num_output_items You didnt include the code, but I am guessing that you are not assigning anything to the output vector? numpy array assignment look like this output_items[0][some kind of index selection] = data Look closely at how the examples do this -josh return num_output_items I then write my constSource block to a file and I try to see the output of the file using a scope sink, but it is just a constant stream of zeros. Am ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Creating a signal source block using Python
I was trying that earlier, however, I get this error from my code output_items[0][:] = x #where x equals a numpy.complex64 array with a length of 32 ValueError: operands could not be broadcast together with shapes (4096) (32) On Thu, Jul 19, 2012 at 2:44 PM, Josh Blum j...@ettus.com wrote: On 07/19/2012 11:28 AM, Anisha Gorur wrote: It works now, thanks! It was a combination of a couple dumb errors on my part. One last thing, I was wondering if there was a way to change the length of output_items[0]? It is 4096 by default I believe. Thanks, Anisha The item length is basically randomly decided by the scheduler. However, you call set_output_multiple(x) and you will be guaranteed to get x*N items where N is an integer. Also, you dont have to actually fill all items, just fill the number you plan to produce. -josh On Thu, Jul 19, 2012 at 2:13 PM, Josh Blum j...@ettus.com wrote: On 07/18/2012 11:32 AM, Anisha Gorur wrote: Hello All, I've been attempting to create my own source block in Python. I have been reading the blocks coding guide here: https://github.com/guruofquality/grextras/wiki/Blocks-Coding-Guide#wiki-work-operation-modes , but so far my source only outputs zeros. An outline of my code is as follows: class constSource(gr.block): def __init__(self): gr.block.__init__(self, name = signal source, in_sig = None,out_sig = [numpy.complex64]) def work(self, input_items, output_items): num_output_items = len(output_items[0]) #I put the code to create what I want to stream here, the code creates a numpy.complex64 array with a length of 32. I then return num_output_items You didnt include the code, but I am guessing that you are not assigning anything to the output vector? numpy array assignment look like this output_items[0][some kind of index selection] = data Look closely at how the examples do this -josh return num_output_items I then write my constSource block to a file and I try to see the output of the file using a scope sink, but it is just a constant stream of zeros. Am ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Creating a signal source block using Python
That worked, thanks! On Thu, Jul 19, 2012 at 4:46 PM, Gerald Baier gerald.ba...@student.kit.eduwrote: I was trying that earlier, however, I get this error from my code output_items[0][:] = x #where x equals a numpy.complex64 array with a length of 32 ValueError: operands could not be broadcast together with shapes (4096) (32) Try something like: n_processed = len(x) output_items[0][:n_processed] = x return n_processed I hope that helps. -Gerald On Thu, Jul 19, 2012 at 2:44 PM, Josh Blum j...@ettus.com mailto: j...@ettus.com wrote: On 07/19/2012 11:28 AM, Anisha Gorur wrote: It works now, thanks! It was a combination of a couple dumb errors on my part. One last thing, I was wondering if there was a way to change the length of output_items[0]? It is 4096 by default I believe. Thanks, Anisha The item length is basically randomly decided by the scheduler. However, you call set_output_multiple(x) and you will be guaranteed to get x*N items where N is an integer. Also, you dont have to actually fill all items, just fill the number you plan to produce. -josh On Thu, Jul 19, 2012 at 2:13 PM, Josh Blum j...@ettus.com mailto:j...@ettus.com wrote: On 07/18/2012 11:32 AM, Anisha Gorur wrote: Hello All, I've been attempting to create my own source block in Python. I have been reading the blocks coding guide here: https://github.com/**guruofquality/grextras/wiki/** Blocks-Coding-Guide#wiki-work-**operation-modeshttps://github.com/guruofquality/grextras/wiki/Blocks-Coding-Guide#wiki-work-operation-modes , but so far my source only outputs zeros. An outline of my code is as follows: class constSource(gr.block): def __init__(self): gr.block.__init__(self, name = signal source, in_sig = None,out_sig = [numpy.complex64]) def work(self, input_items, output_items): num_output_items = len(output_items[0]) #I put the code to create what I want to stream here, the code creates a numpy.complex64 array with a length of 32. I then return num_output_items You didnt include the code, but I am guessing that you are not assigning anything to the output vector? numpy array assignment look like this output_items[0][some kind of index selection] = data Look closely at how the examples do this -josh return num_output_items I then write my constSource block to a file and I try to see the output of the file using a scope sink, but it is just a constant stream of zeros. Am __**_ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org mailto:Discuss-gnuradio@gnu.**orgDiscuss-gnuradio@gnu.org https://lists.gnu.org/mailman/**listinfo/discuss-gnuradiohttps://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering __**_ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/**listinfo/discuss-gnuradiohttps://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] Creating a signal source block using Python
Hello All, I've been attempting to create my own source block in Python. I have been reading the blocks coding guide here: https://github.com/guruofquality/grextras/wiki/Blocks-Coding-Guide#wiki-work-operation-modes, but so far my source only outputs zeros. An outline of my code is as follows: class constSource(gr.block): def __init__(self): gr.block.__init__(self, name = signal source, in_sig = None,out_sig = [numpy.complex64]) def work(self, input_items, output_items): num_output_items = len(output_items[0]) #I put the code to create what I want to stream here, the code creates a numpy.complex64 array with a length of 32. I then return num_output_items return num_output_items I then write my constSource block to a file and I try to see the output of the file using a scope sink, but it is just a constant stream of zeros. Am I missing a key part of creating a source block? Also, the reason I don't use a file source is that the stream I am trying to create is dependent upon the time of day, so pulling it from a file source will mean that it is delayed somewhat. I will eventually want to transmit this data as well, not just put it in a file sink. Thanks, Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Read/Write stream tags in Python
Thanks, this was a huge help! -Anisha On Fri, Jul 13, 2012 at 4:26 PM, Josh Blum j...@ettus.com wrote: Aha, I knew I had unit tests. Study these carefully: https://github.com/guruofquality/grextras/blob/master/python/qa_block_gateway.py#L104 And just for sanity, make sure that make test passed for you :-) -josh On 07/13/2012 01:20 PM, Anisha Gorur wrote: Also, I've been assuming that nitems_written/read is from gr_block_detail, and add_item_tag is from gr_block and that they have both been swigged, since you used them in your example. Is it possible that they haven't been? Thanks -Anisha On Fri, Jul 13, 2012 at 3:57 PM, Anisha Gorur at...@virginia.edu wrote: I don't think I'm writing the work function... def work(self, input_items, output_items): item_index = 1 #which output item gets the tag? offset = self.nitems_written(0) + item_index key = pmt.pmt_string_to_symbol(example_key) value = pmt.pmt_string_to_symbol(example_value) self.add_item_tag(0, offset, key, value) #call work function self.work(self.gr_vector_source_x_0, self.gr_file_sink_0) Error: AttributeError: 'gr_top_block_sptr' object has no attribute 'nitems_written' On Fri, Jul 13, 2012 at 3:25 PM, Josh Blum j...@ettus.com wrote: On 07/13/2012 12:08 PM, Anisha Gorur wrote: Thanks for the examples, I will definitely be looking into them! As for links, This one: http://gnuradio.org/cgit/jblum.git/log/?h=nextis broken, it comes from one of the blocks coding guide here: http://gnuradio.org/redmine/projects/gnuradio/wiki/BlocksCodingGuide/diff/2which i found really helpful. There was a lot of work in various branches off of gnuradio which I had merged into next. That branch is gone, and that work has been combined into the GrExtras project. The link and relevant coding guide was moved/updated: https://github.com/guruofquality/grextras/wiki I also had one more quick question, I'm getting this error: 'gr_top_block_sptr' object has no attribute 'add_item_tag', though I thought add_item_tag was inherited from gr_block. Thanks again! Not sure, you might send a code snippet. It looks like you are calling a method of the top block, and not from the block's work function? -josh On Fri, Jul 13, 2012 at 2:40 PM, Josh Blum j...@ettus.com wrote: On 07/13/2012 10:08 AM, Anisha Gorur wrote: Thanks! Do you by any chance have links to specific code examples that could help out? I've been trying to look at old examples you have posted to others on this forum, however, some of the links from github seem to be broken. Well, I dont have an example from python, but its just the same thing without semicolons. So this should be very helpful: http://gnuradio.org/cgit/gnuradio.git/tree/gr-uhd/examples/c++/ Let me know if the links are bad on one of my wiki pages. At least I can fix those :-) -josh On Fri, Jul 13, 2012 at 12:52 PM, Josh Blum j...@ettus.com wrote: On 07/13/2012 08:51 AM, Anisha Gorur wrote: Hello all, I've been trying to work with stream tags in python, mainly using the grextras blocks coding guide here:https://github.com/guruofquality/grextras/wiki/Blo... https://github.com/guruofquality/grextras/wiki/Blocks-Coding-Guide#wiki-the-work-function . I've set up a very simple flow graph, just a vector source, throttle and file sink, and I would like to place a tag on the first element of the vector that contains time metadata. I'm using this code: def work(self, input_items, output_items): item_index = ? #which output item gets the tag? set item_index to x so the tag gets associated with outputs_items[0][x] offset = self.nitems_written(0) + item_index key = pmt.pmt_string_to_symbol(example_key) value = pmt.pmt_string_to_symbol(example_value) #write at tag to output port 0 with given absolute item offset self.add_item_tag(0, offset, key, value) I think the problem has something to do with not implementing the correct modules. My question is, what are the appropriate modules to import to read and write stream tags in python? You might want to look more that that coding guide, at lot of the snippets are just work functions, but many contain full class definitions with import statements. For example: from gnuradio import gr import gnuradio.extras class my_sync_block(gr.block): def __init__(self, args): gr.block.__init__(self, name=my block, in_sig=[numpy.int32], out_sig=[numpy.int32]) def work(self, input_items, output_items): #work stuff... return len(output_items[0]) -josh ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012
[Discuss-gnuradio] Read/Write stream tags in Python
Hello all, I've been trying to work with stream tags in python, mainly using the grextras blocks coding guide here:https://github.com/guruofquality/grextras/wiki/Blo... https://github.com/guruofquality/grextras/wiki/Blocks-Coding-Guide#wiki-the-work-function. I've set up a very simple flow graph, just a vector source, throttle and file sink, and I would like to place a tag on the first element of the vector that contains time metadata. I'm using this code: def work(self, input_items, output_items): item_index = ? #which output item gets the tag? offset = self.nitems_written(0) + item_index key = pmt.pmt_string_to_symbol(example_key) value = pmt.pmt_string_to_symbol(example_value) #write at tag to output port 0 with given absolute item offset self.add_item_tag(0, offset, key, value) I think the problem has something to do with not implementing the correct modules. My question is, what are the appropriate modules to import to read and write stream tags in python? Thank You, -Anisha ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Read/Write stream tags in Python
Thanks! Do you by any chance have links to specific code examples that could help out? I've been trying to look at old examples you have posted to others on this forum, however, some of the links from github seem to be broken. On Fri, Jul 13, 2012 at 12:52 PM, Josh Blum j...@ettus.com wrote: On 07/13/2012 08:51 AM, Anisha Gorur wrote: Hello all, I've been trying to work with stream tags in python, mainly using the grextras blocks coding guide here:https://github.com/guruofquality/grextras/wiki/Blo... https://github.com/guruofquality/grextras/wiki/Blocks-Coding-Guide#wiki-the-work-function . I've set up a very simple flow graph, just a vector source, throttle and file sink, and I would like to place a tag on the first element of the vector that contains time metadata. I'm using this code: def work(self, input_items, output_items): item_index = ? #which output item gets the tag? set item_index to x so the tag gets associated with outputs_items[0][x] offset = self.nitems_written(0) + item_index key = pmt.pmt_string_to_symbol(example_key) value = pmt.pmt_string_to_symbol(example_value) #write at tag to output port 0 with given absolute item offset self.add_item_tag(0, offset, key, value) I think the problem has something to do with not implementing the correct modules. My question is, what are the appropriate modules to import to read and write stream tags in python? You might want to look more that that coding guide, at lot of the snippets are just work functions, but many contain full class definitions with import statements. For example: from gnuradio import gr import gnuradio.extras class my_sync_block(gr.block): def __init__(self, args): gr.block.__init__(self, name=my block, in_sig=[numpy.int32], out_sig=[numpy.int32]) def work(self, input_items, output_items): #work stuff... return len(output_items[0]) -josh ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Read/Write stream tags in Python
I don't think I'm writing the work function... def work(self, input_items, output_items): item_index = 1 #which output item gets the tag? offset = self.nitems_written(0) + item_index key = pmt.pmt_string_to_symbol(example_key) value = pmt.pmt_string_to_symbol(example_value) self.add_item_tag(0, offset, key, value) #call work function self.work(self.gr_vector_source_x_0, self.gr_file_sink_0) Error: AttributeError: 'gr_top_block_sptr' object has no attribute 'nitems_written' On Fri, Jul 13, 2012 at 3:25 PM, Josh Blum j...@ettus.com wrote: On 07/13/2012 12:08 PM, Anisha Gorur wrote: Thanks for the examples, I will definitely be looking into them! As for links, This one: http://gnuradio.org/cgit/jblum.git/log/?h=nextis broken, it comes from one of the blocks coding guide here: http://gnuradio.org/redmine/projects/gnuradio/wiki/BlocksCodingGuide/diff/2which i found really helpful. There was a lot of work in various branches off of gnuradio which I had merged into next. That branch is gone, and that work has been combined into the GrExtras project. The link and relevant coding guide was moved/updated: https://github.com/guruofquality/grextras/wiki I also had one more quick question, I'm getting this error: 'gr_top_block_sptr' object has no attribute 'add_item_tag', though I thought add_item_tag was inherited from gr_block. Thanks again! Not sure, you might send a code snippet. It looks like you are calling a method of the top block, and not from the block's work function? -josh On Fri, Jul 13, 2012 at 2:40 PM, Josh Blum j...@ettus.com wrote: On 07/13/2012 10:08 AM, Anisha Gorur wrote: Thanks! Do you by any chance have links to specific code examples that could help out? I've been trying to look at old examples you have posted to others on this forum, however, some of the links from github seem to be broken. Well, I dont have an example from python, but its just the same thing without semicolons. So this should be very helpful: http://gnuradio.org/cgit/gnuradio.git/tree/gr-uhd/examples/c++/ Let me know if the links are bad on one of my wiki pages. At least I can fix those :-) -josh On Fri, Jul 13, 2012 at 12:52 PM, Josh Blum j...@ettus.com wrote: On 07/13/2012 08:51 AM, Anisha Gorur wrote: Hello all, I've been trying to work with stream tags in python, mainly using the grextras blocks coding guide here:https://github.com/guruofquality/grextras/wiki/Blo... https://github.com/guruofquality/grextras/wiki/Blocks-Coding-Guide#wiki-the-work-function . I've set up a very simple flow graph, just a vector source, throttle and file sink, and I would like to place a tag on the first element of the vector that contains time metadata. I'm using this code: def work(self, input_items, output_items): item_index = ? #which output item gets the tag? set item_index to x so the tag gets associated with outputs_items[0][x] offset = self.nitems_written(0) + item_index key = pmt.pmt_string_to_symbol(example_key) value = pmt.pmt_string_to_symbol(example_value) #write at tag to output port 0 with given absolute item offset self.add_item_tag(0, offset, key, value) I think the problem has something to do with not implementing the correct modules. My question is, what are the appropriate modules to import to read and write stream tags in python? You might want to look more that that coding guide, at lot of the snippets are just work functions, but many contain full class definitions with import statements. For example: from gnuradio import gr import gnuradio.extras class my_sync_block(gr.block): def __init__(self, args): gr.block.__init__(self, name=my block, in_sig=[numpy.int32], out_sig=[numpy.int32]) def work(self, input_items, output_items): #work stuff... return len(output_items[0]) -josh ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Anisha Gorur Class of 2012 Electrical Engineering ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio