我目前正在用剩余载波实现相位调制方案。该调制方案主要应用于深空通信中。我已经导出了如下的I组件
I(t) = Power_total * sin(h) * d(t)
Q(t) = -1 * Power_total * cos(h)
其中h是调制方案,d(t)是输入数据(比特流)。注意,当h= 90度时,我们有一个抑制载波a.k.a BPSK的相位调制方案。调制指数决定剩余载波和数据载波之间如何共享功率。这就简化了同步,因为接收机可以跟踪剩余的未调制载波。
下面是我在GNU电台的代码。不幸的是,每当我将输入数据ini分配给oi和oq (数据和剩余载波组件的同相和正交因子)时,这段代码就会崩溃。任何建议,参考或链接,可以帮助我消除这个问题,将非常感谢。提前谢谢。
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gnuradio/io_signature.h>
#include "phase_mod_impl.h"
#include <gnuradio/sincos.h>
#include <math.h>
namespace gr {
namespace GS {
phase_mod::sptr
phase_mod::make(float mod_index)
{
return gnuradio::get_initial_sptr
(new phase_mod_impl(mod_index));
}
/*
* The private constructor
*/
phase_mod_impl::phase_mod_impl(float mod_index)
: gr::sync_block("phase_mod",
gr::io_signature::make(1, 1, sizeof(float)),
gr::io_signature::make(1, 1, sizeof(gr_complex))),
h(mod_index)
{}
/*
* Our virtual destructor.
*/
phase_mod_impl::~phase_mod_impl()
{
}
int
phase_mod_impl::work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
gr_complex *out = (gr_complex *) output_items[0];
// Do <+signal processing+>
for(int i = 0; i < noutput_items; i++) {
float oq, oi;
gr::sincosf(h,&oi, &oq);
oi *= in[i];
oq *= -1;
out[i] = gr_complex(oi,oq);
}
// Tell runtime system how many output items we produced.
return noutput_items;
}
/*
} /* namespace GS */
} /* namespace gr */code here发布于 2017-06-09 12:51:48
我发现问题出在我用来测试代码的gnuradio流程图上。基本上,其中一个块是按10^34的顺序生成数字。这就是造成撞车的原因。否则,相位调制块将按预期工作-
https://stackoverflow.com/questions/44436132
复制相似问题