# Using rayleighchan to obtain channel gains of fading Rayleigh channel

Status
Not open for further replies.

##### Newbie level 3
Hi all.

I am trying to simulate a fading multipath Rayleigh channel and I need the channel gains for channel tracking of the OFDM system...

So I tried this simulation. All parameters have been defined, fftleng is the fourier transform size, NumofSymbols is the number of OFDM symbols, cpleng is the cyclic prefix length. And this is the simple code I tried:

% Generate transmit signal
sf = randint(1,fftleng*NumofSymbols)*2-1;
s1 = reshape(sf,fftleng,NumofSymbols);
sf1 = ifft(s1);
st1 = [sf1(fftleng-cpleng+1:fftleng,; sf1];
st = reshape(st1,1,[]);

% rayleigh channel
ch=rayleighchan(ts,fd,tau,pdb);

if (fd>0)
ch.StoreHistory = 1;
end

output=filter(ch,st);

n=1:NumSamples;
figure;
plot(n,ch.pathGains,1))

However, when I plot the channel gains for the first multipath, what I obtain resembles more of noise rather than a fading channel...

Can someone please advise me on how to properly use the rayleighchan object to get the channel gains? I believe I should have the channel gains for each of the multipaths...

Also it will be great if someone can provide more explanations on the effects of the StoreHistory, StorePathGains and ResetBeforeFiltering. I couldn't really understand the Matlab help definition....

#### Ahmed Alaa

##### Full Member level 5
Use the "channel visualization toolbox" to better visualize the channel.

Status
Not open for further replies.

Replies
1
Views
3K
Replies
0
Views
1K
Replies
4
Views
9K
Replies
0
Views
2K
Replies
2
Views
2K