1 Introduction

Over the last decade, use of the THz frequency band (0.1–10 THz) has grown in various application fields, including astronomy, space science [1], next-generation mobile communication systems [2], imaging of concealed items [3], time-domain spectroscopy [4], medical science [5, 6], and defense [7, 8]. These broad applications in the THz spectra are due to its unique properties [9, 10] such as high bandwidth, less diffraction than for microwaves, good imaging resolution, and that the terahertz signature of many solid and gaseous materials lies in the 0.5–3 THz band. Besides, for wireless communication systems, the bandwidth available in the terahertz band enables conveyance of large volumes of information per channel, meaning higher data bit rates [11]. Microstrip patch antennae are widely used for various applications due to their low cost, low profile, compatibility with integrated circuit (IC) technology, and easy fabrication and installation on shaped surfaces [12]. This class of antennae, which are of standing-wave type, are thus good candidates for use in terahertz integrated on-chip applications. Use of such integrated on-chip antennae in silicon technology is promising in the terahertz range, as it could be even more cost-effective than conventional packaging with an external antenna and transceivers in terms of packaging cost and compactness. In general, such terahertz system on-chip (THz-SOC) technology in silicon is very promising for use in several applications, requiring intensive analogue interface and digital logic for signal processing on-chip for cost-effective mass production [13]. Nevertheless, use of the silicon substrate of conventional digital complementary metal–oxide–semiconductor (CMOS) technology as an antenna substrate introduces two main loss mechanisms: the conduction loss due to the low resistivity of the silicon substrate, and the surface-wave mode excitation loss caused by the thick silicon substrate with high permittivity [14]. The advantage of using silicon technology is clear when the fully integrated system with analogue and logic circuits for base-band and digital signal processors (DSPs) is considered. To improve the electrical performance of microstrip antennas, various researchers have used high-dielectric-permittivity or thick substrate material [15,16,17,18]. However, the application of high-dielectric-permittivity materials such as silicon leads to shock waves at the air–substrate interface in the millimeter and terahertz ranges of the spectrum [19]. Furthermore, the application of a thick substrate leads to surface wave losses due to the trapping of energy within the substrate [20], while a reduction in the substrate thickness reduces the performance and mechanical strength of the antenna. To reduce the surface wave loss, either the effective dielectric permittivity or thickness of the material must be reduced. To reduce the effective dielectric permittivity, this property of the material can be artificially altered by using periodic air defects in a homogeneous host material. Such a heterogeneous material is called a photonic crystal. In general, the dielectric permittivity of a PBG material is reduced, which can be used to enhance its electrical performance [21]. In designing a microstrip antenna for use at high frequency, photonic crystals are widely used as substrate materials as well as in other applications [11, 22,23,24,25,26]. Photonic crystals have fascinated scientists and researchers, because when they interact with electromagnetic waves, exciting phenomena with amazing features appear. However, due to the complexity of photonic crystal structures, it is usually difficult to characterize them using purely analytical methods. Instead, full-wave simulators such as CST Microwave Studio, which is based on the finite integral technique, have been used for such analysis. Two-dimensional (2D) photonic crystals have attracted interest from researchers, as they are much easier to fabricate than three-dimensional (3D) photonic crystals [27,28,29] and have promising applications, e.g., in planar waveguides and antennas [30, 31].

MATLAB has become a ubiquitous software package for data manipulation, signal processing, and graphics. Scientists and engineers worldwide use MATLAB to analyze and design systems and products in several fields, including antennas. Although electromagnetic simulators can model very complex electromagnetic systems, they lack some of the powerful analysis functions available in MATLAB for numerical optimization problems. Thus, linking the programming language MATLAB and the electromagnetic simulator CST Microwave Studio to create a powerful tool for the design and analysis of microstrip antennas is a promising technique, for example, in the design optimization process, which involves a large number of parameters. These parameters may be either continuous, discrete, or both, making the design process slow and complicated. Particle swarm optimization (PSO) is a heuristic search method based on the idea of the collaborative behavior between swarming birds in biological populations. PSO is similar to the genetic algorithm (GA) in the sense that they are both population-based search approaches and both depend on information sharing among members of a population to enhance the search process using a combination of deterministic and probabilistic rules. Heuristic algorithms have been used in antenna optimization based on different methods [32,33,34,35]. Researchers have reported that both PSO and GA show equal effectiveness, but that PSO is more efficient than GA [36].

