Analysis, optimization, and implementation of a hybrid DS/FFH spread-spectrum technique for smart grid communications

In recent years, there has been great interest in using hybrid spread-spectrum (HSS) techniques for commercial applications, particularly in the Smart Grid, in addition to their inherent uses in military communications. This is because HSS can accommodate high data rates with high link integrity, even in the presence of significant multipath effects and interfering signals. A highly useful form of this transmission technique for many types of command, control, and sensing applications is the specific code-related combination of standard direct sequence modulation with ‘fast’ frequency hopping, denoted hybrid DS/FFH, wherein multiple frequency hops occur within a single data-bit time. In this paper, error-probability analyses are performed for a hybrid DS/FFH system over standard Gaussian and fading-type channels, progressively including the effects from wide- and partial-band jamming, multi-user interference, and varying degrees of Rayleigh and Rician fading. In addition, an optimization approach is formulated that minimizes the bit-error performance of a hybrid DS/FFH communication system and solves for the resulting system design parameters. The optimization objective function is non-convex and can be solved by applying the Karush-Kuhn-Tucker conditions. We also present our efforts toward exploring the design, implementation, and evaluation of a hybrid DS/FFH radio transceiver using a single field-programmable gate array (FPGA). Numerical and experimental results are presented under widely varying design parameters to demonstrate the adaptability of the waveform for varied harsh smart grid RF signal environments.


Introduction
Hybrid spread-spectrum (HSS) systems, which combine direct-sequence (DS) and frequency-hopping (FH) spreadspectrum (SS) techniques, are attractive for their strong multiple-access capabilities, resistance to multipath fading and intentional/unintentional jamming, and the security they provide against eavesdroppers [1][2][3][4][5][6]. In recent years, there has been great interest in using HSS systems for commercial applications, particularly in the Smart Grid.
User requirements for the next generation wireless communication system have been specified for the Smart Grid advanced metering infrastructure (AMI) and distribution automation systems [7]. These requirements demonstrate the need for high capacity and highly secure networks for Smart Grid applications. There is a significant gap between commercially available communications systems and those needed to satisfy the demanding requirements associated with electric utility industry. HSS systems are a promising candidate for Smart Grid applications since they provide high data rates with excellent signal security.
Spreading the signal over a relatively wide bandwidth allows transmission with relatively low power density, leading to low probabilities of detection and interception. HSS systems also provide an inherent security against eavesdroppers because knowledge of the spreading codes is required. The choice of appropriate pseudo-noise (PN) codes and dynamic altering of signal parameters provides the opportunity for a strong security scheme in the physical (PHY) layer of the network [5]; details of these techniques will be addressed in future works. This specific paper will focus on implementation, exploration, and optimization of the parameter space of the HSS system for adapting the technique for application-level requirements in Smart Grid.
Based on the hopping rate, an HSS system is classified into a hybrid direct-sequence/slow frequency hopping (DS/ SFH) system or a hybrid direct-sequence/fast frequency hopping (DS/FFH) version. In hybrid DS/FFH systems, multiple frequency hops occur within a single data-bit time. Specifically, each bit is represented by chip transmissions at multiple frequencies. If one or more chips are corrupted by multipath or interference in the RF link, statistically a majority should still be correct. Standard or slow frequency hopping, in contrast, transmits at least one (and usually several) data bits in each hopping interval. DS/FFH systems have not been previously widely implemented in many commercial or industrial applications since fast frequencyhopping rates were limited by the technology of frequency synthesizers. Today's extremely fast hopping speed directdigital synthesizers (DDSs) [8] are rapidly becoming an alternative to the traditional frequency-agile analog-based phase-locked loop (PLL) synthesizers. Output frequencies with micro-Hertz resolution and sub-degree phase tuning capabilities can thus be readily achieved using a single integrated circuit (IC).
Most of the works related to HSS in the literature have addressed evaluating its performance under different modulation techniques [2], channel conditions [1,3], multi-user interference [2,3], and jamming [4]. However, little research has yet evaluated the performance of a hybrid DS/FFH system under all combinations of the aforementioned cases. Moreover, few efforts have to date attempted to address the design and selection of the HSS system parameters that achieve optimal performance. The work in this paper extends the one in [9] and [10] from a DS system to a hybrid DS/FFH system, in addition to taking jamming impacts into consideration. In [11], the performance of a SFH system was considered. In [2] and [12], the performance of a DS/ SFH system over an AWGN channel and with multiuser interference was considered. The performance of an FFH system over fading channels was examined in [13] and extended in [3] to include the effects of partialband noise jamming. Although [4] and [14] computed the error probability of DS/SFH under jamming tones in both AWGN and Rician fading channels, only a single user was considered. In [15], the optimal spreading sequences for chip-synchronous CDMA are derived by minimizing the average bit error rate under the standard-Gaussian-approximation condition. The work in [16] presents a simulation-based study for evaluating the performance of a hybrid DS/FFH scheme. Some preliminary performance analysis and hardware designs for the hybrid DS/FFH scheme were initially presented in [17][18][19].
In this paper, error-probability analyses are performed for a hybrid DS/FFH system over standard Gaussian and fading-type channels, progressively including the effects from wide-and partial-band jamming, multi-user interference, and varying degrees of Rayleigh and Rician multipath fading. We present analytical derivations for evaluating the performance in terms of probability of bit error. In addition, an optimization approach is formulated that minimizes the average bit-error probability of a hybrid DS/FFH communication system and solves for the system design parameters that achieve an optimal performance level. The optimization objective function is non-convex and can be solved by applying the Karush-Kuhn-Tucker (KKT) conditions [20]. We also present our efforts toward exploring the design, implementation, and evaluation of a hybrid DS/ FFH radio transceiver using a single field-programmable gate array (FPGA). Numerical and experimental results are presented under widely varying design parameters to demonstrate the adaptability of the waveform for varied harsh smart grid RF signal environments.

