DSPRelated.com
Forums

Rayleighchan function in matlab

Started by Dani Camps May 7, 2008
Dear all,

I am trying to model a multipath in matlab but I do not have the
communications toolbox and so neither the raileighchan function.  I
would appreciate your help on assessing if my approach to generate the
FIR discrete channel is correct.

I have two vectors containing the complex gain and the delay of each
path in my channel, taps_gain and taps_delay and a variable, Ts,
containing the sample period in the receiver.

Now in order to generate the FIR components of the channel I do:

--------------------------------------------------------------------------------
num_taps = floor(1.5*max(taps_delay)/Ts);

h_bb=[];
for n = 0:num_taps;
    g_n = sum(taps_gain .* sinc((n- taps_delay/Ts)));
    h_bb = [h_bb g_n];
end
---------------------------------------------------------------------------------

Where I heuristically approximate the number of taps in the channel as
1.5*Delay_Spread/Sampling_Time, since the contribution of the
different paths to taps after Delay_Spread/Sampling_Time is going to
be small. Is this approximation correct ?

To compute the contribution of each path to each FIR component of the
channel, I use the standard procedure of weighting the gain of each
tap with a delayed sinc function.

Another question is whether the range that I use, n=0:num_taps, is
correct or should I use n=-num_taps/2:num_taps ? I think Matlab does
it in the other way.

Is there any other thing that I am missing in order to create the FIR
response of the channel ?

One last question once I have the FIR taps of the channel, h_bb, then
in order to obtain the frequency response I should simply do:

F = fft(h_bb, N);

And to transform the discrete frequency from the FFT into a real
frequency:

f = 1/Ts *(0:N-1)/N;

Is the previous correct ?

Thanks for clarifying if my understanding.

Best Regards

Daniel








>Dear all, > >I am trying to model a multipath in matlab but I do not have the >communications toolbox and so neither the raileighchan function. I >would appreciate your help on assessing if my approach to generate the >FIR discrete channel is correct. > >I have two vectors containing the complex gain and the delay of each >path in my channel, taps_gain and taps_delay and a variable, Ts, >containing the sample period in the receiver. > >Now in order to generate the FIR components of the channel I do: > >-------------------------------------------------------------------------------- >num_taps = floor(1.5*max(taps_delay)/Ts); > >h_bb=[]; >for n = 0:num_taps; > g_n = sum(taps_gain .* sinc((n- taps_delay/Ts))); > h_bb = [h_bb g_n]; >end >--------------------------------------------------------------------------------- > >Where I heuristically approximate the number of taps in the channel as >1.5*Delay_Spread/Sampling_Time, since the contribution of the >different paths to taps after Delay_Spread/Sampling_Time is going to >be small. Is this approximation correct ? > >To compute the contribution of each path to each FIR component of the >channel, I use the standard procedure of weighting the gain of each >tap with a delayed sinc function. > >Another question is whether the range that I use, n=0:num_taps, is >correct or should I use n=-num_taps/2:num_taps ? I think Matlab does >it in the other way. > >Is there any other thing that I am missing in order to create the FIR >response of the channel ? > >One last question once I have the FIR taps of the channel, h_bb, then >in order to obtain the frequency response I should simply do: > >F = fft(h_bb, N); > >And to transform the discrete frequency from the FFT into a real >frequency: > >f = 1/Ts *(0:N-1)/N; > >Is the previous correct ? > >Thanks for clarifying if my understanding. > >Best Regards > >Daniel > > > > > > > > >
%%%%%%% Hi I have been working on multipath channels but I have not modelled yet. Instead I am using standard channel from Digital Communications by John G. Proakis for my simulations. He gives three channels. One good, one bad and one worst. Just use this channel and use function 'conv' to introduce channel effect. Hope this helps. Chintan P Shah
On May 7, 7:10&#4294967295;pm, "cpshah99" <cpsha...@rediffmail.com> wrote:
> >Dear all, > > >I am trying to model a multipath in matlab but I do not have the > >communications toolbox and so neither the raileighchan function. &#4294967295;I > >would appreciate your help on assessing if my approach to generate the > >FIR discrete channel is correct. > > >I have two vectors containing the complex gain and the delay of each > >path in my channel, taps_gain and taps_delay and a variable, Ts, > >containing the sample period in the receiver. > > >Now in order to generate the FIR components of the channel I do: > > >-------------------------------------------------------------------------------- > >num_taps = floor(1.5*max(taps_delay)/Ts); > > >h_bb=[]; > >for n = 0:num_taps; > > &#4294967295; &#4294967295;g_n = sum(taps_gain .* sinc((n- taps_delay/Ts))); > > &#4294967295; &#4294967295;h_bb = [h_bb g_n]; > >end > >--------------------------------------------------------------------------------- > > >Where I heuristically approximate the number of taps in the channel as > >1.5*Delay_Spread/Sampling_Time, since the contribution of the > >different paths to taps after Delay_Spread/Sampling_Time is going to > >be small. Is this approximation correct ? > > >To compute the contribution of each path to each FIR component of the > >channel, I use the standard procedure of weighting the gain of each > >tap with a delayed sinc function. > > >Another question is whether the range that I use, n=0:num_taps, is > >correct or should I use n=-num_taps/2:num_taps ? I think Matlab does > >it in the other way. > > >Is there any other thing that I am missing in order to create the FIR > >response of the channel ? > > >One last question once I have the FIR taps of the channel, h_bb, then > >in order to obtain the frequency response I should simply do: > > >F = fft(h_bb, N); > > >And to transform the discrete frequency from the FFT into a real > >frequency: > > >f = 1/Ts *(0:N-1)/N; > > >Is the previous correct ? > > >Thanks for clarifying if my understanding. > > >Best Regards > > >Daniel > > %%%%%%% > > Hi > > I have been working on multipath channels but I have not modelled yet. > Instead I am using standard channel from Digital Communications by John G. > Proakis for my simulations. He gives three channels. One good, one bad and > one worst. > > Just use this channel and use function 'conv' to introduce channel > effect. > > Hope this helps. > > Chintan P Shah
Hi, Thanks for your suggestion. However in my case I have to use certain multipath channel, let's say that the delays and complex gains of each path come given from another model, and what I have to do is to convert this mutipath channel into a FIR filter such that I can find the frequency response of the channel at each of the OFDM subcarrier of the transmitted signal, I am modeling a WLAN signal. So if my understanding is correct what I have to do is to find the equivalent FIR channel of my multipath channel considering the sampling frequency of the signal at the receiver, 20Msaples/sec in WLAN, and then do the fft of this FIR channel with as many points as subcarriers has the OFDM modulation, 64 in WLAN. So I need help in assessing if the way I obtain the discrete FIR channel from the multipath channel is correct. Regards Daniel