In the work presented herein, a terahertz microstrip patch antenna is designed based on a synthesized photonic crystal substrate using CST Microwave Studio linked to a BPSO algorithm as a modern optimization technique to synthesize unique photonic crystal structures that enhance the electrical characteristics of the antenna. In Sect. 2, the microstrip antenna is designed based on a photonic bandgap substrate, using air cylinders embedded in a silicon substrate, by analyzing and designing the substrate separately, then employing it in a microstrip antenna. In Sect. 3, BPSO of the microstrip antenna based on the PBG substrate is presented and analyzed for two different optimization merit functions, viz. the return loss and gain, and the bandwidth and gain. Finally, Sect. 4 concludes the work.

2 An antenna based on an air-cylinder PBG substrate

2.1 PBG structure

In this section, the photonic crystal structure is made of air cylinders embedded in a silicon dielectric material with relative permittivity and electrical conductivity of 11.9 and 0.00025 S/m, respectively. The overall dimensions of the structure are \(500\times 500\,\upmu {\hbox {m}}^2\), and the thickness is \(50\,\upmu {\hbox {m}}\) for both dielectrics. Besides, the air holes have a lattice constant and radius of \(70\,\upmu {\hbox {m}}\) and \(28\,\upmu {\hbox {m}}\), respectively. Hence, the dimensions of the square unit cell are \(70\times 70\,\upmu {\hbox {m}}^2\). Multiple duplicates of this square unit cell are concatenated to form a PBG structure, as shown in Fig. 1. To analyze its properties, simulations are performed in the CST Microwave Studio environment. Because of the structural nature and periodicity, the computational effort can be reduced by setting electric boundary conditions at the top and bottom of the structure, magnetic boundary conditions at the front and back sides, and open space boundary conditions for the right and left sides. The simulation results are obtained by considering seven unit cells in the frequency range of 0.4–0.8 THz. The results are obtained by extracting the material properties from the simulated S parameters. The extracted complex relative permittivity is shown in Fig. 2. To design a substrate structure for the patch antenna with resonance at around 0.6 THz, the value of the effective permittivity is taken as 0.44 in the next section.

Fig. 1
figure 1

The geometry of the simulated PBG structure

Fig. 2
figure 2

The relative permittivity of the designed PBG

2.2 Antenna design

In this section, patch antenna 1 is designed and simulated using the previously analyzed photonic crystal structure as its substrate. First, the width \(W_{\mathrm{p}}\) and length \(L_{\mathrm{p}}\) of the rectangular patch are calculated and found to be equal to \(295\,\upmu {\hbox {m}}\) and \(223\,\upmu {\hbox {m}}\), respectively, from Eqs. (1) and (2) [21], where \(\epsilon _{\mathrm{reff}}\) is the effective dielectric constant, \(f_{\mathrm{r}}\) is the desired resonant frequency, c is the speed of light, and h is the thickness of the antenna substrate. Then, optimization of the calculated values is performed, modeling metals as perfect electrical conductors. The value of each parameter of the antenna structure is presented in Table 1. The configuration of antenna 1 is shown in Fig. 3.

$$\begin{aligned} W_{\mathrm{p}}= & {} \frac{c}{2 f_{\mathrm{r}} }\sqrt{\frac{2}{\epsilon _{\mathrm{reff}}+1}}, \end{aligned}$$
(1)
$$\begin{aligned} L_{\mathrm{p}}= & {} \frac{c}{2 f_{\mathrm{r}} \sqrt{\epsilon _{\mathrm{reff}}}}- 2 \Delta l, \end{aligned}$$
(2)