System model
Assume that there are a total of K nodes that represent smart meters or data aggregation points in the Smart Grid wireless network. For the kth node, the transmitted signal is given as where P is the common transmitted signal power, f c is the carrier frequency, f k h t ð Þ È É denotes the hopping frequency of the kth node, the data signal b k (t) is a sequence of statistically independent, unit-amplitude positive, and negative rectangular pulses of duration T b , and a k (t) is the PN-code waveform for the kth node in DSSS and is given as where a k n È É is the discrete periodic signature sequence assigned to the kth node and P T c t ð Þ is a rectangular pulse that starts at t = 0 and ends at t = T c .
Consider M frequency hopping channels with L (assume L is odd) hops per bit. Let T = T b /L denote the duration of each hop and T c = T b /NL denote the chip duration for the PN-code sequence, where N is the period of the PN-sequence and is also assumed to be odd. The wide-band jamming fully corrupts W hopping channels and another single channel partially (let W P J be the part of the channel affected by the partial jamming).
The fading channel considered here is modeled as a general wide-sense-stationary uncorrelated scattering (WSSUS) channel [9]. Following [10,21,22] , the received signal can be described as: where J(t) and n(t) represent the jamming term and AWGN term that have two-sided spectral densities N J /2 and N 0 /2,, respectively, and where the nonnegative real parameter γ k is the Rician channel coefficient for the kth node; β k (τ, t) is a zeromean complex Gaussian random process that represents the equivalent low-pass time-varying impulse response for the fading channel [10]. The covariance function for the fading process in a WSSUS channel is [22,23].
In this paper, we focus on one class of WSSUS channels known as time-selective fading channels [22]; its covariance function is given by ρ k (τ, t − s) = ρ k (0, t − s)δ(τ) [23], where the covariance function ρ k (0, t − s) is defined as where λ = (n + β) < N, n is a positive integer less than N, 0 ≤ β < 1 and v = (λT c ) −1 T [10]. Similar to [24], the time delays and data symbols for the kth node are modeled as mutually independent random variables which are uniformly distributed on [0, T] and {−1, + 1}, respectively. We also assume τ i = 0 when considering the output of the kth (k ≠ i) correlation receiver.

