12-17-2012 09:10 AM
Hi, everyone, how can I clear the usrp buffer before I read it ? is there any VI or command ?
Solved! Go to Solution.
12-17-2012 09:24 AM
Can you explain what you mean by 'buffer clear'? Are you seeing some behavior you are trying to change?
12-17-2012 06:59 PM
Sorry for my careless, I didn't state my question clearly. As we know, the AD of the receiver will store the data into the usrp buffer continuously once the receiver is initialized. The buffer will save much data we do not want to process as we know when our signal will be transmitted. The unwanted noise data in the buffer will lead to process delay of our communication system(Our communication system is the transmitter will send next packet until receive the ack from the receiver). So we want to clear the buffer of usrp, before we read it . If I do not make the qestion clearly, please let me know , thanks.
12-17-2012 10:45 PM - edited 12-17-2012 10:47 PM
The USRP does not have an onboard buffer. Perhaps what you are looking for is a good energy detecting trigger. The following VI uses a very good, simple, energy level trigger: https://decibel.ni.com/content/docs/DOC-23285
The trigger is shown in the top left corner of figure 7 (a small whilte loop nested in a larger while loop). It triggers on energy with a known packet length and can even connect to buffers together if the trigger happens too close to the end of the first fetch buffer. The number of total samples to acquire should be set to about 110% of the number of samples in your know packet length.
(also, this trigger only triggers off of the first channel in the MIMO setup, so it can be extracted and reused with very minor modification for SISO systems.)
Erik
12-17-2012 11:07 PM
Here is the same code modified for the single channel case.
12-17-2012 11:16 PM
Hi ErikL , are you sure the usrp do not have on onboard buffer( or memory) ? So whether the receiver will acquire data from the radio frontend continuously once the receiver is initialized ? If I do not read the data, where the data will go ?
We have done an experiment, which include three part: part A will send a packet on channel 915Mhz instantly once it receive an ack from part C on channel 1Ghz, and part B receieve data of part A on channel 915Mhz . Part C send the ack very quickly, and part A send the packet quickly too. We start the three parts at the same time, but we stop part A and part C first , and we observed part B will continouse to process the valid packets for a long time after we stop part A, C. Because of part B process delay, the data read from the buffer is slowly, and all the data from part A have stored into the buffer( or memory), so in my opinion , the buffer should be exist.
Ps : thank for your recommend about the energy detecting trigger, we have use it to detect the signal.
12-17-2012 11:21 PM
12-17-2012 11:58 PM
We want to find the most efficient method to clear the buffer before we want to fetch the data through usrp vi, so we can process the newly data instantly. Whether can we fetch the all data in buffer once a time ? how can ? To give a large number for NI usrp fetch rx data Vi ? how large ?
You mentioned the queue way , but it may also take much cpu resources to fetch the data into queue, and may lead to the process delay of our packet demodulation.
whether there is a way to clear the buffer in the pc in the NI-USRP drive ?
thanks
12-18-2012 07:09 AM
The USRP uses the concept of a timed start to allow syncronized or specified time start of acquistions. You can use the the VI's with the green play arrow and red stop square to start and stop acquistions and the timing VI to specificy start time. The Fetch VI will then block until the specified time is reached.
12-18-2012 09:36 AM
Hi, ErikL, I am sorry , I didn't see "VI's with the green play arrow and red stop square to start and stop acquistions and the timing VI to specificy start time" and I also didn't know how to block the Fetch data VI . can you give some example ? thank you very much !