Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Matlab functions for AWGN and fading channel models

Status
Not open for further replies.

ahmad556

Newbie level 5
Joined
Sep 15, 2007
Messages
8
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,283
Activity points
1,321
awgn matlab

I'm trying to find Matlab functions for AWGN and fading channel models for my project. If anyone could kindly help me to find them or either one, they would be most appreciated..
 

matlab awgn

help awgn
AWGN Add white Gaussian noise to a signal.
Y = AWGN(X,SNR) adds white Gaussian noise to X. The SNR is in dB.
The power of X is assumed to be 0 dBW. If X is complex, then
AWGN adds complex noise.

Y = AWGN(X,SNR,SIGPOWER) when SIGPOWER is numeric, it represents
the signal power in dBW. When SIGPOWER is 'measured', AWGN measures
the signal power before adding noise.

Y = AWGN(X,SNR,SIGPOWER,STATE) resets the state of RANDN to STATE.

Y = AWGN(..., POWERTYPE) specifies the units of SNR and SIGPOWER.
POWERTYPE can be 'db' or 'linear'. If POWERTYPE is 'db', then SNR
is measured in dB and SIGPOWER is measured in dBW. If POWERTYPE is
'linear', then SNR is measured as a ratio and SIGPOWER is measured
in Watts.

Example: To specify the power of X to be 0 dBW and add noise to produce
an SNR of 10dB, use:
X = sqrt(2)*sin(0:pi/8:6*pi);
Y = AWGN(X,10,0);

Example: To specify the power of X to be 0 dBW, set RANDN to the 1234th
state and add noise to produce an SNR of 10dB, use:
X = sqrt(2)*sin(0:pi/8:6*pi);
Y = AWGN(X,10,0,1234);

Example: To specify the power of X to be 3 Watts and add noise to
produce a linear SNR of 4, use:
X = sqrt(2)*sin(0:pi/8:6*pi);
Y = AWGN(X,4,3,'linear');

Example: To cause AWGN to measure the power of X, set RANDN to the
1234th state and add noise to produce a linear SNR of 4, use:
X = sqrt(2)*sin(0:pi/8:6*pi);
Y = AWGN(X,4,'measured',1234,'linear');

See also wgn, randn, and bsc.

Reference page in Help browser
doc awgn
 

awgn in matlab

thanx man. I got that at the Matlab help but i'm trying to implement the formula of WGN pdf.
thanx for your response anyway
 

rician fading matlab

%--------------------------------------------------------
% generate a random list of information bits (0/1)
encoder_in=randint(1,L_info,2);
encoder_out=cnv_encd(G,k_in,encoder_in);
%--------------------------------------------------------
if addinter ==1
en_output1 = inter(encoder_out, m_inter, n_inter);
encoder_out = en_output1;
end
%--------------------------------------------------------
% Modulator: QPSK,
%--------------------------------------------------------
%%mod_in=interleaver_out;
mod_in=encoder_out;

mod_out=mod_qpsk(mod_in);
%--------------------------------------------------------
% corrupted channel output
%--------------------------------------------------------
if awgn == 1
ar = ones(size(mod_out));
else
n1 = randn (size(mod_out));
n2 = randn (size(mod_out));
ar = sqrt((n1 .* n1 + n2 .* n2) / 2);
n3 = rand(size(mod_out));
ar = ar .* exp(2j*pi*n3);
end
% AWGN effect
inph = randn(size(mod_out));
quaph = randn(size(mod_out));
complexnoise = inph + quaph * sqrt(-1);
%--------------------------------------------------------
% Received signal
%--------------------------------------------------------
rec = ar .* mod_out + sigma * complexnoise;
demod_in = rec .* conj(ar);
%--------------------------------------------------------
% Demodulator: QPSK,
%--------------------------------------------------------
demod_out = soft_qpsk_demod(demod_in);
%--------------------------------------------------------
if addinter ==1
r1 = inter(demod_out, n_inter, m_inter);
demod_out = r1;
end
%--------------------------------------------------------
decoder_in=demod_out;

for iter = 1:iteration
% calculate bit error rate for the present block, present iteration
decoder_out=viterbi_soft(G,k_in,decoder_in);

err=find(decoder_out ~= encoder_in );

Pe(sum(blocknum(1:power-1))+block,iter) = length(err)/L_info;
if Pe(sum(blocknum(1:power-1))+block,iteration)~=0 % frame error
errblock = errblock+1;
end
fprintf('\n %3d',block);
for p = 1:iteration
fprintf('%15.5e', Pe(sum(blocknum(1:power-1))+block,p));
end
fprintf('\n');
block = block+1;
end
end %
 
awgn matlab code

Can anyone help me with this project?

I need to simulate the effects of AWGN, Rayleigh, and Rician channels on the BCH encoding techniques.

1. Generate random codewords.
2. Encode the codewords using BCH techniques.
3. Add errors into the message by passing the message into various fading channel (AWGN, Rayleigh, and Rician).
4. Decode the errorneous codewords.
5. Compare the decoded codewords with the original one.

I have sucessfully done the first two steps. Can anyone help me with the rest?

The problems I encounter are:
1. The command y= AWGN (codeword, SNR) does not support codeword in the Galois Array format. How to convert the Galois Array elements into the normal matrix form?
2. I believe that the output from these channels are in the non-binary values. How to convert this data back to the binary format to be fed into the command
result = bchdec (codewords, 7, 4)?
 

additive white gaussian noise matlab

have you tried BER Tool in Matlab?
simple type bertool and there is possibility to use AWGN, Rayleigh, and Rician.
 

How to convert the Galois Array elements into the normal matrix form?

function [DecOutput] = gf2dec(GFInput,m,prim_poly)
GFInput = GFInput:))'; % force a row vector
GFRefArray = gf([0:(2^m)-1],m,prim_poly);
for i=1:length(GFInput)
for k=0:(2^m)-1
temp = isequal(GFInput(i),GFRefArray(k+1));
if (temp==1)
DecOutput(i) = k;
end
end
end
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top