1. Introduction {#sec1}
===============

Diversity techniques are used when the channel is in a deep fade. If several replicas of the same information signal are transmitted over independent fading channels, the probability that all signal components will fade simultaneously is reduced considerably. There are different ways in which we can provide the receiver with *L* independent fading replicas of the same information signal.

Frequency diversity is a diversity method where the information signal is transmitted on *L* carriers. The separation between the successive carriers equals to or exceeds the coherent bandwidth of the channel. Orthogonal frequency division multiplexing (OFDM) transmission is the famous technique that exploits frequency diversity to achieve high data rate and low bit error rate in frequency selective channels \[[@B1]--[@B3]\]. OFDM suffers from intercarrier interference (ICI) due to frequency offsets, symbol timing error, and channel estimation errors \[[@B4]--[@B6]\]. OFDM systems also suffer from high peak to average power ratio (PAPR) \[[@B7], [@B8]\].

Another commonly used method for achieving diversity employs multiple antennas. Multiple transmitting antennas are used to transmit the same information signal and multiple receiving antennas are used to receive the independently fading replicas of the transmitted signal through uncorrelated fading paths. A comparative study of space diversity techniques in mobile radio is shown in \[[@B9]\]. Multiple-input and multiple-output (MIMO) system is a well-known system that exploits the antenna diversity to enhance the bit error rate and the channel capacity in fading environments \[[@B10], [@B11]\].

Time diversity is another diversity method where *L* independent fading version of the same information signal is achieved by transmitting the signal in *L* different time slots. The separation between the successive time slots equals to or exceeds the coherence time of the channel. Time diversity is used in modern communication system through interleaving of the transmitted symbols and through the using of channel codes \[[@B12]--[@B14]\].

Some systems use a combination of more than one diversity technique to enhance their performance in fading channels such as space-time (ST) coding in MIMO systems \[[@B15], [@B16]\], which use the time and space diversities through encoding the transmitted symbols using space time codes and transmitting the encoded symbols by different antennas in the transmitter. This technique allows the data symbol to be transmitted more than one time through different symbol period and it arrives at the receiver\'s antennas through different spatial paths. MIMO-OFDM system is another example of multidiversity system where time, frequency, and space diversities are used to enhance the performance of the data transmission over wireless faded channels \[[@B17]--[@B20]\]. In MIMO-OFDM system, the symbols are encoded by using space-time-frequency (STF) block codes. The encoded symbol is transmitted more than once over different periods and carrier frequencies using different transmitting antennas. The uncorrelated fading gains that come from the uncorrelated spatial paths, the different transmitting time slots, and the different transmitting carrier achieve the diversity gain at the receiver. This system has large diversity gain and better performance than space-time coded MIMO systems.

The systems that use space diversity such as MIMO systems have the disadvantage of using more than one antenna at the transmitter and the receiver. Multiple antennas need multiple RF drivers (power amplifier at the transmitter and low noise amplifier at the receiver) and this complicates the transmitter and the receiver structure. The spacing between the antennas should be large enough to have uncorrelated fading paths and to reduce the cross correlation and interference between the antennas. The MIMO systems consume more power than single-input and single-output (SISO) systems and they have short lifetime batteries for mobile units. Powerful DSP unit is required for MIMO transceivers because ST and STF encoder and decoder need complex computations.

In this paper, we propose a new diversity technique for SISO spread spectrum systems that can achieve a diversity gain like that of the MIMO system but with a single transmitting antenna and a single receiving antenna. The MIMO system has diversity gain with two degrees of freedom (the number of the transmitting and receiving antennas). The proposed diversity scheme has a diversity gain with two degrees of freedom too. Although the proposed system has a single transmitting antenna and a single receiver antenna, the using of *N* spreading codes and *L* uncorrelated propagation paths achieves the diversity gain. [Section 2](#sec2){ref-type="sec"} discusses the idea of code-time diversity in detail. In [Section 3](#sec3){ref-type="sec"} the signal model and the new transmit diversity scheme are represented. The receiver structure of the proposed system is shown in [Section 4](#sec4){ref-type="sec"} with the calculations of the probability of error in the received data. [Section 5](#sec5){ref-type="sec"} shows the simulation results and some implementation issues.

2. Code-Time Diversity {#sec2}
======================

In space-time MIMO system, the encoded data symbol is transmitted more than one time through different symbol periods using different transmitting antennas. The transmission of the symbols through independent time slots lets the received symbol to have independent fading gains. The probability of receiving the transmitted symbol with faded gains through the successive time slots is reduced significantly. Also the usage of different antennas allows the transmitted symbol to have independent propagation paths from the transmitter to the receiver and to have independent fading gain through each path. So they are the different time slots and propagation paths that play the main role in the diversity gain enhancement of the time-space MIMO system.

In the proposed code-time diversity technique, we use the same concept of time and space diversities but through another procedure. During each symbol period, the current data symbol and the previous (*N* − 1) ones are dispersed in frequency using *N* independent spreading codes sequences for each data symbol. The used spreading codes are taken from a set of *N* orthogonal codes. The dispersed symbols are added together and transmitted using a single antenna. The orthogonality between the used spreading sequences prevents the interference among the transmitted symbols. The same procedure is repeated for each symbol period so that each symbol can be transmitted *N* times through *N* successive symbol periods using, each time, a different spreading code from the set of *N* orthogonal codes. [Figure 1](#fig1){ref-type="fig"} shows an example of how the modulated data symbols are transmitted three times at three successive symbol periods using three different orthogonal spreading codes.

By this way, time diversity is achieved and the probability of having *N* faded gains during *N* successive symbols periods is reduced considerably.

The space diversity is achieved by controlling the bandwidth of the dispersed symbols to be greater than the coherent bandwidth of the used wireless channel. This allows uncorrelated multipath propagation from the transmitter to the receiver. The using of direct sequence spread spectrum (DSSS) increases the information message bandwidth by a factor equal to the process gain of the spreading process, which is equivalent to the ratio between the data symbol period and the spreading code chip period. By controlling the process gain, the bandwidth of the spread signal can be equal to multiples of the coherent bandwidth of the channel. The number of the uncorrelated paths that can be appeared from the transmitter to the receiver is given by $$\begin{matrix}
{L = \left\lfloor {\frac{\text{Bandwidth\ of\ DSSS\ signal}}{\text{Channel\ coherent\ bandwidth}} + 0.5} \right\rfloor.} \\
\end{matrix}$$

By the same way, the probability of having spatial faded gains through the uncorrelated propagation paths *L* is reduced significantly.

The proposed code-time diversity system has a diversity gain with two degrees of freedoms as the space-time MIMO system. Although the diversity gain in the time-space MIMO system is depending on the number of the antennas in the transmitter *N* ~*t*~ and the receiver *N* ~*r*~, the diversity gain in the code-time diversity system is depending on the number of the used spreading codes *N* (which equals to the number of time slots through which each symbol will be repeated) and the number of the uncorrelated propagation paths *L*. The proposed diversity scheme uses one antenna and one RF interface unit in the transmitter and in the receiver. However, the code-time diversity seems to have diversity gain similar to that of the time-space MIMO system, and the code-time diversity uses a spread signal with higher bandwidth than the bandwidth of the transmitted signal in the time-space MIMO system. In other words, the increase in the signal bandwidth of the proposed code-time diversity system is the cost that should be paid to improve the diversity gain using a simplified hardware of single antenna and single RF interface in the transmitter and in the receiver. The code-time diversity system needs no space-time codes, and it depends only on the orthogonality between the spreading codes.

3. Transmitted Signal Model of Code-Time Diversity DSSS {#sec3}
=======================================================

The code-time diversity system is based on the transmission of the data by using different orthogonal spreading codes at different transmission periods. At each transmission period, the transmitted signal is the summation between the current spread symbol and the previous (*N* − 1) spread symbols where *N* is the number of the used orthogonal spreading codes. Equation ([2](#EEq2){ref-type="disp-formula"}) shows the *k*th symbol transmission: $$\begin{matrix}
{s_{k}\left( t \right) = {\sum\limits_{n = 0}^{N - 1}{d_{k - n}c_{n}\left( {t - kTs} \right),}}} \\
\end{matrix}$$ where *d* ~*k*−*n*~ is the modulated data symbol and *c* ~*n*~(*t*) is the spreading code sequence. The used modulation method may be BPSK or *M*-QAM. The spreading codes are assumed to be orthonormal through the symbol period *T* ~*s*~: $$\begin{matrix}
{{\int\limits_{0}^{T_{s}}{c_{i}\left( t \right) \cdot c_{j}\left( t \right) \cdot dt}} = \begin{cases}
1 & {\text{if  }i = j} \\
0 & {\text{if  }i \neq j.} \\
\end{cases}} \\
\end{matrix}$$ Without any loss of generality, the code period is assumed to be equal to the symbol period: $$\begin{matrix}
{T_{s} = N_{c}\ast T_{c}.} \\
\end{matrix}$$ *N* ~*c*~ is the number of chips on one code period and *T* ~*c*~ is the chip period. So, $$\begin{matrix}
{c_{i}\left( {t - kT_{s}} \right) = c_{i}\left( t \right).} \\
\end{matrix}$$ The transmitted signal of a packet of *K* symbols is illustrated in ([6](#EEq6){ref-type="disp-formula"}) and [Figure 2](#fig2){ref-type="fig"} shows the modulator structure of code-time diversity system: $$\begin{matrix}
{s\left( t \right) = {\sum\limits_{k = 0}^{K - 1}{s_{k}\left( {t - kTs} \right)}} = {\sum\limits_{k = 0}^{K - 1}{\,{\sum\limits_{n = 0}^{N - 1}{d_{k - n}c_{n}\left( {t - kTs} \right).}}}}} \\
\end{matrix}$$ The modulated signal in ([6](#EEq6){ref-type="disp-formula"}) is transmitted to the channel through single RF interface module and single transmitting antenna.

4. Received Signal Model of Code-Time Diversity DSSS Signal in Rayleigh Fading Channel and the Proposed Demodulator Building {#sec4}
============================================================================================================================

4.1. Flat Fading Rayleigh Channel {#sec4.1}
---------------------------------

The impulse response of the flat fading channel is shown in ([7](#EEq7){ref-type="disp-formula"}). Quasistatic channel is assumed where the fading gain is fixed during one symbol period and it is changed randomly from one symbol to another: $$\begin{matrix}
{h\left( t \right) = \alpha\delta\left( t \right),} \\
\end{matrix}$$ where *α* is a complex Gaussian random variable with zero mean and *σ* ~*α*~ ^2^ variance. In flat fading channel, the transmitted signal travels from the transmitter to the received through unresolvable propagation paths. Therefore, all frequency components of the signal will experience the same magnitude of fading. In our proposed diversity scheme, the flat fading case looks like the MISO system where multiple antennas transmit the modulated symbols and a single antenna at the receiver picks them up. According to our signal model, the received signal at the demodulator input is $$\begin{matrix}
{r\left( t \right) = {\sum\limits_{k = 0}^{K - 1}{\,{\sum\limits_{n = 0}^{N - 1}{{\alpha_{k}d}_{k - n}c_{n}\left( {t - kTs} \right)}}}} + w\left( t \right),} \\
\end{matrix}$$ where *w*(*t*) is a sample function of white Gaussian noise process with zero mean and *σ* ~*w*~ ^2^ variance. *α* ~*k*~ is the channel random gain at the *k*th symbol period. The proposed demodulator for the code-time diversity system consists of three parts. The first part is a bank of correlators that correlate the received signal with the *N* spreading codes. The *n*th correlator correlates the received signal with the *n*th spreading code *c* ~*n*~(*t*) through one symbol period. The *n*th correlator output at the *k*th symbol period is shown in ([9a](#EEq9a){ref-type="disp-formula"}) and ([9b](#EEq9b){ref-type="disp-formula"}):$$\begin{matrix}
{x_{n}\left( {kT_{s}} \right) = {\int\limits_{0}^{T_{s}}{r\left( t \right) \cdot c_{n}\left( {t - kT_{s}} \right) \cdot dt = {\alpha_{k}d}_{k - n} + v_{kn},}}} \\
\end{matrix}$$ $$\begin{matrix}
{v_{kn} = {\int\limits_{0}^{T_{s}}{w\left( t \right) \cdot c_{n}\left( {t - kT_{s}} \right) \cdot dt,}}} \\
\end{matrix}$$where *v* ~*kn*~ is a Gaussian random variable with zero mean and *σ* ~*w*~ ^2^ variance. The second part of the proposed demodulator is the combiner. Maximal ration combiner (MRC) is used but with some modifications. In the proposed MRC, the outputs of the *N* correlators are multiplied by the conjugate of the channel gain *α* ~*k*~, which is estimated in the receiver. The multiplications results will independently be delayed according to the spreading code index. The output of the correlation with the code sequence *c* ~*n*~(*t*) is delayed ((*N* − 1) − *n*) symbol periods. The delayed samples are finally added to form a single input to the detector. The output of the proposed MRC in the *z*-domain can be represented by $$\begin{matrix}
{Y\left( z \right) = {\beta_{0}X}_{0}\left( z \right)z^{- ({N - 1})} + \beta_{1}X_{1}\left( z \right)z^{- ({N - 1}) + 1}} \\
{\quad + \beta_{2}X_{2}\left( z \right)z^{- ({N - 1}) + 2} + \cdots + \beta_{N - 1}X_{N - 1}\left( z \right).} \\
\end{matrix}$$ The *β* ~*n*~ coefficients represent the conjugate of the estimated channel gains according to the following relation: $$\begin{matrix}
{\beta_{n}\left( {kT_{s}} \right) = \alpha_{k - {({N - 1})} + n}^{\ast}.} \\
\end{matrix}$$ The output of the combiner at the *k*th symbol period is represented by $$\begin{matrix}
{y\left( {kT_{s}} \right) = {\sum\limits_{n = 0}^{N - 1}\alpha_{k - {({N - 1})} + n}^{\ast}}x_{n}\left( {\left( {k - \left( {N - 1} \right) + n} \right)T_{s}} \right)} \\
{= {\sum\limits_{n = 0}^{N - 1}{\alpha_{k - {({N - 1})} + n}^{\ast}\alpha_{k - ({N - 1}) + n}}}d_{k - ({N - 1})} + v_{kn}^{\prime},} \\
\end{matrix}$$

$$\begin{matrix}
{y\left( {kT_{s}} \right) = {\sum\limits_{n = 0}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}d_{k - ({N - 1})}}} + v_{kn}^{\prime},{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}} \\
\end{matrix}$$ $$\begin{matrix}
{v_{kn}^{\prime} = {\sum\limits_{n = 0}^{N - 1}{\beta_{n}\left( {kT_{s}} \right)v_{k - ({N - 1}) + n}}},{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}} \\
\end{matrix}$$ where *v* ~*kn*~′ is a Gaussian random variable with zero mean and ∑~*n*=0~ ^*N*−1^\|*β* ~*n*~(*kT* ~*s*~)\|^2^ *σ* ~*w*~ ^2^ variance. [Figure 3](#fig3){ref-type="fig"} shows the receiver block diagram for the code-time diversity scheme. The estimated data at the output of the detector is late (*N* − 1) symbol periods. This delay represents the time spread at which the transmitted symbol is repeated.

The last part of the demodulator is the detector. The optimum detector computes the Euclidian distance between the received symbol and all the symbols in the symbols constellation diagram. The detector decides that *d* ~*i*~ is transmitted if and only if the distance between *y*(*kT* ~*s*~) and *d* ~*i*~ is smaller than the distance between *y*(*kT* ~*s*~) and *d* ~*m*~ for all *m*: $$\begin{matrix}
\left. {}\text{choose}\,\, d_{i}\Longleftrightarrow d^{2}\left\langle {y\left( {kT_{s}} \right),d_{i}} \right\rangle < d^{2}\left\langle {y\left( {kT_{s}} \right),d_{m}} \right\rangle \right. \\
{\forall i \neq m.} \\
\end{matrix}$$ The combined signals in ([12](#EEq12){ref-type="disp-formula"}) are equivalent to that of *N*-branch MRC receiver. Therefore, the resulting diversity order from the new code-time diversity scheme with *N* spreading orthogonal codes and one transmission antenna is equal to that of the *N*-branch MRC receiver scheme.

It is important to emphasize on that the combined signals in ([12](#EEq12){ref-type="disp-formula"}) are similar to that of space-time MIMO system with *N* antennas at the transmitter and one antenna at the receiver or a space-time MIMO system with one antenna at the transmitter and *N* antennas at the receiver. The proposed code-time diversity system does not use additional encoders or decoders at the transmitter or the receiver such as the space-time encoder and decoder in the space-time MIMO system. No additional RF interface circuits or antennas are used in the code-time diversity. Spreading and dispreading circuits are the only used additional hardware. The disadvantage of the proposed code-time diversity system is the extended bandwidth used and the *N* symbol period delays that precede the detection of the first transmitted symbol.

*Probability of Symbol Error.* To determine the probability of symbol error in the proposed code-time diversity system, the decision variable is calculated first. The optimum detector calculates the decision variable by multiplying the signal in ([12](#EEq12){ref-type="disp-formula"}) with the conjugate of all the complex symbols on the constellation diagram. The estimated symbol is the symbol with the largest decision variable. If symbol *i* is the symbol transmitted at the *k*th symbol period, the largest decision variable will be where *v* ~*kn*~′′ is a Gaussian random variable with zero mean and ∑~*n*=0~ ^*N*−1^\|*β* ~*n*~(*kT* ~*s*~)\|^2^ *σ* ~*w*~ ^2^ *E* ~*s*~ variance. Therefore, the decision variable (DV) in ([16](#EEq16){ref-type="disp-formula"}) is also a Gaussian random variable with the following mean and variance:$$\begin{matrix}
{E\left\lbrack \text{DV} \right\rbrack = {\sum\limits_{n = 0}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}E_{s}}},} \\
\end{matrix}$$ $$\begin{matrix}
{{Var}\left\lbrack \text{DV} \right\rbrack = {\sum\limits_{n = 0}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}\sigma_{w}^{2}}}E_{s}.} \\
\end{matrix}$$According to the used modulation method, the probability of symbol error is always a function of the signal to noise ratio. This probability of error will be a random variable because the signal to noise ratio is a random variable. The instantaneous SNR is represented as shown in $$\begin{matrix}
{\text{SNR}\left( {kT_{s}} \right) = \frac{\sum_{n = 0}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}E_{s}}}{{2\sigma}_{w}^{2}},} \\
\end{matrix}$$ where \|*β* ~*n*~(*kT* ~*s*~)\|^2^ is a chi-square random variable. Thus, the conditional probability of symbol error is calculated first for a certain value of the SNR, and then the average probability of error is calculated by averaging the conditional probability of symbol error over the probability density function of the SNR. For *M*-QAM, the probability of symbol error is given by $$\begin{matrix}
{P_{\text{QAM}} = 4\left( {1 - \frac{1}{\sqrt{M}}} \right)Q\left( {} \right)} \\
{\quad - 4\left( {1 - \frac{1}{\sqrt{M}}} \right)^{2}Q^{2}\left( \sqrt{\frac{3}{M - 1}\frac{\sum_{n = 0}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}E_{s}}}{{2\sigma}_{w}^{2}}} \right).} \\
\end{matrix}$$ For simplicity ([19](#EEq19){ref-type="disp-formula"}) can be approximated by the first term only so that the *Q* ^2^(*x*) is ignored since *Q* ^2^(*x*)≪*Q*(*x*) \[[@B21]\]. In the case of nonfading channel, the probability of symbol error in code-time diversity system is $$\begin{matrix}
{P_{\text{QAM}} = 4\left( {1 - \frac{1}{\sqrt{M}}} \right)Q\left( \sqrt{\left( \frac{3}{M - 1} \right)\frac{{NE}_{s}}{{2\sigma}_{w}^{2}}} \right).} \\
\end{matrix}$$

For fading channel, the probability density function of the signal to noise ratio is equal to the probability density function (pdf) of a chi-square random variable with 2*N* degrees of freedom as shown in $$\begin{matrix}
{p\left( {\text{SNR}\left( {kT_{s}} \right)} \right)} \\
{\quad\quad = \frac{1}{\left( {N - 1} \right)!{\overset{-}{\text{SNR}}}^{N}}\left( {\text{SNR}\left( {kT_{s}} \right)} \right)^{N - 1}e^{{- ({\text{SNR}({kT_{s}})})}/\overset{-}{\text{SNR}}}.} \\
\end{matrix}$$ $\overset{-}{\text{SNR}}$ is the average signal to noise ratio per time slot or by diversity channel and it is given by $$\begin{matrix}
{\overset{-}{\text{SNR}} = \frac{E_{s}}{{2\sigma}_{w}^{2}}E\left\lbrack \left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2} \right\rbrack = \frac{\sigma_{\alpha}^{2}E_{s}}{2\sigma_{w}^{2}}.} \\
\end{matrix}$$ The average probability of symbol error is $$\begin{matrix}
{{\overset{-}{P}}_{\text{QAM}} = {\int\limits_{0}^{\infty}{P_{\text{QAM}} \cdot p\left( {\text{SNR}\left( {kT_{s}} \right)} \right) \cdot d\text{SNR}}}} \\
{= 4\left( {1 - \frac{1}{\sqrt{M}}} \right)\left( \frac{1}{\left( {N - 1} \right)!{\overset{-}{\text{SNR}}}^{N}} \right)} \\
{\quad \times {\int\limits_{0}^{\infty}{Q\left( \sqrt{\frac{3}{M - 1}\text{SNR}} \right) \cdot \text{SNR}^{N - 1}e^{{- \text{SNR}}/\overset{-}{\text{SNR}}} \cdot d\text{SNR.}}}} \\
\end{matrix}$$ After some mathematical manipulations, the exact value of the average probability of symbol error ${\overset{-}{P}}_{\text{QAM}}$ in code-time diversity is given by $$\begin{matrix}
{{\overset{-}{P}}_{\text{QAM}} = {\,\,}4\left( {1 - \frac{1}{\sqrt{M}}} \right)\left( \frac{1}{\left( {N - 1} \right)!{\overset{-}{\text{SNR}}}^{N}} \right)} \\
{{\quad \times \left( \frac{2\left( {M - 1} \right)}{3} \right)}^{N}\frac{\Gamma\left( {N + 1/2} \right)}{\sqrt{\pi}\left( {2N} \right)}} \\
{\quad \times {}_{2}F_{1}\left( {N,\frac{2N + 1}{2};N + 1;\frac{- 2\left( {M - 1} \right)}{3\overset{-}{\text{SNR}}}} \right).} \\
\end{matrix}$$ ~*p*~ *F* ~*q*~ is the generalized hyper-geometric function. It is defined in [Appendix A](#secA){ref-type="sec"}.

4.2. Limitations of the Used Spreading Codes {#sec4.2}
--------------------------------------------

The use of DSSS in the proposed code-time diversity system expands the transmitted signal bandwidth more than the bandwidth of the nonspread modulated symbols and also more than the bandwidth of the transmitted signal if a space-time coding MIMO system is used. Although the enlarged bandwidth in the code-time diversity system increases the channel capacity and increases the system resistance to jamming and interference signals, bandwidth efficiency of code-time diversity system is poor.

In order to increase the bandwidth efficiency in code-time diversity system, more than one user are allowed to share the same channel bandwidth but with a different set of orthogonal spreading codes. If *M* users share the same channel using the proposed diversity system, *M* × *N* orthogonal spreading codes are required. This increases the demands on the orthogonal spreading codes.

On the other hand, we can merely assign one PN sequence for each user in the multiuser code-time diversity system and by exploiting the autocorrelation property of the PN sequence, and the rest (*N* − 1) spreading codes required for the proposed diversity scheme can be generated from the same generator polynomial by cyclically shifting the generated sequence different (*N* − 1) times. For PN sequence with significant long period, the correlation between the generated PN sequence and its cyclically shifted sequences is very small but not zero. From \[[@B21]\], if *c*(*n*) is a PN sequence of period *N* ~*c*~, the autocorrelation between this sequence and its cyclic shift with *n* ~*i*~ chips is equals to $$\begin{matrix}
{\frac{1}{N_{c}}{\sum\limits_{m = 0}^{N_{c} - 1}{c\left( m \right) \cdot c\left( {m - n_{i}} \right)}}} \\
{\quad\quad = \begin{cases}
1 & {\forall n_{i} = 0,N_{c},2N_{c},{3N}_{c},\ldots} \\
{- \frac{1}{N_{c}}} & \text{else\ where.} \\
\end{cases}} \\
\end{matrix}$$ The use of multiuser DSSS system with code-time diversity enhances the bandwidth efficiency of the system, but in this case a multiuser detector should be used in the receiver shown in [Figure 3](#fig3){ref-type="fig"} instead of a single user detector. This point will be discussed in detail in a separate research, but now we continue with a single user detector case.

Equations ([20](#EEq20){ref-type="disp-formula"}) and ([24](#EEq24){ref-type="disp-formula"}) show the probability of error and the average probability of error in the received data for the case of nonfaded and faded channels, respectively, assuming that the used *N* spreading codes are mutually orthogonal. On the other hand if nonorthogonal codes are used such as a PN sequence and its cyclic shifted sequences, the correlation between the codes pairs affects the probability of error. This correlation gives rise to the intersymbol interference (ISI) between the transmitted symbols.

In nonorthogonal spreading code case, the output of each correlator with each spreading code consists of the desired signal and (*N* − 1) interference signals from the previous and proceeding transmitted symbols. The output of the proposed MRC (*y*(*kT* ~*s*~)) will have interference signals from the previous (*N* − 1) transmitted symbols and interference signals from the proceeding (*N* − 1) transmitted symbols. The *n*th correlator output at the *k*th symbol period is illustrated in $$\begin{matrix}
{x_{n}\left( {kT_{s}} \right) = {\int\limits_{0}^{T_{s}}{r\left( t \right) \cdot c_{n}\left( {t - kT_{s}} \right) \cdot dt}}} \\
{= {\alpha_{k}d}_{k - n} + {\sum\limits_{\substack{m = 0 \\ m \neq n}}^{N - 1}{\alpha_{k}\rho_{nm}d}_{k - m}} + v_{kn}.} \\
\end{matrix}$$ The first term in the right hand side is the desired signal, the middle term is the ISI from the previous and proceeding symbols according to the value of *n*, and the last term is the Gaussian noise component. *ρ* ~*nm*~ is the correlation between the spreading codes of index *n* and *m*: $$\begin{matrix}
{\rho_{nm} = {\int\limits_{0}^{T_{s}}{c_{n}\left( {t - kT_{s}} \right) \cdot c_{m}\left( {t - kT_{s}} \right) \cdot dt.}}} \\
\end{matrix}$$ According to ([26](#EEq26){ref-type="disp-formula"}), the output of the proposed MRC will be $$\begin{matrix}
{y\left( {kT_{s}} \right) = {\sum\limits_{n = 0}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}d_{k - ({N - 1})}}}} \\
{\quad + {\sum\limits_{n = 0}^{N - 1}{\sum\limits_{\substack{m = 0 \\ m \neq n}}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}\rho_{nm}d}_{k - ({N - 1}) + n - m}}} + v_{kn}^{\prime}.{\,\,}} \\
\end{matrix}$$ The decision variable of the optimum detector in [Figure 3](#fig3){ref-type="fig"} will be $$\begin{matrix}
{\text{DV} = y\left( {kT_{s}} \right) \cdot d_{k - {({N - 1})}}^{\ast} = {\sum\limits_{n = 0}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}E_{s}}}} \\
{\quad + {\sum\limits_{n = 0}^{N - 1}{\,{\sum\limits_{\substack{m = 0 \\ m \neq n}}^{N - 1}{{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}\rho_{nm}d}_{k - ({N - 1}) + n - m}d_{k - {({N - 1})}}^{\ast}}}}} + v_{kn}^{\prime\prime}.} \\
\end{matrix}$$ The decision variable in ([29](#EEq29){ref-type="disp-formula"}) is a complex random variable. The detector will make its decision according to the real part of this random variable. The transmitted symbols are almost uncorrelated, so that the mean value of the decision variable can be represented by $$\begin{matrix}
{E\left\lbrack \text{DV} \right\rbrack = {\sum\limits_{n = 0}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}E_{s}.}}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}} \\
\end{matrix}$$ The interference component in ([29](#EEq29){ref-type="disp-formula"}) can be treated as a noise signal added to the Gaussian noise component *v* ~*in*~′′. The noise signal and the interference signals have zero means and they are uncorrelated; thus the variance of their summation is equal to the summation of their individual variances. The variance of the noise is represented in ([17b](#EEq17b){ref-type="disp-formula"}). The variance of interference signal is $$\begin{matrix}
{{Var}\left\lbrack {\sum\limits_{n = 0}^{N - 1}{\sum\limits_{\substack{m = 0 \\ m \neq n}}^{N - 1}{{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}\rho_{nm}d}_{k - ({N - 1}) + n - m}d_{k - {({N - 1})}}^{\ast}}}} \right\rbrack} \\
{\quad\quad = E_{s}^{2}{\sum\limits_{n = 0}^{N - 1}{\sum\limits_{\substack{m = 0 \\ m \neq n}}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{4}\rho_{nm}^{2}.}}}} \\
\end{matrix}$$ The noise and interference variance will be $$\begin{matrix}
{{Var}\left\lbrack {{\sum\limits_{n = 0}^{N - 1}{\sum\limits_{\substack{m = 0 \\ m \neq n}}^{N - 1}{{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}\rho_{nm}d}_{k - ({N - 1}) + n - m}d_{k - {({N - 1})}}^{\ast}}}} + v_{kn}^{\prime\prime}{\,\,}} \right\rbrack} \\
{\quad\quad{= E}_{s}^{2}{\sum\limits_{n = 0}^{N - 1}{\sum\limits_{\substack{m = 0 \\ m \neq n}}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{4}\rho_{nm}^{2}}}} + E_{s}\sigma_{w}^{2}{\sum\limits_{n = 0}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}.}}} \\
\end{matrix}$$ The cross-correlation between a PN sequence and any of its shifted versions is constant and independent on the shift value as long as the shift is not zero or integer multiples of the code period. So, the noise and interference variance in ([32](#EEq32){ref-type="disp-formula"}) can be simplified to $$\begin{matrix}
{{Var}\left\lbrack {{\sum\limits_{n = 0}^{N - 1}{\sum\limits_{\substack{m = 0 \\ m \neq n}}^{N - 1}{{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}\rho_{nm}d}_{k - ({N - 1}) + n - m}d_{k - {({N - 1})}}^{\ast}}}} + v_{kn}^{\prime\prime}{\,\,}} \right\rbrack} \\
{\quad\quad = {\left( N - 1 \right)\rho^{2}E}_{s}^{2}{\sum\limits_{n = 0}^{N - 1}\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{4}} + E_{s}\sigma_{w}^{2}{\sum\limits_{n = 0}^{N - 1}{\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}.}}} \\
\end{matrix}$$ From ([30](#EEq30){ref-type="disp-formula"}) and ([33](#EEq33){ref-type="disp-formula"}), the signal to interference and noise ratio SINR(*kT* ~*s*~) is a random variable and its instantaneous value is defined by $$\begin{matrix}
{\text{SINR}\left( {kT_{s}} \right)} \\
{\quad = \frac{\left( {E\left\lbrack \text{DV} \right\rbrack} \right)^{2}}{2{Var}\left\lbrack \text{DV} \right\rbrack}} \\
{\quad = \frac{E_{s}\left( {\sum_{n = 0}^{N - 1}\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}} \right)^{2}}{2\left( {N - 1} \right)\rho^{2}E_{s}{\sum_{n = 0}^{N - 1}\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{4}}{+ 2\sigma}_{w}^{2}{\sum_{n = 0}^{N - 1}\left| {\beta_{n}\left( {kT_{s}} \right)} \right|^{2}}}.} \\
\end{matrix}$$ The average probability of error will be $$\begin{matrix}
{P_{\text{QAM}} = E\left\lbrack {4\left( {1 - \frac{1}{\sqrt{M}}} \right)Q} \right.} \\
{\times \left( \left( {3 \times \left( {M - 1} \right)^{- 1}} \right) \right.} \\
{\times \left( {E_{s}\left( {\sum\limits_{n = 0}^{N - 1}\left| {\beta_{n}\left( {iT_{s}} \right)} \right|^{2}} \right)^{2}} \right.} \\
{\times \left( {2\left( N - 1 \right)\rho^{2}E_{s}{\sum\limits_{n = 0}^{N - 1}\left| {\beta_{n}\left( {iT_{s}} \right)} \right|^{4}}} \right.} \\
{\left. \left. \left. \left. {{+ 2\sigma}_{w}^{2}{\sum\limits_{n = 0}^{N - 1}\left| {\beta_{n}\left( {iT_{s}} \right)} \right|^{2}}} \right)^{- 1} \right)^{1/2} \right) \right\rbrack.} \\
\end{matrix}$$

The calculation of the exact value of the pdf of the SINR random variable in ([35](#EEq35){ref-type="disp-formula"}) is so difficult. So, another procedure is followed. The unknown pdf of SINR is calculated and plotted numerically using a lot of random samples of the SINR random variable (more than 10^6^ random samples). The plotted pdf is compared with the other pdf functions of some well-known random variables such as Weibull, Nakagami, and Gaussian random variables. After a lot of trials, it is found that the unknown pdf of the SINR random variable in ([34](#EEq34){ref-type="disp-formula"}) is very close to the pdf of Nakagami random variables as illustrated in [Figure 4](#fig4){ref-type="fig"}.

The figure contains the pdf of Weibull, Nakagami, and Gaussian random variables that are calculated according to the statistical averages of the samples of the SINR. At low average SINR, the unknown pdf is very close to the Nakagami pdf, but at high average SINR it will be closer to the Gaussian pdf since the Nakagami pdf comes closer to the pdf of the Gaussian random variable at high average SINR too. Increasing the diversity order increases the average SINR; thus at high diversity order, the unknown pdf of SINR can be approximated by the pdf of the Gaussian random variable. This result matches the center limit theory of random variables. Although the unknown pdf of SINR is close to Gaussian pdf at high average SINR, Nakagami pdf will be used to approximate this unknown pdf since Nakagami pdf gives a good approximation of the unknown pdf of SINR at low and high average values of SINR. Equation ([36](#EEq36){ref-type="disp-formula"}) is the probability density function of a Nakagami random variable: $$\begin{matrix}
{p_{\text{SINR}}\left( \text{SINR} \right) = \frac{2}{\Gamma\left( m \right)} \cdot \left( \frac{m}{\Omega} \right)^{m}\text{SINR}^{2m - 1}e^{- ({m/\Omega})\text{SINR}^{2}},{\,\,}{\,\,}{\,\,}} \\
\end{matrix}$$ where *m* is the shape parameter and *Ω* is the scale parameter. The shape and scale parameters are related to the mean and the variance of the SINR random variable \[[@B24]\]: $$\begin{matrix}
{m = \left( \frac{\left( {E\left\lbrack \text{SINR}^{2} \right\rbrack} \right)^{2}}{\text{var}\left\lbrack \text{SINR}^{2} \right\rbrack} \right),\quad\quad\Omega = E\left\lbrack \text{SINR}^{2} \right\rbrack.{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}} \\
\end{matrix}$$ Now, the average probability of error will be $$\begin{matrix}
{\overset{-}{P}}_{\text{QAM}} \\
{\quad\quad = {\int\limits_{0}^{\infty}{P_{\text{QAM}} \cdot p\left( {\text{SINR}\left( {kT_{s}} \right)} \right) \cdot d\text{SINR}}}} \\
{\quad\quad = 2\left( {1 - \frac{1}{\sqrt{M}}} \right)\frac{2}{\Gamma\left( m \right)} \cdot \left( \frac{m}{\Omega} \right)^{m}} \\
{\quad\quad\quad \times {\int\limits_{0}^{\infty}{{erfc}\left( \sqrt{\frac{3}{2\left( {M - 1} \right)}\text{SINR}} \right){\,\,}}}} \\
{\quad\quad\quad \times \text{SINR}^{2m - 1}e^{- ({m/\Omega})\text{SINR}^{2}} \cdot d\text{SINR,}} \\
\end{matrix}$$ $$\begin{matrix}
{\overset{-}{P}}_{\text{QAM}} \\
{\quad = \left( {1 - \frac{1}{\sqrt{M}}} \right)\frac{2^{1 - m}\Gamma\left( 2m \right)}{\Gamma\left( m \right)}} \\
{\quad\quad \cdot \left( {\frac{1}{3} \cdot e^{({({9/(32{({M - 1})}^{2}}) \cdot ({\Omega/m})})} \cdot D_{- 2m}\left( \sqrt{\frac{9}{8\left( {M - 1} \right)^{2}} \cdot \frac{\Omega}{m}} \right)} \right.} \\
{\left. {+ e^{({({1/(2{({M - 1})}^{2}}) \cdot ({\Omega/m})})} \cdot D_{- 2m}\left( \sqrt{\frac{2}{\left( {M - 1} \right)^{2}} \cdot \frac{\Omega}{m}} \right)} \right).} \\
\end{matrix}$$ *D* ~*p*~(*z*) is the parabolic cylindrical function defined in \[[@B25]\]. The complete derivation of the average probability of symbol error in ([39](#EEq39){ref-type="disp-formula"}) is represented in [Appendix B](#secB){ref-type="sec"}. If Gaussian pdf is used to model the pdf of SINR in ([34](#EEq34){ref-type="disp-formula"}), the average probability of symbol error will be $$\begin{matrix}
{{\overset{-}{P}}_{\text{QAM}} = 2\left( {1 - \frac{1}{\sqrt{M}}} \right)} \\
{\quad \cdot \left( {\frac{1}{6}e^{({({(9\sigma^{2})/({8{({M - 1})}^{2}})}){\,\,} - ({3\mu/2({M - 1})})})}} \right.} \\
{\left. {+ \frac{1}{2}e^{({({(2\sigma^{2})/{({M - 1})}^{2}}){\,\,} - ({2\mu/(M - 1)})})}} \right),} \\
\end{matrix}$$ $$\begin{matrix}
{\mu = E\left\lbrack \text{SINR} \right\rbrack,\quad\quad\sigma^{2} = E\left\lbrack \left( {\text{SINR} - \mu} \right)^{2} \right\rbrack.} \\
\end{matrix}$$

4.3. Multipath Rayleigh Channel {#sec4.3}
-------------------------------

The impulse response of the multipath fading channel is shown in ([42](#EEq42){ref-type="disp-formula"}). Quasistatic channel is also assumed where the fading gain *α* ~*l*~ of the *l*th path is fixed during one symbol period and it is changed randomly from one symbol to another: $$\begin{matrix}
{h\left( t \right) = {\sum\limits_{l = 0}^{L - 1}{\alpha_{l}\delta\left( t - \tau_{l} \right)}},} \\
\end{matrix}$$ where *α* ~*l*~ is a complex Gaussian random variable with zero mean and *σ* ~*α*~*l*~~ ^2^ variance. *τ* ~*l*~ is the *l*th path delay. *L* is the number of the uncorrelated fading paths from the transmitter to the receiver. The frequency components of the signal will experience different magnitudes of fading. In our proposed diversity scheme, the multipath fading case looks like the MIMO system where multiple antennas transmit the modulated symbols and multiple antennas at the receiver picked them up. According to our signal model, the received signal at the demodulator input is $$\begin{matrix}
{r\left( t \right) = {\sum\limits_{k = 0}^{K - 1}{\,{\sum\limits_{n = 0}^{N - 1}{\,{\sum\limits_{l = 0}^{L - 1}{{\alpha_{kl}d}_{k - n}c_{n}\left( t - kTs - \tau_{l} \right)}}}}}} + w\left( t \right).{\,\,}{\,\,}{\,\,}} \\
\end{matrix}$$ As shown in ([1](#EEq1){ref-type="disp-formula"}), the number of the paths *L* depends on the bandwidth of the DSSS signal and the coherence bandwidth of the channel. By increasing the process gain of the DSSS system, the number of the uncorrelated propagation paths is increased.

Here a new important note should be mentioned. The idea of the proposed diversity scheme is based on transmitting each symbol through more than one symbol period using separate spreading codes. As shown in the previous section, a PN code with different cyclic shifts may be used to encode each data symbol. In multipath fading channel, improper choice of the different shift values increases the ISI because the different channel delays may be equal to the shift values in the used PN code. So a condition should be made on the shift values of the PN code: $$\begin{matrix}
{m_{n}T_{c} \neq \tau_{l}\quad\forall\,\text{values\ of}{\,\,}m_{n},\,{\,\tau}_{l} \in \left\lbrack {0{\,\,}T_{m}} \right\rbrack,} \\
\end{matrix}$$ where *m* ~*n*~ is an integer number, which represents the number of chips by which the PN code is shifted to form the *n*th code sequence in the used set of *N* spreading codes. *T* ~*m*~ is the multipath delay spread and it represents the maximum delay of the longest path through which the signal propagates. One of the solutions of the inequality in ([44](#EEq44){ref-type="disp-formula"}) is $$\begin{matrix}
{\max\left( {m_{n}T_{c}} \right) < \min\left( \tau_{l} \right).} \\
\end{matrix}$$ The proposed demodulator for the code-time diversity system with multipath fading channel is more complex than the demodulator shown in [Figure 3](#fig3){ref-type="fig"} for flat fading channel. The demodulator consists of three parts too, but the first part of this demodulator is a bank of *NL*-fingers RAKE filters instead of *N* correlators. Each *L*-fingers RAKE filter correlates the received signal with *L* PN sequences. These sequences are generated from one PN code from the used set of *N* spreading PN codes according to the set of channel delays *τ* ~*l*~. [Figure 5](#fig5){ref-type="fig"} shows the structure of the *L* figure RAKE filter that correlates the received data with the *n*th PN code in the spreading codes set.

The time resolution between the uncorrelated paths in the used RAKE receiver is *T* ~*c*~. In each finger of the RAKE filter, the delayed received signal is correlated with the *n*th PN code that is shifted with an integer number of chips equal to the path delay of that finger. Conventional MRC is used to combine the output of the *L*-fingers to form the random variable *x* ~*n*~(*kT* ~*s*~). The output of the *l*th correlator in the *n*th RAKE filter is The first term in ([46](#EEq46){ref-type="disp-formula"}) is the desired signal. The second term is the ISI signal that comes from the (*N* − 1) symbols transmitted through the same symbol period. This ISI signal is due to the correlation between the used spreading codes. The third term is another ISI signals that come from the other (*L* − 1) fading paths. The last term is the noise random variable. Using ([46](#EEq46){ref-type="disp-formula"}), the output of the *n*th RAKE filter is $$\begin{matrix}
{x_{n}\left( {kT_{s}} \right) = {\sum\limits_{l = 0}^{L - 1}{\left| \alpha_{kl} \right|^{2}d}_{k - n}} + {\sum\limits_{l = 0}^{L - 1}{\sum\limits_{m \neq n}^{N - 1}{\left| \alpha_{kl} \right|^{2}{\rho_{nm}d}_{k - m}}}}} \\
{\quad + {\sum\limits_{l = 0}^{L - 1}{\,{\sum\limits_{m = 0}^{N - 1}{\,{\sum\limits_{l^{\prime} \neq l}^{L - 1}{\beta_{kl^{\prime}}\rho_{nm}\left( {l^{\prime},l} \right)d_{k - m - m_{l^{\prime}}}}}}}}} + v_{kn}} \\
{\beta_{ll^{\prime}} = \alpha_{kl^{\prime}} \cdot \alpha_{kl}^{\ast}.} \\
\end{matrix}$$ The last term *v* ~*kn*~ is a Gaussian random variable with zero mean and ∑~*l*=0~ ^*L*−1^\|*α* ~*kl*~\|^2^ *σ* ~*w*~ ^2^ variance. The second part of the proposed demodulator is the delayed symbols combiner. The DSC delays the output random variable from each RAKE filter according to the index of the PN sequence used in this RAKE filter. The output of the RAKE filter with the code sequence *c* ~*n*~(*t*) is delayed ((*N* − 1) − *n*) symbol periods. [Figure 6](#fig6){ref-type="fig"} presents the structure of DSC.

The delayed signals are finally added to form a single input to the detector. The output of the DSC in the *z*-domain can be represented by $$\begin{matrix}
{Y\left( z \right) = X_{0}\left( z \right)z^{- (N - 1)} + X_{1}\left( z \right)z^{- ({N - 1}) + 1}} \\
{\quad + X_{2}\left( z \right)z^{- ({N - 1}) + 2} + \cdots + X_{N - 1}\left( z \right).} \\
\end{matrix}$$ The output of the DSC combiner at the *k*th symbol period is represented by $$\begin{matrix}
{y\left( {kT_{s}} \right) = {\sum\limits_{n = 0}^{N - 1}{x_{n}\left( {\left( {k - \left( {N - 1} \right) + n} \right)T_{s}} \right)}} + v_{kn}^{\prime},} \\
\end{matrix}$$ $$\begin{matrix}
{y\left( {kT_{s}} \right) = {\sum\limits_{n = 0}^{N - 1}{\,{\sum\limits_{l = 0}^{L - 1}{\left| {\alpha_{nl}\left( {kT_{s}} \right)} \right|^{2}d}_{k - ({N - 1})}}}}} \\
{\quad + {\sum\limits_{n = 0}^{N - 1}{\,{\sum\limits_{l = 0}^{L - 1}{\,{\sum\limits_{m \neq n}^{N - 1}{\left| {\alpha_{nl}\left( {kT_{s}} \right)} \right|^{2}{\rho_{nm}d}_{k - ({N - 1}) + n - m}}}}}}}} \\
{\quad + {\sum\limits_{n = 0}^{N - 1}{\,{\sum\limits_{l = 0}^{L - 1}{\,{\sum\limits_{m = 0}^{N - 1}{\,{\sum\limits_{l^{\prime} \neq l}^{L - 1}{\beta_{nll^{\prime}}\left( kT_{s} \right)\rho_{nm}\left( {l^{\prime},l} \right)}}}}}}}}} \\
{\times d_{k - ({N - 1}) + n - m - m_{l^{\prime}}} + v_{kn}^{\prime},} \\
\end{matrix}$$ $$\begin{matrix}
{v_{kn}^{\prime} = {\sum\limits_{n = 0}^{N - 1}{\,{\sum\limits_{l = 0}^{L - 1}{\beta_{nl}\left( {kT_{s}} \right)v_{k - ({N - 1}) + n}\left( l \right),}}}}} \\
\end{matrix}$$ where *v* ~*in*~′ is a Gaussian random variable with zero mean and ∑~*n*=0~ ^*N*−1^∑~*l*=0~ ^*L*−1^\|*α* ~*nl*~(*kT* ~*s*~)\|^2^ *σ* ~*w*~ ^2^ variance. As in flat fading case, the estimated data at the output of the detector is delayed (*N* − 1) symbol periods. This delay represents the time spread at which the transmitted symbol is repeated. If the correlation between the used spreading codes is zero, the combined signal in ([51](#EEq52){ref-type="disp-formula"}) will be $$\begin{matrix}
{y\left( {kT_{s}} \right) = {\sum\limits_{n = 0}^{N - 1}{\,{\sum\limits_{l = 0}^{L - 1}{\left| {\alpha_{nl}\left( {kT_{s}} \right)} \right|^{2}d}_{k - ({N - 1})}}}} + v_{kn}^{\prime}.} \\
\end{matrix}$$ The last part of the demodulator is the detector. The estimated symbol at the output of the detector is the symbol with the minimum distance to the detector input as shown in ([14](#EEq14){ref-type="disp-formula"}).

The combined signals in ([53](#EEq53){ref-type="disp-formula"}) are equivalent to that of (*L* × *N*)-branch MRC receiver. Thus, the resulting diversity order of the new code-time transmit diversity scheme with *N* spreading orthogonal codes and one transmitting and receiving antenna in frequency selective channel with *L* faded paths is equal to that of the (*L* × *N*)-branch MRC receiver scheme.

The combined signals in ([53](#EEq53){ref-type="disp-formula"}) are also similar to that of space-time MIMO system with *N* antennas at the transmitter and *L* antennas at the receiver. The proposed code-time diversity system does not use additional encoders or decoders at the transmitter or the receiver such as the space-time encoder and decoders in the space-time MIMO systems. No additional RF interface circuits or antennas are used in the code-time diversity. Spreading and dispreading circuits are the only used additional hardware. Although the code-time diversity has the disadvantage of low bandwidth efficiency due to the usage of DSSS, the extended bandwidth in DSSS increases the channel capacity and the DSSS can resist the jamming and noncochannel interference signals.

The ISI signals that appear in ([51](#EEq52){ref-type="disp-formula"}) can be eliminated or neglected if the correlation between the spreading codes is zero or very small, respectively. If spreading codes with unavoidable cross-correlation are used as PN sequences, the ISI signals can be minimized by using long codes sequences or by using linear equalizers.

To determine the probability of error in the proposed code-time diversity system in frequency selective channel, the same procedure as that used in flat fading channel case is followed. The decision variable in the detector is calculated first. Then the conditional probability of error is calculated given a fixed set of channel gains. Finally the average probability of error is calculated based on the probability density function of the decision variable. Based on ([53](#EEq53){ref-type="disp-formula"}), the decision variable for the case of orthogonal spreading codes is $$\begin{matrix}
{\text{DV} = {\sum\limits_{n = 0}^{N - 1}{\sum\limits_{l = 0}^{L - 1}{\left| {\alpha_{nl}\left( {kT_{s}} \right)} \right|^{2}E}_{s}}} + v_{in}^{\prime\prime},} \\
\end{matrix}$$ where *v* ~*in*~′′ is a Gaussian random variable with zero mean and ∑~*n*=0~ ^*N*−1^∑~*l*=0~ ^*L*−1^\|*α* ~*nl*~(*kT* ~*s*~)\|^2^ *E* ~*s*~ *σ* ~*w*~ ^2^ variance and \|*α* ~*nl*~(*kT* ~*s*~)\|^2^ is a chi-square random variable with two degrees of freedom. The instantaneous SNR is $$\begin{matrix}
{\text{SNR} = \frac{{E\left\lbrack \text{DV} \right\rbrack}^{2}}{2\,\text{var}\left\lbrack \text{DV} \right\rbrack} = \frac{E_{s}{\sum_{n = 0}^{N - 1}{\sum_{l = 0}^{L - 1}\left| {\alpha_{nl}\left( {kT_{s}} \right)} \right|^{2}}}}{2\sigma_{w}^{2}}.} \\
\end{matrix}$$ SNR in ([55](#EEq55){ref-type="disp-formula"}) is a chi-square with 2*N* × *L* degrees of freedom. The pdf of the SNR random variable is represented in ([21](#EEq21){ref-type="disp-formula"}) where *NL* replaces *N*. The average probability of error of code-time diversity system in *L*-paths Raleigh fading channel is $$\begin{matrix}
{{\overset{-}{P}}_{\text{QAM}} = {\,\,}4\left( {1 - \frac{1}{\sqrt{M}}} \right)\left( \frac{1}{\left( {N - 1} \right)!{\overset{-}{\text{SNR}}}^{NL}} \right)} \\
{\quad \times \left( \frac{2\left( {M - 1} \right)}{3} \right)^{NL}\frac{\Gamma\left( {NL + \left( {1/2} \right)} \right)}{\sqrt{\pi}\left( {2NL} \right)}} \\
{\quad \times {\,\,}_{2}F_{1}\left( {NL,\frac{2NL + 1}{2};N + 1;\frac{- 2\left( {M - 1} \right)}{3\overset{-}{\text{SNR}}}} \right).} \\
\end{matrix}$$ In nonorthogonal spreading code case, the detector decision variable is $$\begin{matrix}
{\text{DV} = {\sum\limits_{n = 0}^{N - 1}{\sum\limits_{l = 0}^{L - 1}{\left| {\alpha_{nl}\left( {kT_{s}} \right)} \right|^{2}E}_{s}}}} \\
{\quad + {\sum\limits_{n = 0}^{N - 1}{\sum\limits_{l = 0}^{L - 1}{\sum\limits_{m \neq n}^{N - 1}{\left| {\alpha_{nl}\left( {kT_{s}} \right)} \right|^{2}{\rho_{nm}d}_{k - ({N - 1}) + n - m}}}}} \cdot d_{k - {({N - 1})}}^{\ast}} \\
{\quad + {\sum\limits_{n = 0}^{N - 1}{\sum\limits_{l = 0}^{L - 1}{\sum\limits_{m = 0}^{N - 1}{\sum\limits_{l^{\prime} \neq l}^{L - 1}{\beta_{nll^{\prime}}\left( kT_{s} \right)\rho_{nm}\left( {l^{\prime},l} \right)}}}}}d_{k - ({N - 1}) + n - m - m_{l^{\prime}}}} \\
{\cdot d_{k - {({N - 1})}}^{\ast} + v_{in}^{\prime\prime}.} \\
\end{matrix}$$

Following the same procedure as Rayleigh flat fading case, the instantaneous SINR is$$\begin{matrix}
{\text{SINR}\left( {kT_{s}} \right)} \\
{= \frac{E_{s}\left( {\sum_{n = 0}^{N - 1}{\sum_{l = 0}^{L - 1}\left| {\alpha_{nl}\left( {kT_{s}} \right)} \right|^{2}}} \right)^{2}}{\left( {N - 1} \right)\rho^{2}E_{s}\left( {{\sum_{n = 0}^{N - 1}{\sum_{l = 0}^{L - 1}\left| {\alpha_{nl}\left( {kT_{s}} \right)} \right|^{4}}} + {\sum_{n = 0}^{N - 1}{\sum_{l = 0}^{L - 1}{\sum_{l^{\prime} \neq l}^{L - 1}\left| {\beta_{{nll}^{\prime}}\left( {kT_{s}} \right)} \right|^{2}}}}} \right) + 2\sigma_{w}^{2}{\sum_{n = 0}^{N - 1}{\sum_{l = 0}^{L - 1}\left| {\alpha_{nl}\left( {kT_{s}} \right)} \right|^{2}}}}.} \\
\end{matrix}$$

Numerical calculations of the pdf of the SINR random variable in ([58](#EEq58){ref-type="disp-formula"}) show that the SINR random variable can also be approximated to a Nakagami random variable as represented in [Section 4.2](#sec4.2){ref-type="sec"}. Following the same procedure, the average probability of symbol error of code-time diversity system in *L*-paths Rayleigh fading channel with nonorthogonal spreading codes is $$\begin{matrix}
{{\overset{-}{P}}_{\text{QAM}} =} \\
{\left( {1 - \frac{1}{\sqrt{M}}} \right)\frac{2^{1 - mL}\Gamma\left( 2mL \right)}{\Gamma\left( mL \right)}} \\
{\quad \cdot \left( {\frac{1}{3} \cdot e^{({({9/({32{(M - 1)}^{2}})}) \cdot ({L\Omega/m})})}} \right. \cdot D_{- 2m}\left( \sqrt{\frac{9}{8\left( {M - 1} \right)^{2}} \cdot \frac{L\Omega}{m}} \right)} \\
{\left. {+ e^{({({1/(2{({M - 1})}^{2}}) \cdot ({L\Omega/m})})} \cdot D_{- 2m}\left( \sqrt{\frac{2}{\left( {M - 1} \right)^{2}} \cdot \frac{L\Omega}{m}} \right)} \right).} \\
\end{matrix}$$

If Gaussian pdf is used to approximate the pdf of SINR, the average probability of symbol error will be $$\begin{matrix}
{{\overset{-}{P}}_{\text{QAM}} = 2\left( {1 - \frac{1}{\sqrt{M}}} \right)} \\
{\quad \cdot \left( {\frac{1}{6}e^{({3L/2})({(3\sigma^{2})/({4{(M - 1)}^{2}}) - ({\mu/(M - 1)})})}} \right.} \\
{\left. {+ \frac{1}{2}e^{2L({({\sigma^{2}/{(M - 1)}^{2}{\,\,}}) - ({\mu/(M - 1)})})}} \right).} \\
\end{matrix}$$

5. Simulations {#sec5}
==============

The proposed code-time diversity system is simulated using a DSSS system. Two different spreading codes are used. Walsh codes simulate the case of orthogonal codes\' set; however, PN codes simulate the case of nonorthogonal codes\' set. Different number of spreading codes *N* is used to achieve transmitter diversity. The used modulation scheme is 16-QAM. The transmitted symbols rate is 5 M symbol/s. The transmitted signal carrier frequency is 10 GHz. The used process gains are 11.78 dB and 15 dB. The transmitted signal bandwidths are 150 MHz and 310 MHz according to the used spreading code and its process gain.

Figures [7](#fig7){ref-type="fig"} and [8](#fig8){ref-type="fig"} show the average probability of bit error in the received data when code-time diversity is used in Rayleigh flat fading channel. The simulated system used *N*  = 2, 4, 6, and 8 code sequences. For nonorthogonal code set, PN sequences with 31 chips period and 15 chips period are used. [Figure 7](#fig7){ref-type="fig"} contains the probability of error curves for *N*  = 2, 6 and [Figure 8](#fig8){ref-type="fig"} contains the curves of *N*  = 4, 8. In orthogonal codes case, the proposed system achieved diversity gain proportional to the number of the used codes *N*. Increasing the code diversity by increasing *N* will increase the diversity order and enhance the system performance. The orthogonality between the used codes prevents the ISI from appearing. The probability of error curves of the orthogonal codes case in these figures is the same as the probability of error curves of the diversity systems in \[[@B23]\] using the same diversity order. The curves also realize ([24](#EEq24){ref-type="disp-formula"}) for Rayleigh flat fading channel. The figures likewise show the case of nonorthogonal codes where the ISI appeared. The ISI increases the average probability of error as shown in ([39](#EEq39){ref-type="disp-formula"}) and ([40](#EEq40){ref-type="disp-formula"}). If the code period of the used code increases, the cross-correlation between the codes pairs decreased and the average probability of error is improved.

The code-time diversity system is simulated in Rayleigh frequency selective channel with *L* = 2 and 4. As shown before, the performance of the proposed code-time diversity system in frequency selective channel is similar to the performance of the MIMO diversity system. The diversity order in the proposed system will equal the multiplication of the number of used codes (*N*) in the transmitter by the number of the signal paths (*L*) of the channel. [Figure 9](#fig9){ref-type="fig"} shows the average bit error rate in the received data for *N* = 2 and *L* = 2; that is, diversity order is 4. The proposed code-time diversity system is simulated using orthogonal and nonorthogonal codes. In orthogonal codes case, the average probability of error matches the values of ([56](#EEq56){ref-type="disp-formula"}) and the average probability of error in 2 × 2 MIMO system in \[[@B23]\]. On the other hand, the nonorthogonal codes case gives rise to ISI and the average probability of error will increase. As the code period increases, the correlation between the different codes pairs decreases and so the ISI between the successive symbols. The same results are achieved in Figures [10](#fig10){ref-type="fig"} and [11](#fig11){ref-type="fig"} for *N* = 4, *L* = 2 and *N* = 4, *L* = 4 cases, respectively. Furthermore, the performance of the simulated systems for orthogonal code case in Figures [10](#fig10){ref-type="fig"} and [11](#fig11){ref-type="fig"} is the same as the performance of 4 × 2 and 4 × 4 MIMO systems in \[[@B23]\], respectively.

6. Conclusions {#sec6}
==============

The proposed code-time diversity is a diversity system suitable for direct sequence spread spectrum. The proposed diversity scheme uses single RF interface unit and single antenna at the transmitter and receiver. The proposed system achieves the benefits of diversity systems as well as the benefits of spread spectrum systems. If orthogonal spreading codes are used, the performance of the code-time diversity system is similar to the performance of the MIMO system with the same diversity order. The code-time diversity can achieve a higher diversity order than the MIMO system, which is limited with the number of the used antennas and the RF interface units. The proposed system is suitable for working in flat and frequency selective channels. The proposed system also gives a good performance if nonorthogonal codes are used as long as the cross-correlation between the used codes pairs is small enough. The paper represents mathematical derivations of the probability of error of the proposed system in nonfaded and Rayleigh faded channels for orthogonal and nonorthogonal spreading codes. The disadvantage of the proposed system is the bandwidth efficiency. This disadvantage can be enhanced if multiusers are allowed to share the same channel bandwidth with different spreading codes set.

The author would like to express his special appreciation and thanks to his Advisors Professors Dr. Abdel-Wahab Fayez, Dr. Abdel Aziz M. AL-Bassiouni, and Dr. Khaled Talaat; they have been tremendous mentors for him. The author would like to thank them for encouraging his research and for allowing him to grow as a research scientist. Special thanks are due to Professor Mohamed Saad al-Juhani, the dean of the Faculty of Engineering in Northern Border University, Saudi Arabia, for his encouragement and support to him to finish up this work.

A. Definition of the Generalized Hypergeometric Function {#secA}
========================================================

The generalized hypergeometric function ~*p*~ *F* ~*q*~ has a series expansion as shown in the following equation: $$\begin{matrix}
{{\,\,}_{p}F_{q}\left( {\left\{ {a_{1},a_{2},\ldots{,a}_{p{\,\,}}} \right\};\left\{ {b_{1},b_{2},\ldots{,b}_{q}} \right\};z} \right)} \\
{\quad\quad = {\sum\limits_{k = 0}^{\infty}\frac{\left( a_{1} \right)_{k}{\cdots\left( a_{p} \right)}_{k}}{\left( b_{1} \right)_{k}\cdots\left( b_{q} \right)_{k}}} \cdot \frac{z^{k}}{k!}.} \\
\end{matrix}$$ This mathematical function is suitable for both symbolic and numerical manipulation. (*a*)~*k*~ is the Pochhammer symbol defined as $$\begin{matrix}
{\left( a \right)_{k} = \frac{\Gamma\left( a + k \right)}{\Gamma\left( a \right)}.} \\
\end{matrix}$$

B. The Evaluation of the Integration in ([38](#EEq38){ref-type="disp-formula"}) {#secB}
===============================================================================

Starting from ([38](#EEq38){ref-type="disp-formula"}), $$\begin{matrix}
{{\overset{-}{P}}_{\text{QAM}} = {\int\limits_{0}^{\infty}{P_{\text{QAM}} \cdot p\left( {\text{SINR}\left( {kT_{s}} \right)} \right) \cdot d\text{SINR}}}} \\
{= 2\left( {1 - \frac{1}{\sqrt{M}}} \right)\frac{2}{\Gamma\left( m \right)} \cdot \left( \frac{m}{\Omega} \right)^{m}} \\
{\quad \times {\int\limits_{0}^{\infty}{{erfc}\left( \sqrt{\frac{3}{2\left( {M - 1} \right)}\text{SINR}} \right){\,\,}}}} \\
{\times \text{SINR}^{2m - 1}e^{- ({m/\Omega})\text{SINR}^{2}} \cdot d\text{SINR.}} \\
\end{matrix}$$ From \[[@B26]\], the *erfc*⁡() can be approximated to $$\begin{matrix}
{{erfc}\left( x \right) \approx \frac{1}{6}e^{- x^{2}} + \frac{1}{2}e^{({- 4/3})x^{2}}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}{\,\,}} \\
\end{matrix}$$ $$\begin{matrix}
{\overset{-}{P}}_{\text{QAM}} \\
{\quad = 2\left( {1 - \frac{1}{\sqrt{M}}} \right)\frac{2}{\Gamma\left( m \right)} \cdot \left( \frac{m}{\Omega} \right)^{m}} \\
{\quad\quad \times \left\lbrack {\int\limits_{0}^{\infty}{\frac{1}{6}\text{SINR}}^{2m - 1}} \right.e^{- ({m/\Omega})\text{SINR}^{2}}e^{- ({a/2})\text{SINR}} \cdot d\text{SINR}} \\
{\left. {+ {\int\limits_{0}^{\infty}{{\frac{1}{2}\text{SINR}}^{2m - 1}e^{- ({m/\Omega})\text{SINR}^{2}}e^{- ({2a/3})\text{SINR}} \cdot d\text{SINR}}}} \right\rbrack,} \\
\end{matrix}$$ where *a* = 3/(*M* − 1).

From  3.462 in \[[@B25]\], $$\begin{matrix}
{{\int\limits_{0}^{\infty}{x^{v - 1} \cdot e^{- Bx^{2}} \cdot e^{- \gamma x} \cdot dx}} = \left( {2B} \right)^{- v/2}\Gamma\left( v \right)e^{\gamma^{2}/8B}D_{- v}\left( \frac{\gamma}{\sqrt{2B}} \right).} \\
\end{matrix}$$ Referring to ([B.3](#EEqB.3){ref-type="disp-formula"}), *v* = 2*m*, *B* = 2/*Ω*, and *γ* = *a*/2 for the first integral and  *γ* = 2*a*/3  for the second one.

By substituting ([B.4](#EEqB.4){ref-type="disp-formula"}) into ([B.3](#EEqB.3){ref-type="disp-formula"}), the integration can be solved and the final value of the average probability of error can be represented as $$\begin{matrix}
{{\overset{-}{P}}_{\text{QAM}} = \left( {1 - \frac{1}{\sqrt{M}}} \right)\frac{2^{1 - m}\Gamma\left( 2m \right)}{\Gamma\left( m \right)}} \\
{\quad \cdot \left( {\frac{1}{3} \cdot e^{({({9/(32{(M - 1)}^{2}}).({\Omega/m})})} \cdot D_{- 2m}} \right.} \\
{\times \left( \sqrt{\frac{9}{8\left( {M - 1} \right)^{2}} \cdot \frac{\Omega}{m}} \right) + e^{({({1/(2{(M - 1)}^{2}}) \cdot ({\Omega/m})})}} \\
{\left. {\cdot D_{- 2m}\left( \sqrt{\frac{2}{\left( {M - 1} \right)^{2}} \cdot \frac{\Omega}{m}} \right)} \right).} \\
\end{matrix}$$

Conflict of Interests
=====================

The author declares that there is no conflict of interests regarding the publication of this paper.

![The code-time diversity system with 3 orthogonal spreading codes.](TSWJ2014-146186.001){#fig1}

![The code-time diversity DSSS modulator.](TSWJ2014-146186.002){#fig2}

![The code-time diversity DSSS receiver in Rayleigh flat fading channel.](TSWJ2014-146186.003){#fig3}

![Comparison between the pdf of SINR random variable and the pdf of Weibull, Nakagami, and Gaussian random variables at different diversity orders (*L* = *N*).](TSWJ2014-146186.004){#fig4}

![The *n*th *L*-fingers RAKE filter.](TSWJ2014-146186.005){#fig5}

![The delayed symbols combiner of the outputs of RAKE filters.](TSWJ2014-146186.006){#fig6}

![The average probability of bit error of code-time diversity system in Rayleigh flat fading channel with *N*  = 2, 6 using orthogonal and nonorthogonal spreading codes.](TSWJ2014-146186.007){#fig7}

![The average probability of bit error of code-time diversity system in Rayleigh flat fading channel with *N*  = 4, 8 using orthogonal and nonorthogonal spreading codes.](TSWJ2014-146186.008){#fig8}

![The average probability of bit error of code-time diversity system in Rayleigh frequency selective fading channel with *N* = 2 and *L* = 2, using orthogonal and nonorthogonal spreading codes.](TSWJ2014-146186.009){#fig9}

![The average probability of bit error of code-time diversity system in Rayleigh frequency selective fading channel with *N* = 4 and *L* = 2, using orthogonal and nonorthogonal spreading codes.](TSWJ2014-146186.010){#fig10}

![The average probability of bit error of code-time diversity system in Rayleigh frequency selective fading channel with *N* = 4 and *L* = 4, using orthogonal and nonorthogonal spreading codes.](TSWJ2014-146186.011){#fig11}

[^1]: Academic Editors: Y. Mao and Z. Zhou