Error probability analysis
In this section, we first investigate the average error probability for one hop, and then we employ a majority voting scheme to compute the overall error probability for one bit.
For each user k, the other K-1 users are considered as interference. Three different situations may occur in one hop: j out of K-1 users interfere with the same hopping channel of user k and (1) no jamming corrupts the channel, (2) jamming fully corrupts the channel, or (3) jamming partially corrupts the channel. Thus, the total average error probability P k ε of one hop for user k can be computed as: where P k ε j users ð Þ is the average error probability of one hop due to j interfering users. Expression (6) is equivalent to fP jusers; no jam ð Þ P k ðεjj users; no jamÞ þP jusers; full jam ð Þ P k ðεjj users; full jamÞ þP jusers; partial jam ð Þ P k ε j users; partial jamÞ j g ð ð7Þ where P(a, b) is the joint probability of events a and b, and P k (ε|a, b) is the conditional probability of error, given events a and b have occurred. From the problem formulation, we can obtain: The conditional error probabilities for each case of jamming over Rician fading channels are discussed next.

A. Case 1: No Jamming
When there is no jamming, the error probability for BPSK modulation is given as [25]: where I k j is the interference-to-signal ratio introduced by the other users hopping in user k's channel, NSR = N 0 / 2PT is the noise-to-signal ratio, and Q(•) is the complementary error function. Following the arguments in [10] and [24], I k j is computed as: where β l = 1 for l < n and β n = β, Δ i (l) = R i (l + 1) − R i (l), ζ i, and R i (l) is the usual aperiodic autocorrelation function for the PN-sequence. Different PN-sequences correspond to different aperiodic autocorrelation functions which are functions of the length N of the sequence. In this work, we employ a maximal-length sequence (MLS) as the signature sequence. However, by using an MLS code, there does not exist a closed-form expression of the aperiodic autocorrelation function, R i (l), for the general MLS code, which prevents us from finding a closed-form expression for I k j . However, we can compute a closed-form expression if we know exactly which MLS code is used. Actually, two different MLS codes with the same length will have different aperiodic autocorrelation functions. Therefore, we consider an upper bound on an MLS's aperiodic autocorrelation function derived in [26] to compute an upper bound on the error probability of the HSS system.
Plugging them back into I k j in (10) and assuming γ k = γ as a constant for simplicity, we get an upper bound on I k j as:

B. Case 2: Full Jamming
When jamming fully corrupts the user k's channel, the error probability for BPSK is given as: where JSR = N J /2PT is the jamming-to-signal ratio.

C. Case 3: Partial Jamming
When jamming partially corrupts the user k's channel, the error probability includes two portions: one is the part of the channel corrupted and the other is the uncorrupted part.
Then the error probability for the BPSK case is given as: Based on the arguments above, the error probability per hop, P k ε , is obtained. Without loss of generality, we assume the Rician channel coefficients for all users are identical, i.e., γ k = γ, then, for simplicity, P k ε can be represented as P ε . To compute the error probability for one bit, denoted P E , we employ a majority voting decision scheme given as: Due to the monotonicity of Q(•), using (11) provides an upper bound on P k ε and thus an upper bound on P E . The problem of determining the HSS system parameters for an optimal performance is now discussed in the next section.

Optimization problem formulation
In realistic HSS systems, the overall system performance always suffers from practical parameter constraints. Thus, we formulate the problem of minimizing the biterror performance subject to some representative parameter constraints.
The system design parameters of interest are the number of frequency-hopping channels M, the length of the PN-sequence N, the number of channels fully corrupted by jamming W, and the number of hops per bit L. Assume that these parameters satisfy the following constraints together with integer constraints on the parameters (i.e., M, N, W, L are positive integers). The physical meaning of these constraints can be explained as follows: (15) represents that the total bandwidth of the system (MNW b ) is limited by K 1 , where K 1 > 0; (16) means that the number of frequency channels fully corrupted by the jamming are a portion of the total number of channels, where 0 ≤ K 2 ≤ 1; (17)  The optimization problem is to minimize the system's bit-error rate (BER) in (14) with respect to the constraints described in (15) to (18). It can be written as: The integer constraints are removed in the problem statement and the following analysis because they can be imposed after the solutions of (19) are found. This will be discussed in more detail in the following section.

