gnuradio模块分类

本文介绍了Gnuradio中sync模块和general模块的工作原理,强调了输入输出比例、set_history方法的使用,以及consume和produce在模块操作中的作用。通过实例解释了如何处理不同输入输出比的情况,并对比了tag类型模块的驱动方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

sync_XXX

很简单,输入输出比固定,不需要做consume和produce。可以调用set_history(TAPS_LEN);  来输入历史数据,类似fir。

source:1 2 3 4 5 6 7 8 9 10

noutput=5

则第一次输入:12345

set_history(2)

则得二次输入为

56789

第三次输入为

678910


若set_history(1)//默认值

则第二次输入为

6 7 8 9 10




#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <gnuradio/io_signature.h>
#include "bin2dec_bb_impl.h"

namespace gr {
    namespace dab {

        bin2dec_bb::sptr
        bin2dec_bb::make(uint32_t k)
        {
            return gnuradio::get_initial_sptr
                (new bin2dec_bb_impl(k));
        }

        /*
         * The private constructor
         */
        bin2dec_bb_impl::bin2dec_bb_impl(uint32_t k)
            : gr::sync_decimator("bin2dec_bb",
                    gr::io_signature::make(1, 1, sizeof(uint8_t)),
                    gr::io_signature::make(1, 1, sizeof(uint8_t)), k),
            d_k(k)
        {
            if (d_k == 0) {
                throw std::out_of_range("interpolation must be > 0");
            }
        }

        /*
         * Our virtual destructor.
         */
        bin2dec_bb_impl::~bin2dec_bb_impl()
        {
        }

        int
        bin2dec_bb_impl::work(int noutput_items,
                gr_vector_const_void_star &input_items,
                gr_vector_void_star &output_items)
        {
            const uint8_t *in = (const uint8_t *) 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值