i am writing a code for ofdm generation, and I have a question regarding the same

5 次查看(过去 30 天)
[EDIT: 20110615 22:33 CDT - reformat - WDR]
after these lines
clear all;close all;echo off;tic;
clc;
para=128;
fftlen = 128 ;
noc = 128;
nd = 6 ;
ml = 2 ;
sr = 250000 ;
br = sr .* ml ;
gilen= 32;
ebn0 = 10;
nloop = 100;
noe = 0;
nod = 0 ;
eop = 0 ;
nop = 0;
Y2 = zeros(para,1);
%h = modem.pskmod (4,0);
seridata = rand ( 1, para*nd*ml)>0.5 ;
paradata = reshape( seridata, para,nd*ml)
x=paradata(1,:)
%in = mat2str(x)
%paradata(1,:)
h = modem.qammod(16);
y2= modulate(h,x)
i get an error
??? Undefined function or method 'ceil' for input arguments of type 'logical'.
_**Error in ==> modem.abstractMod.checkModInput at 13
if isempty(x) || ~isreal(x) || any(any(ceil(x) ~= x)) ...
Error in ==> modem.abstractMod.modulate at 10
checkModInput(h, x);
Error in ==> ofdmbook at 36
y2= modulate(h,x)**
Can someone please tell me what is wrong with my code ??

回答(2 个)

Walter Roberson
Walter Roberson 2011-6-16
Change
seridata = rand ( 1, para*nd*ml)>0.5 ;
to
seridata = 0 + rand ( 1, para*nd*ml)>0.5 ;
  1 个评论
Swapna Iyer
Swapna Iyer 2011-6-16
thanks . I changed it. But I am still getting this error :
??? Undefined function or method 'ceil' for input arguments of type 'logical'.
Error in ==> modem.abstractMod.checkModInput at 13
if isempty(x) || ~isreal(x) || any(any(ceil(x) ~= x)) ...
Error in ==> modem.abstractMod.modulate at 10
checkModInput(h, x);
Error in ==> ofdmbook at 36
y2= modulate(h,x)

请先登录,再进行评论。


Yella
Yella 2011-6-16
>> h = modem.qammod(16); >> h
h =
Type: 'QAM Modulator'
M: 16
PhaseOffset: 0
Constellation: [1x16 double]
SymbolOrder: 'Binary'
SymbolMapping: [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
InputType: 'Integer'
h isnt a matrix of values its just information of the modem. I think h is a transfer function(channel coefficients). i would suggest u first to modulate the input X = qammod(x,16) and convolute the 'h' with 'X' to get the tranmitter data.
  3 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Modulation 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by