Hi John - There aren't a lot of choices to do clipping; this is basically: {{{ float* in = (float*) INPUT; float* out = (float*) OUTPUT; for(int nn=0; nn<NUMBER; ++nn) { *out++ = std::max(std::min(*in++, 1.0),-1.0); } }}}
You could use Volk's "volk_32f_x2_max_32f" and "volk_32f_x2_min_32f" kernel < http://libvolk.org/doxygen/volk_32f_x2_max_32f.html > & < http://libvolk.org/doxygen/volk_32f_x2_min_32f.html >, which would auto-magically handle the whole loop for you. Maybe someone else can come up with a good reference for a branchless version of this? Hope this helps! - MLD On Mon, Apr 6, 2015, at 08:25 PM, John Malsbury wrote: > This may be more of a general C++ question than a GNU Radio > question... Is there any super convenient and fast way to clip a > complex signal to +/- 1.0 on both I & Q? Something other than > splitting them up into floats and using branchless_clip or if > statements? _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio