Skip to main content
11 events
when toggle format what by license comment
Mar 15, 2022 at 10:15 comment added Marcus Müller you mustn't do that! Your np.mean depends on the length of input_items, and that will be different every call. So, this is not the way to go. I don't think this will all fit in the comments here. Would you mind writing an email to the [email protected] mailing list, with your block code (and because people won't know what we discussed here, a short description of what you want to do!)?
Mar 15, 2022 at 9:50 comment added aheuchamps Hello @MarcusMüller. I am coming back to you because it has been one week now and I still did not manage to write the blocks to make what I want. I have written a block cmp_avg_pow which work function computes output_items[0][:] = np.mean( input_items ) (np being short for numpy) and another block, custom_thres which work function just make output_items[0][:] = blocks.threshold_ff(0.0, input_items[-1], 0). In my main function, I connect complex_to_mag_squared blocks to both cmp_avg_pow and custom_thres, and the output of cmp_avg_pow also to custom_thres. Nice day,Alex
Mar 8, 2022 at 9:41 comment added aheuchamps Okay will do, thank you
Mar 8, 2022 at 9:39 comment added Marcus Müller I already answered that. You need to write a block.
Mar 8, 2022 at 9:38 comment added aheuchamps @MarcusMüller oh okay I thought it was like that I had to do. I am going to search how to access the value rather than access the whole block. Thank you for your answer :D
Mar 8, 2022 at 9:36 comment added Marcus Müller you did not print values, you printed a block. Not how GNU Radio works! The samples are not available at the level where you construct the flow graph – you only interact with them using blocks. So, you need to write a block. tutorials.gnuradio.org has a good introduction to doing that :)
Mar 8, 2022 at 9:36 comment added aheuchamps @MarcusMüller I tried to just print the values given by the complex_to_mag_squared block, and was expecting to see some float values. Insted, I got something like this all_cmpl_to_mag2[0] = <gr_block complex_to_mag_squared (4)>. I do not understand how to get the value from there ?
Mar 8, 2022 at 9:20 comment added aheuchamps Thank you for your answer @MarcusMüller, I will try by simple connection. Have a nice day, Alex
Mar 8, 2022 at 9:15 comment added Marcus Müller There's nothing to "retrieve" - they just output magnitude squares on their output. You connect your block to that.
S Mar 8, 2022 at 9:00 review First questions
Mar 8, 2022 at 12:24
S Mar 8, 2022 at 9:00 history asked aheuchamps CC BY-SA 4.0