|
From: | Gilad Beeri (ApolloShield) |
Subject: | Re: [Discuss-gnuradio] How to write data periodically in file sink |
Date: | Sat, 20 May 2017 07:09:59 +0000 |
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=1tb.start()while (count<5):time.sleep(1.0) #data is recorded in the filetb.lock()tb.disconnect((tb.uhd_usrp_source_0,0),(tb.blocks_file_sink_0, 0)) #disconnect source and blocktb.blocks_file_sink_0= blocks.file_sink(gr.sizeof_gr_complex*1, filename,False) # create new file sink to writetb.connect((tb.uhd_usrp_source_0,0),(tb.blocks_file_sink_0, 0)) #connect source with new filecount=count+1time.sleep(2.0) #waittb.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 <address@hidden> 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.
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 list address@hidden https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Prev in Thread] | Current Thread | [Next in Thread] |