Necessary conditions of the optimization problem
By examining the structure of P E , we can further relax the constraint (17). Note P E is a monotonically decreasing function with respect to L, so constraint (17) can be written as: which means that there is an upper bound on L. Moreover, as P ε does not depend on L, the error probability P E reaches its minimum when L ¼ 1 Further, it is easy to see that P E is a monotonically increasing function with respect to P ε on the interval [0, 1], and M, N, W are all contained only in P ε ; thus, the optimization problem in (19) can be further simplified as: From Section 3, we have where P n = P(jusers, no jam), P f = P(jusers, full jam), P p = P(jusers, partial jam), P nj = P k (ε|j users, no jam), P fj = P k (ε|j user, full jam), P pj = P k (ε|j users, partial jam). Expression (22) can be further simplified by representing P pj in terms of P nj and P fj as follows: For convenience, let and also let x = (M, N, W). From Section 3, we observe that P n and P f are functions of both M and W, while P p is only a function of M. Moreover, P nj and P fj are functions of N. We can also observe that the error probability to be minimized has a complex structure and is a non-convex function. Thus, to compute the optimal solution, we apply the Karush-Kuhn-Tucker (KKT) [20] conditions to problem (21).
Lemma 1: (Karush-Kuhn-Tucker Conditions) Let y* be a local minimum of the following problem where f and g i are continuously differentiable functions with appropriate dimensions. Then there exists an unique Lagrange multiplier vector μ = (μ 1 , …, μ m ), such that Þ is the Lagrangian function and A(y*) is the set of active constraints at y* defined as: For any feasible vector y (the vector that satisfies all constraints), the set of active inequality constraints is given as A(y) = {i|g i (y) = 0} and if j ∉ A(y), it is said that the jth constraint is inactive at y.
In addition, if f and g i are twice continuously differentiable, then there holds z T ∇ 2 yy R y Ã ; μ ð Þz≥0 , for all z in proper dimensions, such that ∇g i (y *) T z = 0, ∀ i ∈ A(y *). Now, the necessary conditions for a local minimum of problem (21) can be derived by applying the KKT conditions as follows: Theorem 1: Let x* = (M*, N*, W*) be a local minimum of the problem (21), then there exists unique μ 1 ≥ 0, μ 2 ≥ 0, such that In addition, the following inequality holds: Proof: In order to apply the KKT conditions, we first need to check the types of inequality constraints, to determine whether they are active or inactive inequality constraints.
It is obvious that (18) is inactive at x*. To check for (15), first assume that (15) is also inactive at x*, which infers M*N*W b − K 1 < 0. However, it should be noted that P ε is a monotonically decreasing function with respect to both M* and N*; thus, M*N*W b − K 1 < 0 means there is still an 'increasing space' for either M* or N*, such that P ε can still be reduced by increasing M* or N* to M*N*W b = K 1 , which contradicts that x* is the local minimum. Thus, (15) is an active constraint at x*.
To check for (16), first assume that (16) is inactive at x*, which means W* − K 2 M* > 0, by applying the KKT necessary conditions (page 316, Proposition 3.3.1 in [20]), we have the unique Lagrange multiplier for (16) μ 2 = 0 and However, we should also observe that by ∂W j x Ã ≠0 as P nj ≠ P fj , which leads to a contradiction. Thus, (16) is also an active constraint at x*.
After specifying the type of each inequality constraint, we can obtain Theorem 1 by applying the KKT conditions in Lemma 1 to problem (21).

Remark 1
We can similarly obtain second-order sufficiency conditions of the problem by applying the following KKT sufficient conditions (page 320, Proposition 3.3.2 in [20]): If (27) to (37) hold for some x and μ i > 0, i = 1, … m, then x is a strict local minimum.