where

$$\begin{aligned} \Delta l=0.412h \frac{( \epsilon _{\mathrm{reff}}+0.3 ) \left( \frac{W_{\mathrm{p}}}{h}+0.264 \right) }{( \epsilon _{\mathrm{reff}}-0.258) \left( \frac{W_{\mathrm{p}}}{h}+0.8\right) }. \end{aligned}$$
(3)
Table 1 Parameter values for antenna 1

Antenna 0, namely a conventional antenna based on a homogeneous silicon substrate, is designed and simulated for comparison and analysis purposes. Using Eqs. (1) and (2), the calculated width and length of the patch are equal to \(90\,\upmu {\hbox {m}}\) and \(33\,\upmu {\hbox {m}}\), respectively. Figure 4 presents the return loss of the described antennas, clearly showing that the optimized antenna designed based on the PBG substrate exhibits a wider bandwidth (56 GHz) compared with the antenna based on the homogeneous substrate (41 GHz) and a deeper return loss (\(-64.04\) dB) compared with the antenna on the homogeneous substrate (\(-11.35\) dB). All the resonant frequencies lie at around 0.65 THz. For practical reasons, the perfect electrical conductor, which was used for modeling of metals, is replaced with annealed copper. The return loss results obtained with a copper thickness of 1.1, 2.1, and \(3.1\,\upmu {\hbox {m}}\), including the patch, feeder, and ground metals, are shown in Fig. 5. These results using an appropriate copper thickness are close to those shown in Fig. 4. It is observed that antenna 1, based on the PBG substrate, achieves a gain of 9.17 dB and radiation efficiency of 91.08 %, compared with 3.79 dB and 65.4 % for the conventional patch antenna based on the homogeneous substrate. Thus, considering the presented results for the return loss, the use of the PBG structure is indeed an effective technique to reduce surface waves, resulting in worthwhile improvements. Figure 6 shows the radiation pattern in dB for antenna 1 at its resonant frequency of 0.62 THz in the XZ and YZ planes. The maximum radiation in the pattern of this antenna is at \(\theta = 0 ^{\circ }\), and the maximum directivity is 9.58 dB.

Fig. 3
figure 3

The geometry of antenna 1 based on the PBG substrate

Fig. 4
figure 4

The magnitude of the \(S_{11}\) parameter in the terahertz band for antenna 0 and antenna 1

Fig. 5
figure 5

The magnitude of the \(S_{11}\) parameter in the terahertz band for antenna 1 when considering annealed copper with different thicknesses

Fig. 6
figure 6

The radiation pattern in the XZ and YZ planes for antenna 1 based on the PBG substrate at its resonant frequency

3 Design of antennas based on the synthesized PBG substrate

3.1 BPSO algorithm

Particle swarm optimization (PSO) is one of the most widely used evolutionary algorithms due to its simplicity and low computational cost, which make it suitable for solving a wide range of problems. It was first introduced by Kennedy and Eberhart, who later (in 1997) proposed the binary version of PSO (BPSO) [37,38,39]. PSO is inspired by the social behavior of bird swarms. It uses candidate solutions as particles, which move in a search space to find the best solution. At the same time, they all take into consideration the global best solution and the personal best solution obtained so far in their paths. The update of the position and velocity of each particle is based on its current position, the current velocity, the distance to its personal best solution, and the distance to the global best solution. However, BPSO solves binary problems in a discrete binary search space, which results in a different position updating process than for a continuous search space. Therefore, BPSO uses transfer functions and updating rules to convert the velocities into position updates, unlike PSO. A flowchart using Eqs. (46), summarizing the best proposed process for the BPSO algorithm based on a V-shaped transfer function, is shown in Fig. 7 [40].

