Clear Filters
Clear Filters

i am referring to a book titled " MIMO - OFDM wireless comm with matlab". In this i understood the mathematics but unable to understand the code for rayleigh and rician fading channels. Pls if some one can share his views on this will be very helpful

1 view (last 30 days)
% plot_Ray_Ric_channel.m
clear, clf
N=200000; level=30; K_dB=[-40 15];
gss=[k-s; b-o; r-^];
% Rayleigh model
Rayleigh_ch=Ray_model(N);
[temp,x]=hist(abs(Rayleigh_ch(1,:)),level);
plot(x,temp,gss(1,:)), hold on
% Rician model
for i=1:length(K_dB);
Rician_ch(i,:) = Ric_model(K_dB(i),N);
[temp x] = hist(abs(Rician_ch(i,:)),level);
plot(x,temp,gss(i+1,:))
end
xlabel(x), ylabel(Occurrence)
legend(Rayleigh,Rician, K=-40dB,Rician, K=15dB)
%%%% functions 1
function H=Ray_model(L)
% Rayleigh channel model
% Input : L = Number of channel realizations
% Output: H = Channel vector
H = (randn(1,L)+j*randn(1,L))/sqrt(2);
%%%% functions 2
function H=Ric_model(K_dB,L)
% Rician channel model
% Input : K_dB = K factor[dB]
% Output: H = Channel vector
K = 10^(K_dB/10);
H = sqrt(K/(K+1)) + sqrt(1/(K+1))*Ray_model(L); %%%%% didnt understand this line.
  2 Comments
dpb
dpb on 22 Jun 2019
What specifically didn't you understand?
The second model is just a constant plus a scaled magnitude of the first. This should be related to the mathematics in the reference, but I haven't tried to find it..

Sign in to comment.

Answers (0)

Categories

Find more on WLAN Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!