Remark 2
Once the solution is found, the integer constraints need to be imposed. For example, assume M, N, W, L are positive integers; first, round one parameter (e. g., N) to the nearest integer, then plug it back to the problem and re-compute the solution. After that, round the rest of the parameters in a similar fashion.
Theorem 1 states the necessary conditions for the optimization problem by employing a general PN-sequence. Now, we will employ the MLS code as the PN-sequence in the HSS system and reformulate Theorem 1 explicitly.
Expression (11) describes that I k j for an MLS code is upper-bounded by I u j . Note that the upper bound of the error probability reserves the same monotonicity with respect to the system parameters (e.g., M, N). Considering the upper bound I u j in (11), Theorem 1 remains the same, with the exception that After performing some derivations, we obtain: where Plugging the above equations back into Theorem 1, then we can obtain necessary conditions for the local minimum of the upper bound of the error probability for the MLS code. Sufficient conditions can also be obtained from Remark 1.

Remark 3
Note that in an MLS code, N is an integer such that N = 2 n − 1 where n is a positive integer. Thus, after obtaining solutions of the local minimum of the problem, N in each solution should be rounded to the closest integers in the form of 2 n − 1 (usually two integers correspond to N in one solution), and the rest of the parameters in the solution should be re-computed and rounded. Then, by comparing the error probabilities resulted from these two sets of parameters, we employ the parameter set with the lower error probability as the local minimum of the problem after re-applying the integer constraints.
In the next section, our specific design and implementation of a hybrid DS/FFH radio transceiver using a single FPGA are presented.

