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

3 ビュー (過去 30 日間)
Swapna Iyer
Swapna Iyer 2011 年 6 月 16 日
[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?
Yella
Yella 2011 年 6 月 16 日
What about BPSK and QPSK?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeOFDM についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by