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.

Channel coefficients using Matlab's Rayleigh channel function

Status
Not open for further replies.

serhannn

Member level 4
Joined
Sep 28, 2010
Messages
69
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,939
Hi, I'm trying to obtain the Channel matrix (H) and code matrix for a cdma simulation. Basically, I need the channel responses h_i's for each user i=1,...,K. But when I use the Matlab's Rayleighchan function it gives me the path gains for every symbol I transmit. What does that mean? I want to get the channel response for every user and say, if each user transmits 100 symbols and I have 10 users and channel has 3 taps, then I get a PathGains matrix of 100x3 for every one of the 10 users. But I think, for each user I should only have one channel response. Am I not correct? I am a little bit confused about this channel response thing, so forgive me if I am making any fundamental mistakes here.

My code is as follows:

Code:
K = 10;     % Number of users
L = 3;      % Number of multipath fingers for each user
M = 100;    % Number of symbols transmitted by each user in each frame
G = 64;     % Spreading gain = Chip rate / Symbol rate

sampleTime = 2.0e-006;
maxDopplerShift = 200;                  % = v*f/c [Hz]
maxDelay = 0.16;
%delayVec = 1.0e-006 * [0 0.04 0.08];                % delays of three-path channel
delayVec = 1.0e-004 * rand([K L-1]) * maxDelay;      % create avg. path delays for each user (each has 3 paths)
delayVec = [zeros(K,1) delayVec];                    % First path is direct path, hence 0 delay for all users
%gainVec = [0 -3 -6];                    
gainVec = -delayVec*10^6;                            % average path delays [dB], decay exponentially with delay (linearly in dB)
%%

% Modulation
hMod = comm.BPSKModulator;
bitsPerFrame = M;                                    % Number of bits transmitted per frame = M , due to BPSK modulation
                                          

S = zeros(bitsPerFrame,K);                           % Create data matrix for K users, each having M symbols
modulated_S = zeros(bitsPerFrame,K);                 % Modulated data matrix
nFrames = 100;                                       % Number of frames   

% Create K impulse responses for each user
for i=1:K  
    h(i) = rayleighchan(sampleTime, maxDopplerShift, delayVec(i,:), gainVec(i,:));
    h(i).StoreHistory = 1;                                   %
    h(i).ResetBeforeFiltering = 0;                           % preserve the continuity of fading process 
    for n=1:nFrames
        S(:,i) = randi([0 1],bitsPerFrame,1);                % Create the message bits for i-th user
        modulated_S(:,i) = step(hMod, S(:,i));               % Modulate the message of i-th user into BPSK symbols
        Y(:,i) = filter(h(i),modulated_S(:,i));              % Apply the channel of i-th user to the modulated message
    end
end

So as you see I have a multidimensional array h(i) to store the channel responses and when I type for example:

Code:
h(1).PathGains

I get a 100x3 matrix containing path gains for 100 symbols transmitted by the user 1 with 3 multipath fingers. At least, that's what I think what is happening. My question is: Am I not supposed to get one single channel response for each user? Or how do I obtain that channel response for this path gains matrix.

Thanks a lot.
 

I think I might have solved the problem. I removed the part of the code:
Code:
h(i).StoreHistory = 1;
After this, when I type h(8) meaning that I would like to see the channel of user 8, I get the following:
Code:
             ChannelType: 'Rayleigh'
       InputSamplePeriod: 2.0000e-06
         DopplerSpectrum: [1x1 doppler.jakes]
         MaxDopplerShift: 200
              PathDelays: [0 5.4140e-06 7.3073e-06]
           AvgPathGaindB: [0 -5.4140 -7.3073]
      NormalizePathGains: 1
            StoreHistory: 0
          StorePathGains: 0
               PathGains: [0.4047 - 0.1857i 0.2528 - 0.6938i -0.2452 + 0.1236i]
      ChannelFilterDelay: 4
    ResetBeforeFiltering: 1
     NumSamplesProcessed: 100

So for each user, the parameter PathGains is the respective impulse response as far as I could understand. It has three components since my multipath channel has three fingers. I think when I set the StoreHistory parameter to 1, the rayleighchan function stored evolution of the channel response throughout the transmission of all 100 symbols and the last value was actually what I desired.
 

error in code--??? Undefined function or variable 'comm'.
Error in ==> rayl2 at 17
hMod = comm.BPSKModulator;

Ques)How to generate h(64 by 1 matrix),channel impulse response for a rayleigh fading channel(speed-120km/hr)..relative delays[0 781 1563 2344],avg power[0 -3 -6 -9]..max doppler shift 150 HZ,carrier freq-1 GHZ..
no.of users-8, no.of path for each user-8 or 16

plz help :roll:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top