ORNL specific hybrid DS/FFH design and implementation
The hybrid DS/FFH prototype was designed to demonstrate the fundamental advantages of the HSS system, such as jamming resistance, difficulty of unwanted interception, robust performance, and reasonable cost. The prototype operates in the unlicensed 902 to 928 MHz ISM band, although target applications such as the SG may ultimately use a dedicated frequency band. The system parameters for the prototype are selected based on the available ISM bandwidth and FPGA capabilities and using the analysis presented in the previous section. The selected parameters are considered to be nearly optimal for a typical smart grid environment.
We decided to use the Software Defined Radio (SDR) method for hardware implementation of the hybrid DS/ FFH system because of its flexibility in changing the system to evaluate new concepts. This methodology has also proven to be very powerful in that the vast majority of the signal processing components can be placed in a single FPGA. The entire HSS band is down-converted to an intermediate frequency, digitized, and sent to the FPGA. Within the FPGA, look-up-table-based local oscillators down-convert the individual FH channels to baseband. These baseband signals are then decoded using DS correlators and stored in a buffer for subsequent delivery to a host computer.
As shown in Figure 1, the HSS unit splits the 902 to 928 MHz band into ten separate FH channels, each of which sends a DS spread spectrum signal with a 1.25-MHz chipping rate. An analog mixer converts these frequencies up or down for the transmitter or receiver, respectively, for use by the digital-to-analog (D/A) or analog-to-digital (A/D) converters. The SDR algorithms work over a designated 12.5 to 35.0 MHz frequency range. Each DS signal is a 63bit length MLS code, although more advanced Gold or Kasami codes could also be used. Three hops per bit are used, and at the receiver a two-out-of-three majority voting decision scheme is employed.
Of particular, interest is the method used for modulating the DS signal. Traditional PSK modulation requires a preamble at the beginning of the packet to determine the reference phase and a Costas Loop [27] or similar mechanism to maintain this phase reference. With HSS in multipath channels, this phase reference is lost after each frequency hop; therefore, we decided to perform the DS modulation by shifting the start time of the code. The incoming signal is correlated with local copies of the shifted code pattern and an early-late voting system determines the amount of shift of the received signal. The correlation algorithm is independent of the carrier phase of the signal. The number of bits that can be encoded by this method is demonstrated by the earlylate diagram described in Figure 2.
The bit-shift number refers to the number of bits that the local DS code has been shifted for performing the correlation. To prevent ambiguous results from a correlation being between two bits, only every other bit position is used, which results in 31 positions available for each code word. Four bytes of blank data are sent at the beginning of the packet as a preamble to set the reference DS start time.
A different interpretation of this methodology would be that the DS code is shifted because of a different time-offlight, similar to GPS or continuous wave radar. Similar to the way GPS can achieve precise time-of-flight resolution, it can be expected that this methodology can be further developed to obtain higher bit capacity. The work in [28] explores this method for multiple users occupying a channel simultaneously.
The HSS channel capacity is calculated by dividing the chip rate, or 1.25 MHz, by the 63-bit code length to get 19,841 DS sequences per second. Since the data is replicated three times for redundancy, the actual throughput is 6,613 DS sequences per second. Since each DS sequence contains 8 bits of data, the data throughput is 52,910 bits per second. The HSS prototype is optimized for reading household utility meters for smart grid applications and thus only requires 32 bytes, although the system has operated successfully with 256-byte packets.
The prototype hybrid DS/FFH system is based on a Xilinx Virtex-4 FPGA for performing the digital signal processing. The hardware setup is described in Figure 3. The   FPGA, A/D, and D/A operate synchronously together at 100 MHz to allow operation on analog signals to a practical limit of 40 MHz. The D/A has 16-bit resolution for a dynamic range of 96 dB, and the corresponding A/D has 14-bit resolution for a dynamic range of 84 dB. The microcomputer loads and unloads data to the FPGA and communicates with sensors and other computers using Ethernet, RS232, or analog signals. Figure 4 describes the transmitter portion of the FPGA code, which consists of the data buffer, modulator, and ten local oscillators for generating the hopping carriers. Raisedcosine waveshaping is used to reduce the spectral sidebands. The receiver uses the same local oscillators for detecting signals, and all ten channels must be simultaneously received to detect the preamble during jamming situations as illustrated in Figure 5.
To acquire the packet preamble, a spread-spectrum correlator continually looks for the preamble pattern on all channels. Once the preamble is detected, an internal timing sequence compares the signal with shifted copies of the DS code via a simple correlator. The shifted copy of the DS code that provides the strongest correlation then demodulates the actual data. To make the signal detection independent of the carrier phase, both phases of the carrier (I and Q) are correlated with the preamble's code. However, the phase relationship must remain consistent during the duration of the DS sequence.   A key limitation of the radio's selectivity is the digital lowpass filter (LPF) implemented in the FPGA. Because we were limited to integer arithmetic in the FPGA, the filter was implemented as a simple square-window FIR LPF, with four of the filters connected in series. A future implementation of HSS could use a newer generation FPGA with floating-point arithmetic to achieve a filter with better rolloff characteristics and higher ultimate rejection. Figure 6 is an analytically generated plot of the low-pass filter response, superimposed on the frequency spectrum of the spreadspectrum signal. The ultimate rejection level of 70 dB will be apparent in the experimental results presented in the next section.
Once the packet start has been established, the receiver begins listening on specific channels instead of all channels. A simple multiply-and-integrate correlator system is used   for signal detection as illustrated in Figure 7. In the next section, we present experimental results to demonstrate the performance of the hybrid DS/FFH prototype.

