Forums

need help about rayleigh fading

Started by "n.mie_arul" February 11, 2008
hi everyone..now i started my last year project about Rayleigh Fading
using OFDM system..i have a problem when using QPSK modulation..Below
is a my coding..anybody know how to solve this prob??
%******************* Preparation Part*****************************
para8; % Number of parallel channel to transmit
fftlen8; % FFT length
noc8; % Number of carrier
nd=6; % Number of information ODFM symbol for one loop
ml=2; % modulation level : QPSK
sr%0000; % symbol rate (kbps)
br=sr.*ml; % Bit rate per carrier
gilen2; % Length of guard interval (points)
ebn0; % Eb/No

%******************* Fading Initialization**************************

% if you use fading function "sefade", you can initialize all of the
% parameters.
%Otherwise you can comment out the following initialization.
tstp=1/sr/(fftlen+gilen); % Time resolution

%Arrival time for each multipath normalized bt tstp
%if you would like to simulate under 4 path fading model,we have only
to
%set direct wave.
itau = [0,2,3,4];

%Mean power for each multipath normalized by direct wave.
%If you would like to simulate under 4 path fading model,you have
only to
%set direct wave.
d1v1 = [0,10,20,25];
%Number of wave to generates fading for each multipath.
%In normal case,more than (minimun) six wave are needed to generates
Rayleigh fading
n0=[6,7,6,7];

%Initial phase of delayed wave
%In this simulation four path Rayleigh fading is considered.
th1=[0.0,0.0,0.0,0.0];

%Number of fading counter to skip
itnd0=nd*(fftlen+gilen)*10;

%Initial value of fading counter
%In this simulation four-path Rayleigh fading is considered.
%Therefore four fading counter is needed.
itnd1=[1000,2000,3000,4000];
%Number of direct wave + Number of delayed wave.
%In this simulation four-path Rayleigh fading is considered
now1=4;

%Maximum Doppler frequency [Hz]
%You can insert any favorite value.
fd20;
% you can decide two modes to simulate fading by changing the
variable flat
%flat : flat fading or not
%(1-flat (only amplitudes is fluctuated),0- normal (phase and
amplitude are
%flutuated))
flat=1;

%************************ main loop part****************************

nloopP0; % number of simulation loop
noe=0; % Number of error data
nod=0; % number of tranmitted data
eop=0; % number of error packet
nop=0; % number of tranmitted packet

for i = 1:nloop;
end

%************************ Tranmitter Stage***************************

%************************* Data Generation***************************

seldata=rand(1,para*nd*ml) > 0.5; % rand : built in function

%***********************Serial to parallel conversion*****************

paradata=reshape(seldata,para,nd*ml); % reshape : built in function

%************************* QPSK modulation****************************
[ich,qch] = qpskmod(paradata,para,nd,ml);
kmod=1/sqrt(2); % sqrt:built in function
ich1=ich.*kmod;
qch1=qch.*kmod;
the error displays '??? Undefined function or method 'qpskmod' for
input arguments of type 'double'.

Error in ==> psm at 93
[ich,qch]= qpskmod(paradata,para,nd,ml);'
how to solve this trouble?? i dont know how this meaning..tq
Dear Arul

As far as I know there is no inbuilt function named 'qpskmod' in matlab....
Please check the help files......
I may be wrong as I am not aware of the latest versions..........

*If the inbuilt function is not available then please define "qpskmod"
function ? *

Regards
Prajit s Nair

On Feb 12, 2008 1:30 AM, n.mie_arul wrote:

> hi everyone..now i started my last year project about Rayleigh Fading
> using OFDM system..i have a problem when using QPSK modulation..Below
> is a my coding..anybody know how to solve this prob??
>
> %******************* Preparation Part*****************************
> para8; % Number of parallel channel to transmit
> fftlen8; % FFT length
> noc8; % Number of carrier
> nd=6; % Number of information ODFM symbol for one loop
> ml=2; % modulation level : QPSK
> sr%0000; % symbol rate (kbps)
> br=sr.*ml; % Bit rate per carrier
> gilen2; % Length of guard interval (points)
> ebn0; % Eb/No
>
> %******************* Fading Initialization**************************
>
> % if you use fading function "sefade", you can initialize all of the
> % parameters.
> %Otherwise you can comment out the following initialization.
> tstp=1/sr/(fftlen+gilen); % Time resolution
>
> %Arrival time for each multipath normalized bt tstp
> %if you would like to simulate under 4 path fading model,we have only
> to
> %set direct wave.
> itau = [0,2,3,4];
>
> %Mean power for each multipath normalized by direct wave.
> %If you would like to simulate under 4 path fading model,you have
> only to
> %set direct wave.
> d1v1 = [0,10,20,25];
>
> %Number of wave to generates fading for each multipath.
> %In normal case,more than (minimun) six wave are needed to generates
> Rayleigh fading
> n0=[6,7,6,7];
>
> %Initial phase of delayed wave
> %In this simulation four path Rayleigh fading is considered.
> th1=[0.0,0.0,0.0,0.0];
>
> %Number of fading counter to skip
> itnd0=nd*(fftlen+gilen)*10;
>
> %Initial value of fading counter
> %In this simulation four-path Rayleigh fading is considered.
> %Therefore four fading counter is needed.
> itnd1=[1000,2000,3000,4000];
>
> %Number of direct wave + Number of delayed wave.
> %In this simulation four-path Rayleigh fading is considered
> now1=4;
>
> %Maximum Doppler frequency [Hz]
> %You can insert any favorite value.
> fd20;
>
> % you can decide two modes to simulate fading by changing the
> variable flat
> %flat : flat fading or not
> %(1-flat (only amplitudes is fluctuated),0- normal (phase and
> amplitude are
> %flutuated))
> flat=1;
>
> %************************ main loop part****************************
>
> nloopP0; % number of simulation loop
> noe=0; % Number of error data
> nod=0; % number of tranmitted data
> eop=0; % number of error packet
> nop=0; % number of tranmitted packet
>
> for i = 1:nloop;
> end
>
> %************************ Tranmitter Stage***************************
>
> %************************* Data Generation***************************
>
> seldata=rand(1,para*nd*ml) > 0.5; % rand : built in function
>
> %***********************Serial to parallel conversion*****************
>
> paradata=reshape(seldata,para,nd*ml); % reshape : built in function
>
> %************************* QPSK modulation****************************
> [ich,qch] = qpskmod(paradata,para,nd,ml);
> kmod=1/sqrt(2); % sqrt:built in function
> ich1=ich.*kmod;
> qch1=qch.*kmod;
>
> the error displays '??? Undefined function or method 'qpskmod' for
> input arguments of type 'double'.
>
> Error in ==> psm at 93
> [ich,qch]= qpskmod(paradata,para,nd,ml);'
> how to solve this trouble?? i dont know how this meaning..tq
>
>
>
Hi,

There is an inbuilt function for PSK and QAM modulations
For MPSK- pskmod and pskdemod ( M=4 will generate QPSK)
For MQAM- qammod and qamdemod
Define the value of M

I am not sure whether it's a feature of Matlab-7.0 which I am using

cheers
sameer

On Feb 12, 2008 12:46 PM, PRAJIT S NAIR wrote:

> Dear Arul
>
> As far as I know there is no inbuilt function named 'qpskmod' in
> matlab....
> Please check the help files......
> I may be wrong as I am not aware of the latest versions..........
>
> *If the inbuilt function is not available then please define "qpskmod"
> function ? *
>
> Regards
> Prajit s Nair
> On Feb 12, 2008 1:30 AM, n.mie_arul >
> wrote:
>
> > hi everyone..now i started my last year project about Rayleigh Fading
> > using OFDM system..i have a problem when using QPSK modulation..Below
> > is a my coding..anybody know how to solve this prob??
> >
> > %******************* Preparation Part*****************************
> > para8; % Number of parallel channel to transmit
> > fftlen8; % FFT length
> > noc8; % Number of carrier
> > nd=6; % Number of information ODFM symbol for one loop
> > ml=2; % modulation level : QPSK
> > sr%0000; % symbol rate (kbps)
> > br=sr.*ml; % Bit rate per carrier
> > gilen2; % Length of guard interval (points)
> > ebn0; % Eb/No
> >
> > %******************* Fading Initialization**************************
> >
> > % if you use fading function "sefade", you can initialize all of the
> > % parameters.
> > %Otherwise you can comment out the following initialization.
> > tstp=1/sr/(fftlen+gilen); % Time resolution
> >
> > %Arrival time for each multipath normalized bt tstp
> > %if you would like to simulate under 4 path fading model,we have only
> > to
> > %set direct wave.
> > itau = [0,2,3,4];
> >
> > %Mean power for each multipath normalized by direct wave.
> > %If you would like to simulate under 4 path fading model,you have
> > only to
> > %set direct wave.
> > d1v1 = [0,10,20,25];
> >
> > %Number of wave to generates fading for each multipath.
> > %In normal case,more than (minimun) six wave are needed to generates
> > Rayleigh fading
> > n0=[6,7,6,7];
> >
> > %Initial phase of delayed wave
> > %In this simulation four path Rayleigh fading is considered.
> > th1=[0.0,0.0,0.0,0.0];
> >
> > %Number of fading counter to skip
> > itnd0=nd*(fftlen+gilen)*10;
> >
> > %Initial value of fading counter
> > %In this simulation four-path Rayleigh fading is considered.
> > %Therefore four fading counter is needed.
> > itnd1=[1000,2000,3000,4000];
> >
> > %Number of direct wave + Number of delayed wave.
> > %In this simulation four-path Rayleigh fading is considered
> > now1=4;
> >
> > %Maximum Doppler frequency [Hz]
> > %You can insert any favorite value.
> > fd20;
> >
> > % you can decide two modes to simulate fading by changing the
> > variable flat
> > %flat : flat fading or not
> > %(1-flat (only amplitudes is fluctuated),0- normal (phase and
> > amplitude are
> > %flutuated))
> > flat=1;
> >
> > %************************ main loop part****************************
> >
> > nloopP0; % number of simulation loop
> > noe=0; % Number of error data
> > nod=0; % number of tranmitted data
> > eop=0; % number of error packet
> > nop=0; % number of tranmitted packet
> >
> > for i = 1:nloop;
> > end
> >
> > %************************ Tranmitter Stage***************************
> >
> > %************************* Data Generation***************************
> >
> > seldata=rand(1,para*nd*ml) > 0.5; % rand : built in function
> >
> > %***********************Serial to parallel conversion*****************
> >
> > paradata=reshape(seldata,para,nd*ml); % reshape : built in function
> >
> > %************************* QPSK modulation****************************
> > [ich,qch] = qpskmod(paradata,para,nd,ml);
> > kmod=1/sqrt(2); % sqrt:built in function
> > ich1=ich.*kmod;
> > qch1=qch.*kmod;
> >
> > the error displays '??? Undefined function or method 'qpskmod' for
> > input arguments of type 'double'.
> >
> > Error in ==> psm at 93
> > [ich,qch]= qpskmod(paradata,para,nd,ml);'
> > how to solve this trouble?? i dont know how this meaning..tq
> >
> >
> >
>
Matlab clearly reports that the function qpskmod is not defined for arguments of type double. I would have to look at your qpskmod function; matlab has a qpskmod block in communication toolbox but no .m file, are you using the function block? I guess that qpskmod expects an argument of type binary or string of 2 bits as input argument.

