From: Ali Alemdar on
Ok, so I've looked around the Internet and I've seen others
with a similar problem:

Problem:
1. Even when I set the initial state to a random seed I
still get correlated values for calls to rayleighchan (i.e.
calls to raleighchan return highly correlated channels when
in fact their seeds are VERY different). Why is this? Is
there anything I can do to fix the problem?

I've even tried using small perturbations in the doppler
frequencies/path gains/delay and I still don't get good results.

What am I doing wrong?

Here is my code:


clear all;
clc;

Ts = 1e-4;
lenfc = 5e2;
N = 2;
input = randint(1,lenfc);

for i =1:N
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%ensuring channels are independent%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
time = clock;
state = time(6);
seed = randseed(state);

fd(i) = 10*(10+rand/10);
tau = [0 (1e-6+rand*1e-5) (5e-6+rand*1e-5)
(7e-6+rand*1e-5) (9e-6+rand*1e-5) (11e-6+rand*1e-5)
(15e-6+rand*1e-5)];
%average path delays (s)
pdb = [0 (-1-2*rand) (-1-2*rand) (-3-2*rand) (-3-2*rand)
(-5-2*rand) (-8-2*rand)];
%average path gains
h = rayleighchan(Ts,fd(i),tau,pdb);
% sigmag = 1;
dop=doppler.jakes;
h.DopplerSpectrum=dop;
h.StoreHistory = 0;
h.ResetBeforeFiltering = 1;
fl = abs(filter(h,input));
fl = fl/mean(fl);

%discard initial transients
fading_channel(i,:) = fl(50:lenfc);

%%%%%%%%%%%%%%%%%%%%%%%%
%reset state of channel%
%%%%%%%%%%%%%%%%%%%%%%%%
reset(h,seed);

end



Any ideas? This is really driving me up the wall because I
dont know if I'm doing something wrong, or if there's a bug
in Matlab.


Thanks so much for your time and effort,
Ali