Hybrid DS/FFT system performance
We first demonstrate the performance of a hybrid DS/FFH system over Rician time-selective fading channels, progressively including the effects from wide-and partial-band jamming, multi-user interference, and varying degrees of Rician fading. The performance measure is the upper bound of BER described in (14) by employing (11). The parameters of the reference system model considered in this numerical example are total number of users is K = 100; number of hops per bit is L = 5; number of frequencyhopping channels is M = 30; period of PN-sequence in DSSS is N = 127; jamming-to-noise ratio (JNR) is 13 dB; number of channels fully jammed is 5; the Rician channel coefficient γ = 0.1 (represents the channel fading part); channel covariance function scaling factor λ = 10.8; and the  portion of the channel partially corrupted is 0.4. The parameter space of the HSS system is explored to demonstrate its effectiveness under different conditions and scenarios. In the following analysis, we successively vary one parameter in the reference system model while fixing the other parameters. Figure 8 shows the effect of different number of continuously transmitting users (multi-user interference) on the performance of a hybrid DS/FFH system. You can observe the high multiple access capability of such a technique, especially at high SNRs. Figure 9 demonstrates the performance for different jamming to noise ratios (JNRs), and Figure 10 demonstrates the performance for varying number of fully jammed channels. You can observe from Figures 9 and 10 the high anti-jamming capability of such a technique, especially at high SNRs. Also, it can be observed that under high SNRs the performance gap reduces for different JNRs and different numbers of fully jammed channels. Figure 11 demonstrates the performance for different numbers of hops per bit. Notice that the  performance of the DS/FFH system is superior to that of the DS/SFH system (represented by the 1 hop/bit case). Also, notice the high improvement in performance at higher SNRs when increasing the number of hops per bit. This reveals the effectiveness of the proposed technique at high SNRs. Figure 12 demonstrates the DS/FFH performance for different numbers of available hopping channels. Increasing the number of hopping channels reduces the likelihood of hits from other users using the same spreading PN-code and, therefore, enhances the performance. Figure 13 demonstrates the DS/FFH performance over varying degrees of Rician fading in the channels. You can observe how the performance deteriorates with increasing the fading component in the Rician channel represented by the parameter γ. Figure 14 demonstrates the DS/FFH performance compared with the other SS systems that include DS, SFH, FFH, DS/SFH, and DS/FFH. It can be observed that the hybrid DS/FFH system outperforms the other SS systems. The hybrid DS/FFH system is preferred over the other systems because of its unique advantages, including the better spreading properties gained by frequency hopping and better multipath rejection via the direct-sequence modulation component.
The presented results demonstrate the effectiveness of the proposed hybrid DS/FFH scheme under severe channel conditions and, therefore, indicate that there is a high potential for employing it in complex smart grid communications.

Optimizing hybrid DS/FFT system performance
We now provide numerical examples to illustrate the results derived in Section 5. For convenience, we only test the necessary conditions that apply to the MLS code. We compute the solutions of the first-order necessary conditions (27) to (31) and impose the integer constraints. Then, the upper bound of the BER, P E , is plotted for different MLS code lengths N using (14) and (11) to verify the results computed from the derived first-order necessary conditions.  The parameters of the reference hybrid DS/FFH system model considered is the same as described in the previous section (K = 100; JNR = 13 dB; γ = 0.1; and λ = 10.8), in addition to a signal-to-noise ratio (SNR) of 20 dB; finally, the portion of the channel partially corrupted is q ¼ W Þ¼30=N . Note that the parameters M, N, W, L need to be computed for assessing the optimal performance. From the previous analysis, the number of hops per bit is chosen as L = (1/K 3 W b ) = 5.
First, we choose K 1 = 2600 W b and K 2 = 0.2. Then, by applying (27) to (31), we obtain N = 42. Because of the integer power-of-two constraint of N (N = 2 n − 1), it is rounded to the nearest two integers, 31 and 63. Then by applying (30) and (31) for each integer of N and comparing the corresponding BER of both integers, we see that N = 31, M = 83, and W = 17 results in a smaller BER. The upper bound of the BER in (14) for different PN-code lengths, N, is demonstrated in Figure 15, in which we can now observe that at N = 31, the BER reaches its minimum. This coincides with the result from the first-order necessary conditions. Now, we consider K 1 = 3600 W b , with K 2 unaltered. Through a similar procedure, we obtain N = 48.3. After rounding N to 31 and 63, it can found that N = 63, M = 57, and W = 11 results in smaller BER values. Figure 15 demonstrates the upper bound of the BER for different PNcode lengths, N, for this scenario. It can now be observed that the BER reaches its minimum at N = 63, which also coincides with the result from our analysis.

