Hey Henry,
I'm forwarding this to the mailing list, so that others can have a look at it 
as well!
Let me quickly address a few things:

On 08.08.23 21:32, Henry Powell wrote:
The flow graph starts. I collect data and save it to a file with file_sink. I read the file and get the maximum value from the file (differently, I can do this with keep 1 in n, but I would be happy if we proceed through the current situation), then I am saving the maximum value in a list from the data I have saved in the file. I reset the file with the file_sink open and close commands.

Interesting! How do you know when to open / close? I ask because this sounds a bit difficult, as, depending on the blocks with which you capture and process your data, there might still be samples "in flight" after your collection finishes.

I repeat this maybe 2000 times, varying from measurement to measurement. After recording all the maximum values in a list, the flow graph terminates itself.

Writing data to a file and reading from there makes me lose speed. I am looking for an alternative solution to it.

Ah, what about this concept:

                                   ┌───────────┐
  ┌────────────┐    ┌──────────┐   │Make Chunks│    ┌─────────┐    ┌──────┐    
┌─────────┐
  │            │    │          │   │of constant│    │Find max-│    │ Head │    
│         │
  │Data Capture│───►│Processing│──►│ "single-  │───►│imum per │───►│      
│───►│File Sink│
  │            │    │          │   │experiment"│    │  chunk  │    │N=2000│    
│         │
  └────────────┘    └──────────┘   │   size    │    └─────────┘    └──────┘    
└─────────┘
                                   └───────────┘


Instead of "taking the data out of GNU Radio" in an asynchronous manner, you could look for the maximum within the framework of GNU Radio itself. That solves all the file handling overhead.

You can also still save all your experimental data to a file for later analysis (just add *another* File Sink, after "Processing" in parallel with "Make Chunks…").

If you're saying that I can do it with a vector sink block, I'm trying it right now. I will let you know the results tomorrow.

Well, the Vector Sink would be easier than the File Sink, but as sketched above I think a different solution might be preferable.

Thank you for your reply. Have a nice day.
You have good days, as well!

Marcus

Marcus Müller <mmuel...@gnuradio.org <mailto:mmuel...@gnuradio.org>>, 8 Ağu 2023 Sal, 11:55 tarihinde şunu yazdı:

    Hi Henry,

    that sounds like the description of the Vector Sink block!

    But in all honesty, maybe you want to take a different approach altogether; 
really
    depends
    on when during the life cycle of a flow graph you need that data. Could you 
maybe
    describe
    how often and when you want to get data from your GNU Radio flowgraph?

    Best regards,
    Marcus

    On 08.08.23 07:26, Henry Powell wrote:
     > Hello, at the end of my grc I use file sink and then, I read the data 
from the file. I
     > repeat this process so many times. My problem is that writing to files 
and reading
    from
     > them takes too much time, approximately 120ms. I know this does not seem 
too much but
     > for my application it's too much. So, I want to append data to a list 
and get from
    there.
     >
     > I tried writing an embedded python block via this link:
     > https://wiki.gnuradio.org/index.php/Embedded_Python_Block
    <https://wiki.gnuradio.org/index.php/Embedded_Python_Block> but i failed.
     >  Is there any example embedded python block you wrote about before? Or a 
different
    solution?
     >
     > If you can help me, I would really appreciate it.


Reply via email to