I am following the codes for rayleigh fading channel given in the webpage: http://www.raymaps.com/index.php/m-qam-bit-error-rate-in-rayleigh-fading/

I am confused and need help in clarifying some basic questions regarding how to simulate a Rayleigh fading channel with $L$ taps? This is not clearly mentioned.

Question 1: I have studied that a flat fading channel is one which has 1 tap. In the webpage, a flat fading is simulated by h=(1/sqrt(2))*(randn(N,1)+1i*randn(N,1)); where $N$ denotes the number of bits or the number of data points. So, there are $N$ taps and definitely this is not a 1 tap channel. Please correct me where wrong.

Question 2: Also, how to simulate a fading and flat fading with say $L = 5$ taps?

This is how I have done but I am not sure how to properly do such that there is inter-symbol-interference as well. If number of paths, $L$ through which the signal reaches the receiver with some delay among the different paths. If the delay spread is greater than the symbol duration then we get inter symbol interference. In the following code, I am not sure if inter-symbol-interference is there or not and if I am correclty applying the theory to simulate the fading channel.

clear all
% Number of data points
N = 100;
L= 5; % number of taps
%Data symbols of 0/1
x = randn(N,1)>0;
%channel coefficients as Rayleigh random variable with variance 0.5 for real and imaginary component
h = 0.5*(randn(L,1)+1i*randn(L,1));
%Channel is an FIR filter
y = filter(h,1,x);
  • $\begingroup$ what do you understand about the term "inter-symbol-interference" ? $\endgroup$
    – AlexTP
    May 28, 2017 at 12:55
  • $\begingroup$ @AlexTP: In non-technical terms, when the data symbols overlap each other because they are too close or because of the delay. I have data x generated as shown in the code, where I don't know the sampling frequency. If I expand the above FIR model for the real domain case, say 3 channel coefficients, $h = [1,0.2,0.3]$ then for the $y(3) = h(1)*x(3) + h(2)*x(2) + h(3)*x(1)$ would be the output at time instant 3. In theory it says that if the delay spread is greater that the symbol duration then we get ISI. Where is the ISI here, I don't understand. $\endgroup$
    – SKM
    May 28, 2017 at 21:25
  • $\begingroup$ If the correct method accompanied by the code is shown where I can see the delay spread greater than the symbol duration and ISI being introduced would help in understanding the concept. Is the way I have generated data wrong? $\endgroup$
    – SKM
    May 28, 2017 at 21:27
  • $\begingroup$ The above example is for 5 path fading channel. If I am asked what is the sampling frequency, what is the delay spread and and how is ISI introduced here in this example, I don't know the answer $\endgroup$
    – SKM
    May 28, 2017 at 21:36

1 Answer 1


Lets say we want to transmit a sequence of discrete data $\left\lbrace x[n] \right\rbrace$. But because we are living in analog world, the sequence must be modulated.

Call $T_s$ is symbol duration and use a set of orthonormal waveforms $\left\lbrace p_n(t) = p(t-nT_s), n \in \mathbb{Z} \right\rbrace$, (baseband) signal $x(t)$ can be written as \begin{equation} x(t) = \sum_{n} x[n] p(t - n T_s) \tag 1 \end{equation}

The equation (1) can be thought of modulating $x[n]$ to the n-th dimension of $x(t)$. To get back $x[n]$, we project $x(t)$ to this n-th dimension.

This projection is implemented by passing the received signal over the matched filter $q(t) = p^*(-t)$ and then sampling at $t=n T_s$. This projection is perfect if $g(t) = p(t) \star q(t)$ satisfies the the criterion $g(t) = 1$ if $t=0$ and $g(t) = 0$ if $t=m T_s\textrm{, } m \in \mathbb{Z}\textrm{, } m \neq 0$, i.e. Nyquist ISI criterion. Otherwise, the project will introduce error and by projecting to the n-th dimension, we don't get only $x[n]$ but also $x[m \neq n]$.

($\star$ means convolution)

This is bandlimited-caused ISI, not what you are asking but the model is necessary to understand the second ISI type, multipath-propagation-caused ISI.

Another source of ISI is multipath phenomenon. The received signal can be written as