$$\begin{aligned} v_i^{(t+1)} & = w v_i^t+ c_1\times {\hbox {rand}}\times \left( {\hbox {pbest}}_i-x_i^t \right) \nonumber \\&+\,c_2\times {\hbox {rand}}\times \left( {\hbox {gbest}}-x_i^t \right), \end{aligned}$$
(4)
$$\begin{aligned} T(x)= & {} \left| \frac{2}{n} {\hbox {arctan}} \left( \frac{n}{2} x \right) \right|, \end{aligned}$$
(5)
$$\begin{aligned} x_i^k (t+1)= & {} {\left\{ \begin{array}{ll} \left( x_i^k (t)\right) ^{-1} &{} {\text {if}}\quad {\hbox {rand}}< T\left( v_i^k (t+1)\right) \\ x_i^k (t)&{} {\hbox {rand}} \ge T\left( v_i^k (t+1)\right) \end{array}\right. }. \end{aligned}$$
(6)
Fig. 7
figure 7

A flowchart for the BPSO algorithm using a V-shaped transfer function

3.2 Optimizing by BPSO

We use BPSO to find the best 2D photonic crystal substrate for the presented microstrip patch antenna. As an effective global optimization method, the BPSO algorithm searches for the global minimum in a discrete search space. Hence, we consider a 2D photonic crystal comprising a square lattice formed by two different materials, namely silicon and air with dielectric constants of 11.9 and 1, respectively. To apply BPSO, we discretize the unit cell into many square pixels, each of which can be filled by one of the two materials, silicon or air, represented by the binary values 1 and 0 in the BPSO algorithm. The total number of possible structures of such a 2D photonic crystal increases exponentially with the number of pixels, so a full-space search method becomes impractical as the number of pixels increases, or in other words, when the pixels are tiny. In this case, the BPSO algorithm is anticipated to be effective. In the BPSO algorithm, each binary word corresponds to a 2D photonic crystal unit cell formed by pixels, physically just square rods of dielectric material. Each unit cell represents a candidate model in the optimization process. Thereafter, each candidate is analyzed and labeled with a fitness value using a predefined merit function, presented below. After updating the position vectors of each binary word in each iteration as presented in Fig. 7, the algorithm finds the global minimum corresponding to the optimal model, based on the merit function, after a number of iterations. The flowchart of the implementation of the BPSO using the connected CST Microwave Studio simulator and MATLAB is shown in Fig. 8. To apply the BPSO algorithm to the design of a 2D photonic crystal, the filling pattern of the unit cell with 2D structure must be converted into a binary word. The BPSO steps presented in Fig. 7 are used in each iteration to find the global minimum of the merit function. The unit cell is divided into \(2N\times 2N\) pixels, each of which can be filled with either air or silicon dielectric material. In this work, we suppose that the primitive unit cell, which is centered at the origin as in Fig. 9a, is symmetrical and invariant under mirror reflections with respect to the horizontal XZ plane and vertical YZ plane (shown by bold lines). Thus, the whole photonic crystal structure can be designed by the pixel-filling pattern of a square representing one-quarter of the unit cell, using a binary word of \(N\times N\) bits. The total number of possible structures is \(2^{N\times N}\), and even for \(N = 5\), there are already 33,554,432 different unit cell structures. For such a large search space, the full-space search method is not practical for finding the best model. We thus apply BPSO, a heuristic optimization algorithm, as an effective method to solve this problem. The BPSO used in the present paper can be described as follows: In step 1, we randomly construct the initial candidate \(N\times N, 5\times 5\) binary words; i.e., each bit of the \(N\times N\) binary word at the first iteration is set randomly to 0 or 1. In general, a 2D structure corresponding to a randomly produced binary word results in weak antenna characteristics. To speed up the search, we introduce a particular binary word as a special model candidate in the initial population while the other binary words are all randomly created by the computer. The structure corresponding to the special binary word is a binary representation of the PBG substrate presented in Sect. 2 whose binary filling pattern is shown in Fig. 9b. In step 2, we compute the fitness value for each binary word. Meanwhile, the fitness of a binary word is predefined by merit functions based on CST Microwave Studio results for the antenna characteristics including the gain, return loss, or \(-10\)-dB bandwidth, as defined in the coming sections. In step 3, we update the position vector of each binary word by, first, computing velocity vectors using Eq. (4), then calculating the probability vectors for changing the elements of the position vector using the translation function defined in Eq. (5), and finally updating the position vectors, i.e., the binary words, using Eq. (6). In step 4, we repeat steps 2 and 3 until the optimal structure, corresponding to the minimum fitness value, is reached. As a numerical application, to avoid the optimal structure becoming impractical for fabrication, having too thin veins or too small holes, and as a compromise considering computational costs, we take \(N=5\); i.e., the unit cell is divided into \(10\times 10\) pixels. In this case, each binary word has 25 bits, and we choose 20 particles for each swarm with a maximum number of iterations of 1000.

Fig. 8
figure 8

The flowchart of the optimization process

Fig. 9
figure 9

The unit cell optimization grid (frame). a The index of each binary word bit in the unit cell geometry, b the filling pattern of the presented air cylinder unit cell

Fig. 10
figure 10

The geometry of the optimized a filling pattern of the unit cell and b antenna 2

3.3 Return loss optimization

The method presented in Sect. 3.2 is used to guide the design and optimization of the photonic crystal substrate. To optimize the return loss, the following merit function for the BPSO is selected Eq. (6), where S is the return loss \(S_{11}\), G is the gain, and sgn is the sigmoid function:

$$\begin{aligned} \begin{aligned} M(S,G)=&\left[ S^3 \frac{{\mathrm{sgn}}(-S-10)+1}{2}+ S\frac{{\mathrm{sgn}}(S+10)+1}{2}\right] \\&\times \left[ G \frac{{\mathrm{sgn}}(-G+7.5)+1}{2}+G^5 \frac{{\mathrm{sgn}}(G-7.5)+1}{2}\right]. \end{aligned} \end{aligned}$$
(7)

During the BPSO process, the minimum fitness of the binary words of a swarm does not always decrease. In such a case, we avoid the degradation of the best binary word. Hence, we give greater reward when the gain or return loss crosses threshold values in the antenna characteristics; these threshold values in the merit function for the gain and return loss are assigned values of 7.5 and \(-10\) dB, respectively. After long evaluations of more than 65 iterations with more than 1300 structures, the minimum of the fitness function achieved is \(-1.7594\times 10^{10}\). The corresponding optimal structure with the minimum fitness value is shown in Fig. 10a. Note that the pixels of the structure corresponding to silicon material are well connected to each other, as intended. This photonic crystal structure is used as a substrate to form antenna 2, as shown in Fig. 10b. According to Fig. 11, the return loss achieved by antenna 2 is \(-67.49\) dB at 0.6 THz, compared with \(-64.04\) dB (an enhancement of 5.39 %) and antenna gain performance similar to that of antenna 1 (9.17 dB). Moreover, another resonant frequency is achieved at 0.65 THz, with return loss of \(-29.25\) dB. Hence, antenna 2 becomes a dual-band antenna at around 0.65 THz, with narrower bandwidth that is suitable for different applications. Figure 12 shows the sidelobe suppression characteristics in the YZ plane for antenna 2, for comparison with the results for antenna 1 in Fig. 6.

Fig. 11
figure 11

The magnitude of the \(S_{11}\) parameter in the terahertz band for antenna 2

Fig. 12
figure 12

The radiation pattern in the XZ and YZ planes of antenna 2 based on the PBG substrate at its resonant frequency

3.4 Bandwidth optimization

In this section, optimization of the bandwidth is performed using CST Microwave Studio controlled by MATLAB using the BPSO algorithm as described above. To optimize the bandwidth, the following merit function is used in the BPSO, as shown in Eqs. (8) and (9), where BW is the \(-10\)-dB bandwidth, \(F_{\mathrm{B}}\) is the fractional bandwidth, \(f_{\mathrm{r}}\) is the resonant frequency, G is the gain, and sgn is the sigmoid function:

$$\begin{aligned}&F_{\mathrm{B}}=\frac{{\mathrm{BW}}}{f_{\mathrm{r}}}\times 100, \end{aligned}$$
(8)
$$\begin{aligned}&M(F_{\mathrm{B}},G)=-\left[ G \frac{{\mathrm{sgn}}(-G+7.5)+1}{2} +\,G^2 \frac{{\mathrm{sgn}}(G-7.5)+1}{2}\right] \nonumber \\&\qquad \qquad \qquad \quad \times \,\left[ F_{\mathrm{B}}^2 \frac{{\mathrm{sgn}}(F_{\mathrm{B}}-10)+1}{2}+ F_{\mathrm{B}}\frac{{\mathrm{sgn}}(-F_{\mathrm{B}}+10)+1}{2}\right]. \end{aligned}$$
(9)

As in Sect. 3.3, the threshold values for the gain and fractional bandwidth in the merit function are assigned values of 7.5 and 10, respectively. After long evaluations of more than 26 iterations with more than 520 structures, the minimum value of the fitness achieved is \(-7.4307 \times 10^{4}\). The corresponding optimal structure with the minimum fitness value is shown in Fig. 13a, from which it is observed that the pixels in the structure composed from silicon material are connected to each other, as intended. The antenna based on this photonic crystal structure as a substrate is named antenna 3 and is shown in Fig. 13b. The \(-10\)-dB bandwidth achieved by antenna 3 is 128 GHz, with resonant frequency of 0.62 THz, compared with 56 GHz for antenna 1 (an enhancement of 128.57 %), as presented in Fig. 14 with antenna gain performance close to that of antenna 1 (9.17 dB). According to Fig. 15, the characteristics of antenna 3 exhibit a worthwhile reduction of the sidelobes in the YZ plane compared with antenna 1.

Fig. 13
figure 13

The geometry of the optimized a filling pattern of the unit cell, and b antenna 3

Fig. 14
figure 14

The magnitude of the \(S_{11}\) parameter in the terahertz band for antenna 3

Fig. 15
figure 15

The radiation pattern in the XZ and YZ planes of antenna 3 based on the PBG substrate at its resonant frequency

The proposed antennas, which exhibit gain close to 9.17 dB, are compared with the results of existing antennas in the literature that offer gain of 7.94 dB [23], 3.8 dB [41], and 5.09 dB [42] in Table 2. This comparison reveals that the antennas presented herein are favorable based on the requirements of the desired applications.

Table 2 A comparison of the antennas presented herein with some existing designs

4 Conclusions

A microstrip patch antenna based on a synthesized photonic crystal substrate is designed and analyzed using a technique based on the combination of a BPSO algorithm with CST Microwave Studio simulations. The initial antenna is designed by analyzing air cylinders embedded in a thick silicon substrate having high relative permittivity. Indeed, the PBG substrate reduces the effect of surface wave losses, resulting in useful antenna electrical characteristics, but the results are enhanced further when CST Microwave Studio is combined with binary particle swarm optimization, which is shown to be useful to synthesize a well-designed PBG substrate for terahertz microstrip antennas with desirable characteristics for future applications. It is shown that antenna 2 is suitable for dual-band applications at around 0.65 THz with enhanced return loss of 5.39 % compared with antenna 1. There is also a remarkable improvement in the fractional bandwidth for the microstrip patch antenna based on the synthesized photonic crystal substrate (antenna 3), which is increased by 128 % compared with the initial antenna (antenna 1). Furthermore, both of these optimization results reveal that a reduction in the sidelobes is achieved compared with the initial antenna design. The enhancement in these results is due to the synthesized photonic crystal substrates presented herein. The obtained antennas have resonant frequencies at around 0.65 THz, as required for current wireless communication technology and in other different interesting applications.