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.
N0 = NumAngles/4;
% Maximum Doppler shift of carrier at some wavelength
omega_m = (2*pi) * fm(Velocity, carrierFreq);
% specify variance of the Rayleigh channel
% use this for *constant* variange - requires changing other params in prog
sigma2 = 10;
% make sigma2 a gaussian RV around u = sigma2 and var = sigma2/5
% use for *non constant* variaance - requires changing other params in prog
sigma2 = sigma2 + sqrt(sigma2/5) .* randn(1,NumWaveforms);
% Initialize phases
alpha_n = []; beta_n = []; theta_nk = [];
% make a hadamard matrix
Ak = hadamard(N0);
% determine phase values 'alpha' and 'beta'
n=[1:N0];
alpha_n = 2*pi*n/NumAngles - pi/NumAngles;
beta_n = pi*n/N0;
% convert to time scale using 'fs' sampling frequency
t=[1/(symbolRate*1000):1/(symbolRate*1000):1/(symbolRate*1000) * Length];
Tk = [];
for q = 1 : NumWaveforms
rand('state',sum(100*clock)) % reset randomizer
theta_nk = rand(1,length) * 2 *pi; % create uniform random phase in range [0,2pi]
sumRes = 0;
for i = 1 : N0
term1 = Ak(NumWaveforms,i);
term2 = cos(beta_n(i)) + j*sin(beta_n(i));
term3 = cos(omega_m .* t .* cos(alpha_n(i)) + theta_nk(i));
sumRes = sumRes + (term1 .* term2 .* term3);
end
Tk(q, = sqrt(2/N0) .* sumRes;
% use line below to apply *non-constant* variance
Tk(q, = repmat(10.^(sigma2(q)/20),1, Length) .* Tk(q,; %apply variable in dB
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.