我目前正在实施具有残余载波的相位调制方案。该调制方案主要用于深空通信。我已经推导出I-Q组件如下
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 Radio中的代码。不幸的是,每当我将输入数据分配给[i]到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
答案 0 :(得分:0)
I found out the problem was with the gnuradio flowgraph I was using to test the code. Basically one of the blocks was generating numbers in the order of 10^34. That is what caused the crashes. Otherwise, the phase modulation block is working as expected –