【问题标题】:Need help using PSKMOD在使用 PSKMOD 时需要帮助
【发布时间】:2015-04-10 05:08:35
【问题描述】:
M = 2; %Modulation order
imdata = imread('http://openvip.sourceforge.net/userdoc/lena_grayscale.jpg'); 
bdata = de2bi(imdata);        
sizec = size(bdata,1);         
sizer = size(bdata,2);         
nbits = sizec*sizer;            
msg = reshape(bdata,nbits,1);
txpsk = pskmod(msg,M);

上面的代码给出了以下错误。需要帮助修复以下错误

??? Error using ==> mtimes
Complex integer arithmetic is not supported.

Error in ==> pskmod at 101
y = exp(j*(theta + ini_phase));

【问题讨论】:

    标签: matlab signal-processing communication digital


    【解决方案1】:

    只需将行 msg = reshape(bdata,nbits,1) 更改为 msg = double(reshape(bdata,nbits,1)); 。它会起作用的。如果您需要更多说明,请询问我,我会向您解释。

    【讨论】:

    • 你能解释一下为什么我们需要使用double吗?
    • 每当您在 matlab 中读取图像时,它都会根据图像采用 uint8 或 uint16。但是在 pskmod 函数中,第 101 行它创建了需要数据类型为 theta 的双精度数的复数。这样会出错。
    猜你喜欢
    • 2018-10-21
    • 2017-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多