Experimental evaluations
Four bi-directional hybrid DS/FFH radio transceivers have been built in our lab and have performed well. The hardware prototype is shown in Figure 16. The sensitivity for the units is −110 dBm to produce an approximately 80% success rate at the packet level. This is 5 dB less sensitive than theoretically possible, but it is expected that the detection algorithms in the SDR could be significantly improved for better overall sensitivity. Also, the radios demonstrated a bit error rate of less than 10 −6 .
The jamming performance of the system was measured directly with laboratory equipment. The testing method used for the HSS evaluation is shown in Figure 17. The square-wave generator is used at 20 kHz to modulate the signal generator at 100% AM modulation. The test procedure consists of initially transmitting data from the transmitter to the receiver with the signal generator turned off and the attenuator adjusted such that the receiver is operating at an 80% success rate. The attenuator is then reduced 20 dB so the system has a 20-dB margin. Then the signal generator is turned on and ramped up in power until the receiver has degraded to an 80% success rate. The difference in power between the signal generator (jamming) and the transmitter and attenuator combination (at the 20-dB margin point) is then recorded. This is repeated for signal generator frequencies from 902 to 928 MHz. Versions of the test are performed with and without the AM modulation. This stresses the radio by exposing clipping and other nonlinear effects that are expected in the A/D converter, SDR arithmetic, and analog front-end components.
The first test involved operating the HSS with the hopping feature turned off, so that the filtering capability of the SDR could be measured independently from the hopping benefits. In this test, the intermediate frequency  Figure 19 The hybrid DS/FFH prototype performance while the frequency hopping feature is disabled and in the presence of jamming.  was always 12.5 MHz, which also allowed us to insert an analog 12.5 MHz, 3-pole bandpass filter (BPF) in line. This filter lets us operate the radio as a standard analog radio and allows us to do a direct selectivity comparison between the analog and SDR approaches. This comparison was made with the generator AM modulation turned off. The net results are shown in Figure 18. From the filtered version of the results, we still see the dynamic range limitations of the analog components ahead of the filter, which include the front-end amplifiers, surface acoustic wave (SAW) bandpass filters, and first mixer. Figure 19 demonstrates the effect of AM modulation on the jamming signal. Peak values of the jammer signal are used for the comparison. In general, the modulation makes the radio 10 dB more susceptible to jamming.
The main test for HSS is to show that its FH feature will make the system jam-resistant at all jamming frequencies.
Experiments showed that the hopping frequencies have to be judiciously chosen such that within a redundant triplet, no two of the three frequencies would be near each other, since this would let a single jammer jam both frequencies. Therefore, the pattern could not be truly random but would need somewhat of a trend. Figure 20 shows the hybrid DS/FFH jamming susceptibility versus frequency. Two receiver gain versions of the HSS were evaluated in this scenario. The difference in gain between the low-gain and high-gain version is 5 dB. Eventually, an automatic adjustment will be developed to choose the best value for a particular environment. It is noticed in Figure 20 that the smaller signal has less distortion and is able to better reject the undesired jamming signal at almost all frequencies.

Conclusion
In this paper, the performance of a hybrid DS/FFH system over Rician fading channels was considered. We derived the average BER for a hybrid DS/FFH system that includes the effects from wide-and partial-band jamming, multi-user interference, and/or varying degrees of Rician fading. Numerical results exploring the parameter space of the HSS system have also been presented to demonstrate its effectiveness under different conditions and scenarios. We have also demonstrated a novel non-convex optimization technique that minimizes the bit-error probability of a hybrid DS/FFH communication system under multiple constraints. By employing the Karush-Kuhn-Tucker conditions, the process solves for the optimal system design parameters. In addition, a hardware FPGA-based hybrid DS/FFH prototype was implemented successfully and optimized for a typical smart grid utility application. Experimental results indicate that high resistance of hybrid DS/FFH systems to other jamming and interference signals allows the possibility of intentionally operating several HSS radios in the band simultaneously. For smart grid applications, this would enable a base station to service several clients at the same time, provided the system arranged for different clients to use different hop patterns and DS codes, and possibly even coordinated transmission time windows. The use of hybrid DS/FFH waveform in wireless networks as employed in the smart grid is recommended, as it offers superior resistance to jamming attacks and improves the reliability of transmission compared to existing SS techniques like DS, FH, and hybrid DS/SFH systems.