If you need accuracy, I think the asynchronous nature of your method might problematic (will appreciate input from GR devs). Maybe try a different approach - write the samples to a memory buffer, then read from the buffer the exact # of samples you want to write to a file.
On Fri, May 19, 2017 at 5:02 PM Deepak Gautam <dpaak...@gmail.com> wrote: > Dear luca, > > I had already tried with controlling flow graph dynamically using start(), > stop(), lock(), unlock() function. Here i have the part of code i had used. > > tb=top_block_cls() > count=1 > tb.start() > while (count<5): > time.sleep(1.0) #data is recorded in the file > tb.lock() > tb.disconnect((tb.uhd_usrp_source_0,0),(tb.blocks_file_sink_0, 0)) > #disconnect source and block > tb.blocks_file_sink_0= blocks.file_sink(gr.sizeof_gr_complex*1, > filename,False) # create new file sink to write > tb.connect((tb.uhd_usrp_source_0,0),(tb.blocks_file_sink_0, 0)) > #connect source with new file > count=count+1 > time.sleep(2.0) #wait > tb.unlock() > tb.stop() > > > This program should write the data for 1 second in the file, wait for 2 > second and again write for 1 second to another file and so on for 5 4 > times. I expect the total data written in the file to be same. But total > number of samples recorded in the files are different. for my sampling rate > of 25MSps, it should record 25MS per file, but it is around 22Mega sample > with different number of data in different file. So it is difficult to > reproduce the accurate signal from received data . My application requires > very good phase coherence. So i am wondering whether there is something to > do to solve in this method or i have to think of another idea. > > > Best Regards, > Deepak > > > > On Mon, May 15, 2017 at 9:02 PM Moritz Luca Schmid < > luca.moritz.sch...@gmail.com> wrote: > >> Hey Deepak, >> >> my first idea is to reconfigure the flowgraph. You could connect and >> disconnect your source for the time, you want to write data in your file >> sink and the time you don't want to. >> >> You can find infos about the flowgraphs operations here >> <https://gnuradio.org/doc/doxygen/page_operating_fg.html>. >> >> >> Best >> >> Luca >> >> >> >> On 15.05.2017 13:53, Deepak Gautam wrote: >> >> Currently i am working in the USRP using GNU Radio for my masters work. >> In my transmitter side, i send data continuously from file source followed >> by UHD Sink at the rate of 25 MSPS. In receiver side, I want to write the >> data in every two/three seconds after receiving from receiver USRP. >> Meaning, write data for 1 sec (25M samples), then dont write for next 2 >> second and again write for 1 sec and so on. Is there any suggestion for >> this purpose. I look forward for the resposne >> >> >> Best Regards, >> Deepak >> >> >> _______________________________________________ >> Discuss-gnuradio mailing >> listDiscuss-gnuradio@gnu.orghttps://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