-Amit Pathania

"n.mie_arul" wrote:
hi everyone..now i started my last year project about Rayleigh Fading
using OFDM system..i have a problem when using QPSK modulation..Below
is a my coding..anybody know how to solve this prob??

%******************* Preparation Part*****************************
para8; % Number of parallel channel to transmit
fftlen8; % FFT length
noc8; % Number of carrier
nd=6; % Number of information ODFM symbol for one loop
ml=2; % modulation level : QPSK
sr%0000; % symbol rate (kbps)
br=sr.*ml; % Bit rate per carrier
gilen2; % Length of guard interval (points)
ebn0; % Eb/No

%******************* Fading Initialization**************************

% if you use fading function "sefade", you can initialize all of the
% parameters.
%Otherwise you can comment out the following initialization.
tstp=1/sr/(fftlen+gilen); % Time resolution

%Arrival time for each multipath normalized bt tstp
%if you would like to simulate under 4 path fading model,we have only
to
%set direct wave.
itau = [0,2,3,4];

%Mean power for each multipath normalized by direct wave.
%If you would like to simulate under 4 path fading model,you have
only to
%set direct wave.
d1v1 = [0,10,20,25];

%Number of wave to generates fading for each multipath.
%In normal case,more than (minimun) six wave are needed to generates
Rayleigh fading
n0=[6,7,6,7];

%Initial phase of delayed wave
%In this simulation four path Rayleigh fading is considered.
th1=[0.0,0.0,0.0,0.0];

%Number of fading counter to skip
itnd0=nd*(fftlen+gilen)*10;

%Initial value of fading counter
%In this simulation four-path Rayleigh fading is considered.
%Therefore four fading counter is needed.
itnd1=[1000,2000,3000,4000];

%Number of direct wave + Number of delayed wave.
%In this simulation four-path Rayleigh fading is considered
now1=4;

%Maximum Doppler frequency [Hz]
%You can insert any favorite value.
fd20;

% you can decide two modes to simulate fading by changing the
variable flat
%flat : flat fading or not
%(1-flat (only amplitudes is fluctuated),0- normal (phase and
amplitude are
%flutuated))
flat=1;

%************************ main loop part****************************

nloopP0; % number of simulation loop
noe=0; % Number of error data
nod=0; % number of tranmitted data
eop=0; % number of error packet
nop=0; % number of tranmitted packet

for i = 1:nloop;
end

%************************ Tranmitter Stage***************************

%************************* Data Generation***************************

seldata=rand(1,para*nd*ml) > 0.5; % rand : built in function

%***********************Serial to parallel conversion*****************

paradata=reshape(seldata,para,nd*ml); % reshape : built in function

%************************* QPSK modulation****************************
[ich,qch] = qpskmod(paradata,para,nd,ml);
kmod=1/sqrt(2); % sqrt:built in function
ich1=ich.*kmod;
qch1=qch.*kmod;

the error displays '??? Undefined function or method 'qpskmod' for
input arguments of type 'double'.

Error in ==> psm at 93
[ich,qch]= qpskmod(paradata,para,nd,ml);'
how to solve this trouble?? i dont know how this meaning..tq

Amit Pathania