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

조회 수: 2 (최근 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
Yella
Yella 2011년 6월 16일
Ms Swapna which version of matlab r u using?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 OFDM에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by