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

2 visualizaciones (últimos 30 días)
[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 ??

Respuestas (2)

Walter Roberson
Walter Roberson el 16 de Jun. de 2011
Change
seridata = rand ( 1, para*nd*ml)>0.5 ;
to
seridata = 0 + rand ( 1, para*nd*ml)>0.5 ;
  1 comentario
Swapna Iyer
Swapna Iyer el 16 de Jun. de 2011
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)

Iniciar sesión para comentar.


Yella
Yella el 16 de Jun. de 2011
>> 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 comentarios
Yella
Yella el 16 de Jun. de 2011
Ms Swapna which version of matlab r u using?

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by