Introduction

In the last decade, the advancement in photonic crystal technology has attracted researchers in this field. The one-dimensional (1D) periodic structure was studied by L. Rayleigh in 1887 and he observed the possibilities of complete reflected regions of light (Rayleigh 1887). Since 1987, the photonic crystals have been promising and attract a great deal of interest of researchers (Yablonovitch 1987; John 1987; Yablonovitch and Gmitter 1989; Joannopoulos et al. 1997). The photonic crystals are spatial periodic artificial micro- and nanostructures with periodically modulated refractive index constants on the wavelength scale. The existence of allowed and forbidden photonic bands in such structures is similar to the electronic band of periodic potentials. Due to this specific property, this structured optical material is known as photonic bandgap (PBG) material (Li et al. 1996). Multiple applications arise for the different structures and dimensions of photonic crystals due to their dependency on many external parameters as optical sensors (Exner et al. 2013; Aly and Zaky 2019; Abd El-Ghany et al. 2020; Aly et al. 2020, 2021; Zaky and Aly 2020, 2021a; Han and Wang 2003; Zhang et al. 2015b), narrow-band optical filters (Usievich et al. 2002), photonic crystal lasers (Lončar et al. 2002), multilayer’s coatings (Szipöcs et al. 1994), Bragg reflectors (Han and Wang 2003), etc.

Recently, Tamm resonance has gained much more impact on layer material composition optical properties for many applications. The effective optical sensing quality of Tamm resonance attracts researchers in the sensing field (Zaky and Aly 2021b; Zaky et al. 2021; Ahmed and Mehaney 2019; Awasthi et al. 2006). Tamm resonance was theoretically predicted in 2006–2007 (Vinogradov et al. 2006; Kaliteevski et al. 2007) and experimentally investigated for the first time in 2008 by Sasin et al. (Sasin et al. 2008). Tamm resonance is created at the metal/multilayer interface. The junction between the metal and a dielectric Bragg mirror is responsible for the formation of the Tamm plasmon polariton. Experimentally and theoretically the Tamm resonance in PCs is reported by B. Auguie et al. (Auguié et al. 2015). Tamm resonance excited by graphene is used to model a biosensor by Zaky et al. (Zaky and Aly 2021b). A high-performance gas sensor is developed by Zaky et al. using Tamm resonance inside the photonic bandgap (Zaky et al. 2020). In contrast to surface plasmon resonance, Tamm resonance can be excited by either TM or TE-polarized light, and directly coupled to surface plasmons or light modes (Azzini et al. 2016), which makes it very distinguished for biosensing applications.

