Marcus Leech wrote: > Here's a snippet of code that is a modified version of > gr_probe_avg_mag_sqrd_c.cc: > > ... >
Your code looks reasonable, but before you go writing C++ blocks, I would try to do what you want with what is already there. The reality is that the gr_probe_avg_mag_sqrd is rather specialized, and not really necessary. Here's what I would do. 1) usrp source complex to gr_complex_to_float to split the I and Q 2) i channel to both inputs of gr_mult_ff to square them 3) do the same for q 4) outputs from the two gr_mult_ff blocks to a gr_add_ff block You now have instantaneous power. I would filter how you like, probably starting with a gr_fir_filter_f. Pick a relatively high decimation ratio, M, like 256. There should be M taps in the filter, each of value 1/M. This will do an integrate and dump to get you to a lower sample rate. If you have any interfering signals, you have to remove them by filtering before step 1 above. That is also where you'd tap off if you wanted to do an FFT or waterfall display. If, after all this, you find that it doesn't run fast enough, then you can look into writing your own blocks. I think you'll find that unnecessary, though. Matt _______________________________________________ Discuss-gnuradio mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