\begin{equation} y(t) = \sum_{i} a_i(t)x(t-\tau_i(t)) + w(t) \tag 2 \end{equation} where $i$ is the index of physical path, $a_i(t)$ is its complex gain and $\tau_i(t)$ is the delay introduced by the path. $w(t)$ is AWG noise at receiver.

Apply the matched filter and sampling the output at $t = m T_s$, \begin{eqnarray} y[m] = y(t) \star q(t)|_{t = m T_s} = \sum_{i} a_i(m T_s) \sum_{n} x[n] g(m T_s - n T_s - \tau_i(m T_s)) + w[m] \\ y[m] \stackrel{l=m-n}{=} \sum_{l}x[m-l]h_l[m] + w[m] \end{eqnarray}

with the channel tap $h_l[m]$, i.e. channel tap $l$ at the sample time $t=mT_s$,

\begin{equation} h_l[m] = \sum_{i}a_i(m T_s)\times g(l T_s - \tau_i(m T_s)) \tag 3 \end{equation}

Now assume that the channel impulse reponse is invariant (a relaxed assumption could be that channel taps does not change during a coherence time, we call it underspread assumption),

$$y[m] = \sum_{l}x[m-l] \times h_l + w[m] \tag 4$$

The equation (4) is what you call FIR model. The equation (3) is the model of channel tap.

Remember Nyquist ISI criterion above ? $g(t) = 1$ if $t=0$ and $g(t) = 0$ if $t=m T_s\textrm{, } m \in \mathbb{Z}\textrm{, } m \neq 0$. Thus the power of the composite filter $g(t)$ must "concentrate" between $[-T_s/2, T_s/2]$ as in image for raised cosine pulse.

raised cosine

Thus the term $g(l T_s - \tau_i(m T_s))$ in Equation (3) is significant if and only if $-T_s/2 < |l \times T_s - \tau_i(m T_s)| < +T_s/2$.

We can interpret as the channel tap $l$ is contributed by the physical path $i$ whose delay $\tau_i$ is around $t = l \times T_s$.

The channel impulse reponse can be thought being sampled by symbol duration $T_s$. And the number of tap depends on the relation between symbol duration $T_s$ and delay spread $\tau_m = \mathrm{max}_i (\tau_i)$, i.e. $L \approx \tau_m / T_s$.

As soon as $L > 1$, $y[m]$ is contributed by several $x[m], x[m-1], ...$ and it is multipath ISI. An equalizer will be needed to mitigate the effect of this ISI.

If $\forall \tau_i \ll T_s$, all physical path gains $a_i$ will contribute to only the channel tap $l=0$, we have flat fading, or single tap model.

What you are doing with matlab is playing with Equation (4) and you don't need to care about symbol duration and delay spread anymore.

  • $\begingroup$ Thank you for the explanation in detail. I have few questions, could you please clarify? (1) as you say that I am implementing Eq(4), so in the code $m = 1,2,3....,N$ where $N$ is the number of data points, so $t = T_s$. But, what is then $T_s$. The delays $\tau_i$ are integers - 2,3,4,5 (for $L = 5$ taps) (2) Is my code correct for an $L$ tap or say $L$ path Rayleigh fading channel? Would the code introduce ISI because I am assuming time invariant but multiple paths (by having $L =5$ or even greater) $\endgroup$
    – SKM
    May 29, 2017 at 0:13
  • $\begingroup$ The delays $\tau_i$ are not integers. The delay taps $l$ are. The number of taps is $L$ in your code. As soon as $L > 1$, $y[m]$ is contributed by several $x[m], x[m-1], ...$ and it is multipath ISI. You will need equalizer to mitigate the effect of this ISI. $\endgroup$
    – AlexTP
    May 29, 2017 at 6:52
  • $\begingroup$ can you please elaborate a bit more what the symbol duration, $T_s$ , delays $\tau_i$ and the delay spread is in my code? I am not understanding what the values of the symbol duration and the delay spread is in my example. Thank you very much for your time and effort. $\endgroup$
    – SKM
    May 29, 2017 at 8:18
  • $\begingroup$ Your code is the implementation of Equation (4), there are not $T_s$ and delay spread because you are in discrete-time model. $\endgroup$
    – AlexTP
    May 29, 2017 at 8:20
  • $\begingroup$ So based on Eq(4), Is ISI still being introduced and why? Is it because the number of taps is greater than 1? $\endgroup$
    – SKM
    May 29, 2017 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.