Fano resonance is produced by the superposition between a broad continuum of states and a narrow resonance (Emani et al. 2014). Fano resonance using Bragg reflectors and metal nanostructures was observed (Karmakar et al. 2020; Ahmed and Mehaney 2019). Fano resonance can be used in biosensing applications because it records high local environment sensitivity (Luk'yanchuk et al. 2010).

Porous layers attracted the attention of researchers in biosensing applications. The word porosity comes from the Greek word porous for pores which means void or tiny holes. The quality of porous medium is known as porosity. The volumetric fraction of pores/voids in the material is known as porosity. The gases or fluids can go through such kind of materials which have porosity and this is the fundamental principle on which porous 1D-PC sensors works. Porous 1D-PC can sense solutions, gases, liquids, chemical, and biomedical fluids of different concentrations based on minor changes of the refractive indices. Porous Gallium nitride (GaN) has been used as an alternative multilayer Bragg reflector (Zhu et al. 2017). GaN provides an index of refraction contrast with perfect lattice matching (Lheureux et al. 2020; Yerino et al. 2011). Besides, the refractive index can be controlled by tuning the porosity by etching or doping (Zhang et al. 2015a). Porous GaN can easily be integrated with active devices that makes it very interested than porous dielectrics (Wang et al. 2007). Lheureux et al. (Lheureux et al. 2020) experimentally investigated the porous GaN by the wet EC etching technique using standard photolithography.

In this paper, the coupling between Fano and Tamm resonance will be investigated. A gold/porous semiconductor photonic crystal is proposed in the far-infrared wavelength region. The next section provides the materials and TMM model for numerical computing. Numerical results and discussions are presented and explained in the third section. Finally, the fourth section is the part where we describe our conclusions.

Materials and methods

The proposed schematic structure of our biophotonic sensor is prism/Au/porous GaN/(GaN/porous GaN)N/substrate as clear in Fig. 1. The prism is used as an incident medium. An interface layer of gold metal and porous gallium nitride is inserted on the top of the structure and after that a binary 1D-PC of alternate layers of gallium nitride and porous gallium nitride with gallium nitride substrate complete the proposed structure. The total number of layers (N) of binary 1D-PC is taken as 20 layers. The incident light used here is transverse electric (TE) polarization which is also known as s-polarization. The thicknesses of the gold layer and the first single layer of porous gallium nitride are chosen as dm = 30 nm and ds = 7000 nm with porosity (Ps) of 53%. This porosity (53%) will be used because it was experimentally prepared (Lheureux et al. 2020). The refractive indices of 1D-PC constituents are n1 (as Eq. 2) of gallium nitride and n2 (as Eq. 1) of porous gallium nitride along with thicknesses d1 = 500 nm and d2 = 800 nm. The porosity P2 corresponds to layer d2. There are many theoretical (Ahmed and Mehaney 2019) (Ahmed et al. 2020) and experimental (Yang et al. 2017) literature that uses Au to excite Tamm resonance (plasmon polariton resonance) in this range of wavelength that we use. Besides, we select these conditions of thicknesses and porosities after optimization study to achieve the highest performance.

Fig. 1
figure 1

The Kretschmann prism-coupled structure of the proposed refractive index

A multilayer of GaN/porous GaN was experimentally investigated (Lheureux et al. 2020) (Zhu et al. 2017). The pores of the porous GaN have been infiltrated with the sample by injecting the sample at the top of the structure as shown in Fig. 1.

The volume average theory is used to calculate the refractive index of the porous GaN (\({\mathrm{n}}_{2}\)) (Zhang et al. 2015a):

$$\begin{array}{l}{n}_{2}=\sqrt{\left(1-P\right){{n}_{1}}^{2}+P{{n}_{s}}^{2}}\end{array},$$
(1)

where P is the porosity ratio, \({\mathrm{n}}_{\mathrm{s}}\) is the refractive index of the sample that infiltrated inside the pores (will be changed from 1 to 1.1), and \({\mathrm{n}}_{1}\) is the refractive index of GaN. The value of \({\mathrm{n}}_{1}\) is calculated as a function of wavelength (\(\lambda \)) as follows (Barker and Ilegems, 1973):

$$\begin{array}{l}{\mathrm{n}}_{1}=\sqrt{3.6+\frac{1.75{\lambda }^{2}}{{\lambda }^{2}-{0.256}^{2}}+\frac{4.1{\lambda }^{2}}{{\lambda }^{2}-{17.86}^{2}}}\end{array}$$
(2)

The refractive index of the prism is 2.5, which will be optimized later. The permittivity of the gold layer can be calculated by the Drude model (Celanovic et al. 2005; Ordal et al. 1985):

$${\varepsilon }_{m}=1-\frac{{{\omega }}_{{p}}^{2}}{{{\omega }}^{2}+i\gamma \omega }.$$
(3)

The transfer matrix method (TMM) is an appropriate method to solve the multilayer structure problem. The comprehensive analysis of TMM is given in many pieces of literature (Yeh 1988; Skorobogatiy and Yang 2009; Macleod 2017). The reflectivity of the proposed structure is calculated using the well-known TMM method. We consider the interaction between structure and incident electromagnetic wave (EMW) along with normal and variable oblique incident angle. It is described by the matrix given as follows (Yeh 1988; Skorobogatiy and Yang 2009; Macleod 2017):

$$G=\left|\begin{array}{cc}{G}_{11}& {G}_{12}\\ {G}_{21}& {G}_{22}\end{array}\right|=\left({g}_{m}{)(g}_{sam}\right){\left({g}_{1}{g}_{2}\right)}^{N},$$
(4)

where \({G}_{11}\), \({G}_{12}\), \({G}_{21}\) and \({G}_{22}\) are elements of the transfer matrix. Here, \({g}_{m}\),\({g}_{sam}\),\({g}_{1}\) and \({g}_{2}\) are characteristic matrix corresponding to metal Au, sample porous GaN, GaN, and porous GaN which are as follows:

$$ g_{k} = \left( {\begin{array}{*{20}c} {cos\theta ,_{k} } & { - \frac{i}{{p_{E} }}sin\theta _{k} } \\ { - ip_{E} sin\theta _{k} } & {cos\theta _{k} } \\ \end{array} } \right), $$
(5)

where k = m, sam, 1, 2, and substrate. The \({\varnothing }_{k}\) is phase difference at each layer and it is denoted by

$$ \phi _{k} = {\text{~}}\frac{{2\pi n_{k} d_{z} {\text{cos}}\phi _{k} }}{\lambda }. $$
(6)

The values of \({p}_{E}\) for the TE(S) polarization is given by \({p}_{E}={n}_{k}cos\left({\theta }_{k}\right)\). The incident angle \({\theta }_{0}\), \({\theta }_{m}\), \({\theta }_{sam}\), \({\theta }_{1}\), \({\theta }_{2}\) and \({\theta }_{substrate}\) are at the surfaces of the prism, metal Au, sample porous GaN, GaN, porous GaN, and substrate. Here, angle \({\theta }_{0}\) represents the angle of incidence of the incident light from the prism to the proposed structure and satisfying the Snells law as follows:

$${n}_{0}sin\left({\theta }_{0}\right)={n}_{m}sin\left({\theta }_{m}\right)={n}_{sam}sin\left({\theta }_{sam}\right)={n}_{1}sin\left({\theta }_{1}\right)={n}_{2}sin\left({\theta }_{2}\right)={n}_{s}sin\left({\theta }_{s}\right).$$

The matrix \({\left({g}_{1}{g}_{2}\right)}^{N}\) has been calculated using the Chebyshev polynomials of the second kind. Using the above equations, the reflection coefficient can be derived as follows:

$$r=\frac{\left({G}_{11}+{G}_{12}{p}_{s}\right){p}_{0}-\left({G}_{21}+{G}_{22}{p}_{s}\right)}{\left({G}_{11}+{G}_{12}{p}_{s}\right){p}_{0}-\left({G}_{21}+{G}_{22}{p}_{s}\right)}.$$

Finally, the reflectance of the EMW through the structure as follows:

$$ R\left( \% \right) = 100*r^{2} . $$

Results and discussions

The proposed schematic structure is prism/Au/porous GaN/(GaN/porous GaN)N/substrate. The EMW is normally incident on the gold/porous semiconductor photonic crystal with TE polarization. The reflectance of the incident EMW for this device is plotted versus the wavelength. Initially, the reflectance versus wavelength is plotted for the structure without the gold layer along with the refractive index of sample 1.1 (nsam = 1.1). The other variables are discussed in the materials and method section. As we observe from Fig. 2A, the structure without gold has a bandwidth of PBG (724.9 nm). By inserting a gold layer at the top of the device, then the PBG is enhanced drastically and becomes wide PBG (nearly complete PBG in the wavelength range of interest). The constructive interference at the interface of every layer is responsible for the formation of the PBG (Yablonovitch 1987; Yablonovitch and Gmitter 1989). The presence of the gold layer at the top of the structure also creates the Tamm–Fano resonance mode in the spectra at wavelength 4889.2 nm, as clear in Fig. 2A. The formation of Tamm–Fano resonance dip is due to the interference between EMWs at the interface of gold metal and the PC (Kumar et al. 2017). The Tamm mode couples with the Fano modes at the time of formation. The basic fundamental of the creation of asymmetric line shape Fano modes is the interaction between the slowly alterable backdrop and narrow mode (Joe et al. 2006). The Tamm–Fano couple mode enhances the capability or performance of the proposed sensor.

Fig. 2
figure 2

The reflectance of the proposed sensor A at nsam = 1.1, and B at different values of nsam

The reflectance of the proposed sensor shows that when the sample refractive index increases, the Tamm–Fano resonance dip is red-shifted towards a higher wavelength. When the refractive index of sample ns increases from 1.0 to 1.1 the resonance dip wavelength is red-shifted from 4811.8 to 4889.2 nm. The performance and efficiency of the photonic sensor can be evaluated by various parameters such as the sensitivity (S), the figure of merit (FoM), signal to noise ratio (SNR), resolution (RS), detection limit (LoD), quality factor (Q) and dynamic range (DR) that can be calculated as follows (Ayyanar et al. 2018; Panda and Devi 2020):

$$S=\frac{{\Delta }{\lambda }_{R}}{{\Delta }{n}_{sam}},$$
(10)
$$FoM=\frac{S}{FWHM},$$
(11)
$$ {\text{SNR}} = \frac{{\Delta \lambda _{{{\text{RFW}}}} }}{{{\text{HM}}}}, $$
(12)
$$ {\text{RS}} = \frac{{2\left( {{\text{FWHM}}} \right)}}{{3\left( {{\text{SNRNR}}} \right)^{{\frac{1}{4}}} }}, $$
(13)
$$ \begin{array}{*{20}l} {{\text{LOD}} = \frac{{\lambda _{{\text{R}}} }}{{20{\text{~S~Q}}}}} \hfill \\ \end{array} , $$
(14)
$$ \begin{array}{*{20}l} {{\text{Q}} = \frac{{\lambda _{{\text{R}}} }}{{{\text{FWHM}}}}} \hfill \\ \end{array} , $$
(15)
$$ \begin{array}{*{20}c} {{\text{DR}} = \frac{{\lambda _{{\text{R}}} }}{{\sqrt {{\text{FWHM}}} }}} \\ \end{array} , $$
(16)

where \( \Delta f_{R} ,{\text{~}}\Delta n_{{{\text{sam}}}} , \) and \( {\text{FWHM}} \) are the frequency change in resonant dip, the change in the refractive index of the sample, and the bandwidth of the resonant dip, respectively.

The air is used as a reference medium to calculate the variations in the position of the resonance dip with the refractive index for different media. \( \Delta \lambda _{R} = \lambda _{R} \left( s \right) - \lambda _{R} ({\text{air}}) \) and\( \Delta n_{s} = n_{R} \left( s \right) - n_{R} ({\text{air}}) \). From Fig. 2B, \( \Delta \lambda _{R} = 77.4{\text{~nm}} \) and\( \Delta n_{{{\text{sam}}}} = 0.1 \). Using these values, the parameters are calculated and their values are given as: S = 774.4 nm/RIU, R = 33.7%, FWHM = 2.2384 nm, FoM = 346, Q = 2184, LoD = 1.4*10–4, SNR = 34.6, RS = 0.615, and DR = 3267.

To enhance the performance of the device, optimization processes will be done. Now, the effects of different parameters such as sample layer thickness, the porosity of the sample, angle of incidence will be observed, and the refractive index of the prism.

Effect of sample layer thickness (d s):

In this section, the performance and efficiency of the proposed sensor at different sample thicknesses are investigated. At high values of sample thicknesses 7000 nm, 10,000 nm, 15,000 nm, 20,000 nm, 25,000 nm, and 30,000 nm, the sensitivities are 774.4 nm/RIU, 798.4 nm/RIU, 825.6 nm/RIU, 833.2 nm/RIU, 852.4 nm/RIU, 845.9 nm/RIU, as clear in Fig. 3A. The observed results show that the sensitivity increases with the sample thickness increase and reaches a maximum value at 25,000 nm, then onwards it decreases. The interaction between EMWs and samples is enhanced because the geometrical path difference of the sample layer increases and this leads to a higher sensitivity. In addition, strong electric field confinement is created and the performance of the device drastically is improved. The sample layer thickness of 25,000 nm can be considered as the optimized value. If there is an onward increment in the thickness, it causes the appearance of the new peaks and a slight change in the sensitivity. There is a decrement in the FWHM concerning sample thickness as clear in Fig. 3A. The results extracted from Fig. 3B are that Q-factor and FoM are also enhanced and the performance of the sensor becomes better. Similarly, Fig. 3C indicates that the SNR and DR values are improved with the thickness increase. Besides, Fig. 3D indicates that values of LoD and RS record lower values versus thickness increase. Hence at the optimized thickness, the overall performance and efficiency are improved amazingly. The empirical relations that govern these behaviors are

Fig. 3
figure 3

The performance of the proposed sensor at different sample thicknesses

$$ {\text{~S}} = - 2\, \times \,10^{{ - 7}} d_{z}^{2} + 0.0098d_{{\text{s}}} + 716.18,~\quad ({\text{R}}^{{{2}}} = ~0.9818), $$
(17)
$$ {\text{FWHM}} = 3 \times 10^{{ - 9}} d_{z}^{2} - 0.0002d_{{\text{s}}} + 3.3228,{\text{~}}\quad {\text{~}}({\text{R}}^{{\text{2}}} {\text{~}} = {\text{~}}0.9971) $$
(18)
$$ {\text{FoM}} = 2 \times 10^{{ - 7}} d_{z}^{2} + 0.0344d_{{\text{s}}} + 82.697,\quad ({\text{R}}^{{\text{2}}} {\text{~}} = {\text{~}}0.9971), $$
(19)
$$ {\text{SNR}} = 2 \times 10^{{ - 8}} d_{z}^{2} + 0.0034d_{{\text{s}}} + 8.2697,\quad ({\text{R}}^{{\text{2}}} = {\text{~}}0.9973) ,$$
(20)
$$ {\text{LoD}} = 2 \times 10^{{ - 13}} d_{z}^{2} - 10^{{ - 8}} d_{{\text{s}}} + 0.0002{\text{~}}\quad ({\text{R}}^{{\text{2}}} = {\text{~}}0.9970),$$
(21)
$$ {\text{DR}} = - 2\, \times \,10^{{ - 6}} d_{z}^{2} + 0.1891d_{{\text{s}}} + 1990.3,\quad {\text{~}}({\text{R}}^{{\text{2}}} {\text{~}} = {\text{~}}0.9980) ,$$
(22)
$$ {\text{LoD}} = 2\, \times \,10^{{ - 13}} d_{z}^{2} - 10^{{ - 8}} d_{{\text{s}}} + 0.0002\quad {\text{~}}({\text{R}}^{{\text{2}}} {\text{~}} = {\text{~}}0.9970),$$
(23)
$$ {\text{RS}} = 10^{{ - 9}} d_{z}^{2} - 6*10^{{ - 5}} d_{{\text{s}}} + 0.9691{\text{~}},\quad \left( {{\text{R}}^{2} = {\text{~}}0.9963} \right). $$
(24)

Effect of sample layer porosity (p s)

In this work, we are using porous GaN. Here, volume average theory is used to calculate the refractive index of GaN [34]. The effective refractive index of porous GaN layers is manipulated by the porosity sample material filling the pores. Using this peculiar property, any desired refractive index can be gained. The refractive index of the porous GaN at λ = 5000 nm can be changed from 2.24 to 1.00 due to porosity variation from 0 to 100% at ns = 1. The effective refractive index increases with the increment of the refractive index of sample filling material for different porosity. For higher porosity from 0 to 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, and 90%, the sensitivity increased from 34 nm/RIU to 130 nm/RIU, 247 nm/RIU, 387 nm/RIU, 561 nm/RIU, 780 nm/RIU, 1063 nm/RIU, 1439 nm/RIU, 1956 nm/RIU, and 2853 nm/RIU. The results observed in Fig. 4A are impressive and the sensitivity of the sensor increases with porosity. The FWHM as in Fig. 4A is initially very high but the transition occurs at 80% porosity. After that, the FWHM decreases dramatically which is responsible for the enhancement in other parameters and the performance of the sensor. Figure 4B reflects how FoM and quality factor rises with the growth in porosity. By observing Fig. 4C, we conclude that SNR rises versus porosity. The DR values are initially constant up to porosity of 80% but onwards it climbs at 90% porosity. In Fig. 4D, LoD and RS concerning porosity curves are shown. The LoD and RS values reduce with porosity increment. The empirical relations that govern these behaviors are

Fig. 4
figure 4

The performance of the proposed sensor at different sample layer porosity

$$ S = 0.3824P_{z}^{2} - 6.3137P_{{\text{s}}} + 139.61,{\text{~}}\quad {\text{~}}({\text{R}}^{{\text{2}}} {\text{~}} = {\text{~}}0.9860), $$
(25)
$$ {\text{FWHM}} = - 4\, \times \,10^{{ - 8}} P_{s}^{4} + 5*10^{{ - 6}} P_{s}^{3} - 0.0002P_{s}^{2} + 0.0039P_{{\text{s}}} + 0.825,{\text{~}}\quad ({\text{R}}^{{\text{2}}} = {\text{~}}0.9776), $$
(26)
$$ {\text{FoM}} = 85.8e^{{0.045P_{{\text{s}}} }} ,{\text{~}}\quad ({\text{R}}^{{\text{2}}} {\text{~}} = {\text{~}}0.9868), $$
(27)
$$ Q = 10^{{ - 5}} P_{s}^{5} - 0.0027P_{s}^{4} + 0.1777P_{s}^{3} - 4.6339P_{s}^{2} + 38.825P_{{\text{s}}} + 6093.8,\quad ({\text{R}}^{{\text{2}}} = {\text{~}}0.9878), $$
(28)
$$ {\text{SNR}} = 8.58e^{{0.045P_{{\text{s}}} }} ,\quad ({\text{R}}^{{\text{2}}} {\text{~}} = {\text{~}}0.9868), $$
(29)
$$ {\text{DR}} = 7\, \times \,10^{{ - 6}} P_{s}^{5} - 0.0014P_{s}^{4} + 0.093P_{s}^{3} - 2.4415P_{s}^{2} + 22.255P_{{\text{s}}} + 5557.3,{\text{~}}\quad ({\text{R}}^{{\text{2}}} = {\text{~}}0.9832), $$
(30)
$$ LoD = - 5{\text{*}}10^{{ - 12}} P_{s}^{5} + 10^{{ - 9}} P_{S}^{4} - 10^{{ - 7}} P_{s}^{3} + 6{\text{*}}10^{{ - 6}} P_{Z}^{2} - 0.0001P_{{\text{s}}} + 0.0012,{\text{~}}\quad ({\text{R}}^{{\text{2}}} = {\text{~}}0.9951), $$
(31)
$$ {\text{RS}} = - 10^{{ - 6}} P_{s}^{3} + 0.0002P_{s}^{2} - 0.0099P_{{\text{s}}} + 0.3802,{\text{~}}\quad \left( {{\text{R}}^{2} = {\text{~}}0.9912} \right). $$
(32)

All observations collectively show that the performance of the sensor is optimized with 90% porosity.

Effect of the incident angle

The resonance dip is affected by the variation of the angle of incidence. It is investigated that the position of the Tamm–Fano dip moves towards a lower wavelength (blue shift) as the angle of incidence increases according to Brag Snell’s law (Schroden et al. 2002; Armstrong and O'Dwyer 2015):

$$\mathbb{N}\lambda =2d\sqrt{{n}_{eff.}^{2}-{sin}^{2}}{\theta }_{0},$$
(33)

where \(\mathbb{N}\), \(\lambda \), \(d\), \({n}_{eff.}\) and \({\theta }_{0}\) are constructive diffraction order, Tamm–Fano resonance wavelength, period, the effective refractive index of the porous GaN 1D-PC, and angle of incidence, respectively. The effective refractive index of the whole structure can be easily calculated using Bruggeman’s effective medium approximation (BEMA) equation (Ahmed and Mehaney 2019; Salem et al. 2006).

It is observed that by increasing the incident angle, the sensitivity is rapidly increasing, and the dips overlap with each other. To solve this problem, we study the effect of changing the sample refractive index from 1 to 1.01. If the angle of incidence increases from 0 to 27.5 degrees the sensitivity moved from 0.29*104 nm/RIU to 2.9*104 nm/RIU. The results observed in Fig. 5A are impressive and the sensitivity of the sensor increases with the angle of incidence. The FWHM is initially very high but the transition occurs at 26 degrees, as in Fig. 5A. After that, the FWHM decreases dramatically which is responsible for the enhancement in sensitivity and performance of the sensor. Figure 5B reflects that how FoM and quality factor rises with the growth in the angle of incidence. By observing Fig. 5C, we conclude that SNR rises sharply after 20 degrees versus the angle of incidence. The DR values are also slowly rising but onwards it climbs at 20 degrees. At last in Fig. 5D, LoD and RS concerning porosity curves are shown. The LoD and RS values reduce with the angle of incidence increment. The empirical relations that govern these behaviors are

Fig. 5
figure 5

The performance of the proposed sensor at different incident angles

$$ S = 0.0548\theta _{0}^{5} - 3.2554\theta _{0}^{4} + 67.847\theta _{0}^{3} - 566.91\theta _{0}^{2} + 1577.8\theta _{0} + 2816.5,\quad ({\text{R}}^{{\text{2}}} {\text{~}} = {\text{~}}0.9818), $$
(34)
$$ {\text{FWHM}} = - 3\, \times \,10^{{ - 6}} \theta _{0}^{4} \, + \,9\, \times \,10^{{ - 5}} \theta _{0}^{3} - 0.0013\theta _{0}^{2} + 0.0047\theta _{0} + 0.8293,{\text{~}}\quad ({\text{R}}^{{\text{2}}} {\text{~}} = {\text{~}}0.9525), $$
(35)
$$ Q = 0.0547\theta _{0}^{4} - 2.4345\theta _{0}^{3} + 34.198\theta _{0}^{2} + 136.08\theta _{0} + 5982,\quad ({\text{R}}^{{\text{2}}} = {\text{~}}0.9727), $$
(36)
$$ {\text{LoD}} = - 2\, \times \,10^{{ - 8}} \theta _{0}^{2} - 4\, \times \,10^{{ - 8}} \theta _{0} + 10^{{ - 5}} ,\quad {\text{~}}({\text{R}}^{{\text{2}}} {\text{~}} = {\text{~}}0.9989), $$
(37)
$$ {\text{RS}} = - 10^{{ - 5}} \theta _{0}^{3} + 0.0002\theta _{0}^{2} + 0.0015\theta _{0} + 0.2293,\quad \left( {{\text{R}}^{{\text{2}}} = {\text{~}}0.9903} \right). $$
(38)

All observations collectively show that the performance of the sensor is optimized at 27.5 degrees. Above 27.5 degrees, total internal reflection takes place. Hence the device is only better to use up to 27.5 degrees.

Effect of the refractive index of prism

In this section, the performance of the proposed sensor at different values of the refractive index of the prism is investigated. By increasing the refractive index of the prism from 1 to 2.5(Wu et al. 2016; Lide 2004), the performance of the proposed sensor increased as clear in Table 1. The optimum value of the refractive index of the prism is 2.5, which achieves the highest performance.

Table 1 Effect of the refractive index of prism on the performance of the sensor

The optimized parameters are sample thickness 25,000 nm, porosity 90%, and angle of incidence 27.5 degrees. The reflectance of the proposed sensor at the optimum conditions for different values of ns is shown in Fig. 6. The reflectance dip is shifted towards a higher wavelength with an increment in sample refractive index. The reflectance dip is very sensitive to a minor increment in sample refractive index.

Fig. 6
figure 6

The reflectance of the proposed sensor at the optimum conditions for different values of ns

At the optimum conditions, the shift in wavelength (∆λ) is 287.5 nm with variation in sample refractive index (∆ns) is 0.01, sample thickness 25,000 nm, porosity 90%, and angle of incident 27.5 degrees. Using these optimized values, the parameters are calculated and their values are S = 28,753 nm/RIU, Reflectance 19.5%, FWHM = 0.438 nm, FoM = 65,649, Q = 9039, LoD = 8*10–7, SNR = 656.5, RS = 5.8*10–2, and DR = 5982.

According to Table 2, the proposed photonic sensor has high sensitivity, FoM, and Q-factors compared to previous works. Hence, our sensor can be used in place of previous sensors due to its high performance and efficiency. Our study records sensitivity 2875 times higher than the experimental study of a similar structure in other wavelength range (Lheureux et al. 2020).

Table 2 Performance comparison (NC = not be calculated)

Conclusion

The main objective of the proposed device is to introduce a theoretical high sensitivity and high-quality factor photonic sensor to detect the very small variation in refractive index. Our device depends upon the creation of coupling of Tamm–Fano resonance in gold/porous semiconductor photonic crystal. The TMM method is used to calculate and analyze the results. Initially, the parameters of the structure are sample thickness 7000 nm and porosity 53% of porous GaN. The sensitivity 774.4 nm/RIU, FoM 346, and quality factor 2184 are investigated for this structure. The optimized parameters of the structure for TE mode polarization are sample thickness 25,000 nm, porosity 90% of porous GaN, and angle of incidence 27.5 degrees. The sensitivity, FoM, and Q-factor observed from this device are 28,753 nm/RIU, 6.6*104 RIU−1, and 9*108. The obtained results show the high performance of the proposed photonic sensor by comparing it with its counterparts in planar-annular 1D-PC and surface plasmon resonance sensors. Due to its high local environment sensitivity, the designed photonic sensor can be used as refractive index gas and fluid sensor. It can be also used in photonic and optoelectronic applications.