Temperature-Switch-Controlled Second Harmonic Mode Sensor for Brain-Tissue Detection

Identifying brain-tissue types holds significant research value in the biomedical field of non-contact brain-tissue measurement applications. In this paper, a layered metastructure is proposed, and the second harmonic generation (SHG) in a multilayer metastructure is derived using the transfer matrix method. With the SHG conversion efficiency (CE) as the measurement signal, the refractive index ranges that can be distinguished are 1.23~1.31 refractive index unit (RIU) and 1.38~1.44 RIU, with sensitivities of 0.8597 RIU−1 and 1.2967 RIU−1, respectively. It can distinguish various brain tissues, including gray matter, white matter, and low-grade glioma, achieving the function of a second harmonic mode sensor (SHMS). Furthermore, temperature has a significant impact on the SHG CE, which can be used to define the switch signal indicating whether the SHMS is functioning properly. When the temperature range is 291.4~307.9 Kelvin (K), the temperature switch is in the “open” state, and the optimal SHG CE is higher than 0.298%, indicating that the SHMS is in the working state. For other temperature ranges, the SHG CE will decrease significantly, indicating that the temperature switch is in the “off” state, and the SHMS is not working. By stimulating temperature and using the response of SHG CE, the temperature-switch function is achieved, providing a new approach for temperature-controlled second harmonic detection.


Introduction
A layered metastructure [1][2][3], as a novel material, is typically composed of multiple materials arranged in a layered structure and is known for its lightweight and multifunctionality, with numerous applications in biomedical fields [4].Through the ordered arrangement of multiple layers of metastructures, the refractive index (RI) distribution varies, causing certain wavelengths of EMWs to be completely reflected or absorbed, forming electromagnetic band gaps (EMBGs) [5] and thereby controlling the propagation of EMWs in the metastructure and achieving the utilization of specific wavelengths [5].Brain tissue refers to the biological tissue constituting the brain and other organs of the nervous system [4].The brain exhibits a complex and diverse structure, primarily composed of gray matter and white matter [6].Gray matter serves as the aggregation site for neuronal cell bodies, while white matter consists of nerve fibers or myelin sheaths [6].The brain is the principal component of the human nervous system, responsible for essential functions, such as perception, cognition, motor control, and emotional regulation [7].Low-grade gliomas can occur in any part of the brain.Early close monitoring and treatment can prevent their progression into more severe diseases [7].Brain-tissue detection holds significant promise in biomedical research and clinical practice, facilitating the understanding of the brain's structure, diagnosing neurological disorders, and monitoring treatment efficacy [7].Second harmonic generation (SHG) [8] is a nonlinear EMWs frequency-doubling Sensors 2024, 24, 3065 2 of 14 process, where the conversion efficiency (CE) of the second harmonic wave (SHW) [9] is proportional to the square of the intensity of the incident fundamental wave (FW) [10].Its frequency conversion characteristics are important in laser technology [11], electromagnetic communication [12], and microscopy imaging [13], among other fields [14,15].
Throughout, the low efficiency of SHG has been a concern in nonlinear research, and selecting materials with high nonlinear polarization can achieve better SHG [16].Ferroelectric crystals [17] are a type of crystal with ferroelectric properties, with common examples being strontium barium niobate (SBN) [18], lithium tantalate (LiTaO 3 ) [19], and lithium niobate [20].Ferroelectric crystals are characterized by non-centrosymmetric structures [21], resulting in the reversal of electric dipoles under an applied electric field [21].Cheng et al. [22] demonstrated high-precision recognition of different blood types' hemoglobin concentrations using periodically poled SBN to generate SHW, highlighting the potential value of ferroelectric crystals in frequency-doubling devices and sensors.The quasi-phase matching (QPM) [23] technique is a method to enhance SHG by optimizing the phasematching conditions in nonlinear optical processes.By adjusting the phase difference between the incident light wave and the nonlinear polarization wave, the phase-matching condition is satisfied, resulting in a good nonlinear effect [24].Additionally, Trull et al. [25] present an experimental investigation into the influence of the environment on the SHW radiation from nonlinear material plates embedded in multilayer dielectric stacks.The localization of energy near the defect modes and the reduction of group velocities near the band edges will lead to sharp resonances in nonlinear interactions near defects.Zhao et al. [26] elucidate that, due to the high electromagnetic mode density and low group velocity associated with defect modes, the CE of SHW can be significantly enhanced.In summary, both studies highlight the significant impact of environmental factors on SHW radiation and emphasize the potential for enhancing CE through careful consideration of defect modes and group velocities.
The transfer matrix method [27] is an effective tool for analyzing optical multilayer structures.It represents the transmission process of each layer in matrix form, enabling the establishment of the transmission mode of the entire structure efficiently and facilitating the acquisition of the propagation of SHG [28].Li et al. [29] used the transfer matrix method to derive the generation of the second harmonic in periodically poled ferroelectric crystals, significantly improving the CE.On the other hand, a temperature switch is a device that automatically opens or closes based on environmental temperature changes [30].Anette et al. [31] used deoxyribonucleic acid hairpins as a temperature switch to achieve functions such as temperature sensing and ion detection.While the study of Li [29] focused on the derivation of SHG, its application value was not emphasized.The method proposed by Anette et al. [31], while achieving temperature-controlled detection, is considered to be overly complicated.Therefore, the creation of a simple, efficient, and controllable detection method holds wide application prospects.This would make devices such as temperature switches more widespread and practical in various application scenarios.
A multilayer metastructure composed of nonlinear media is proposed, and the generation of the second harmonic in the metastructure is derived using the transfer matrix method.By employing a quasi-phase-matching technique to simultaneously tune the FW and SHW to the edge of the EMBGs, efficient SHG can be achieved.SHG CE is used as a signal to perceive the refractive index (RI) [32] and detect various types of brain tissues, becoming a second harmonic mode sensor (SHMS).Additionally, at different temperatures, the high or low SHW CE is utilized to implement the temperature-switch function.When the temperature is within the range of 291.4 Kelvin (K) to 307.9 K, indicating the temperature switch is in the "open" state, the SHW CE is high, and the sensor's RI detection range is 1.23~1.31refractive index unit (RIU) and 1.38~1.44RIU, enabling the detection of gray matter (1.3951 RIU), white matter (1.4121 RIU), and low-grade glioma (1.4320 RIU) [33].In the remaining temperature ranges, representing the "off" state of the temperature switch, the sensor operates with a SHW CE lower than in the "open" state.This SHMS provides new insights into controllable multifunctional devices.

The Theoretical Model
Figure 1 depicts the model of the SHMS, with the entire model exposed to air at a temperature of 300 K. To indicate the position of the spatial SHMS, Figure 1a displays the directions of the Cartesian coordinate system axes.Figure 1b shows the propagation modes of transverse electric (TE) and transverse magnetic (TM) [2], with the FW incidence angle as x 0 , providing the direction of propagation for incident EMWs.The TE mode propagation represents no electric field component in the propagation direction, while the TM mode propagation indicates no magnetic field component in the propagation direction.The initial condition for incident EMWs settings is in the TM mode and x 0 = 0 • .The details of the SHMS are depicted in Figure 1c, illustrating the composition of each layer in the SHMS, including the LiTaO 3 layer, an air layer (B), a silicon dioxide (SiO 2 ) layer (A), and the sample layer (C).The entire SHMS is composed of periodically polarized LiTaO 3 , with arrows indicating the spontaneous polarization direction of LiTaO 3 .The first part consists of LiTaO 3 (L 1 ) with a spontaneous polarization direction along the +x direction, while the negative domain LiTaO 3 (L 2 ) is oriented along the -x direction, where n L1 δ = n L2 δ (δ = f represents the RI at the frequency and δ = s represents the RI at the second harmonic frequency).The second-order polarization and thickness for L 1 and L 2 are χ L1 (2) = 15.1 pm/V, χ L2 (2) = −15.1 pm/V [34], d L1 = 2.543 µm, and d L2 = 2.169 µm, respectively.An air layer B and a SiO 2 layer A are introduced, forming high and low RI arrangements with LiTaO 3 to create EMBGs.The RI of the air layer is n b = 1, with a thickness of d b = 1.431 µm, and the RI and thickness of the SiO 2 layer are n a = 1.46 [33] and d a = 2.521 µm, respectively.The thickness of the sample layer C is d c = 1.452 µm, and it functions as the measurement layer by filling various test substances.The arrangement of each layer in the overall SHMS follows the sequence (L l L 2 B) N2 (L l L 2 A) N1 C, as illustrated in Figure 1d, and the number of periods for each layer is N 2 = 25, N 1 = 5.Depending on the type of filler used in layer C, the RI of layer C varies.By using the relationship between RI and brain tissue, it is possible to differentiate between gray matter (1.3951 RIU), white matter (1.4121 RIU), and low-grade glioma (1.4320 RIU).
RIU) [33].In the remaining temperature ranges, representing the "off" state of the temperature switch, the sensor operates with a SHW CE lower than in the "open" state.This SHMS provides new insights into controllable multifunctional devices.

The Theoretical Model
Figure 1 depicts the model of the SHMS, with the entire model exposed to air at a temperature of 300 K. To indicate the position of the spatial SHMS, Figure 1a displays the directions of the Cartesian coordinate system axes.Figure 1b shows the propagation modes of transverse electric (TE) and transverse magnetic (TM) [2], with the FW incidence angle as x0, providing the direction of propagation for incident EMWs.The TE mode propagation represents no electric field component in the propagation direction, while the TM mode propagation indicates no magnetic field component in the propagation direction.The initial condition for incident EMWs settings is in the TM mode and x0 = 0°.The details of the SHMS are depicted in Figure 1c, illustrating the composition of each layer in the SHMS, including the LiTaO3 layer, an air layer (B), a silicon dioxide (SiO2) layer (A), and the sample layer (C).The entire SHMS is composed of periodically polarized LiTaO3, with arrows indicating the spontaneous polarization direction of LiTaO3.The first part consists of LiTaO3 (L1) with a spontaneous polarization direction along the +x direction, while the negative domain LiTaO3 (L2) is oriented along the -x direction, where nL1 δ = nL2 δ (δ = f represents the RI at the frequency and δ = s represents the RI at the second harmonic frequency).The second-order polarization and thickness for L1 and L2 are χL1 (2) = 15.1 pm/V, χL2 (2) = −15.1 pm/V [34], dL1 = 2.543 µm, and dL2 = 2.169 µm, respectively.An air layer B and a SiO2 layer A are introduced, forming high and low RI arrangements with LiTaO3 to create EMBGs.The RI of the air layer is nb = 1, with a thickness of db = 1.431 µm, and the RI and thickness of the SiO2 layer are na = 1.46 [33] and da = 2.521 µm, respectively.The thickness of the sample layer C is dc = 1.452 µm, and it functions as the measurement layer by filling various test substances.The arrangement of each layer in the overall SHMS follows the sequence (LlL2B) N2 (LlL2A) N1 C, as illustrated in Figure 1d, and the number of periods for each layer is N2 = 25, N1 = 5.Depending on the type of filler used in layer C, the RI of layer C varies.By using the relationship between RI and brain tissue, it is possible to differentiate between gray matter (1.3951 RIU), white matter (1.4121 RIU), and low-grade glioma (1.4320 RIU).The SHG CE is defined as the ratio of the SHW radiated intensity (ISHW) to the FW incident intensity (IFW) [16]: The SHG CE is defined as the ratio of the SHW radiated intensity (I SHW ) to the FW incident intensity (I FW ) [16]: Using the relation of the energy of the electric field to obtain the method of solving the SHW CE [16]: where ε 0 is the dielectric constant in air, n 0 is the RI of air, and c is the speed of light in a vacuum, The case of FW incidence is first derived to investigate the effect of the amplitudes of the FW electric field in each layer on nonlinearity.
The incident electric field (E p (f )± ) of the FW frequency (angular frequency ω) can be expressed as [28]: where "+" denotes forward, "−" denotes backward direction, and f represents the FW field.
, respectively, denote the incident and transmitted amplitudes at the FW.
Using the continuity conditions of the electric and magnetic fields at each layer boundary, the FW transfer matrix T total (f) of the overall SHMS can be represented as follows [22]: where E t (f )± is the FW transmission amplitude.E t f± under the given incident wave coefficient E 0 f+ can be solved.At this point, as an example of convenient representation, it is defined as T A , T B , T C T L1 , and T L2 .
The electric field distribution of SHW in the p-th layer can be obtained [22]: where q = A, B, C, L 1 , L 2 , 0 [28]: The electric E p (s) and magnetic fields H p (s) in the layers of a nonlinear structure can be expressed as follows [16]: where [22]: To obtain the SHG radiation within the SHMS and calculate its CE, the overall SHG transfer matrix is derived [28]: To simplify the equations, multilayer dielectric can be defined [21]: Sensors 2024, 24, 3065 where [28]: So far, the formula for the SHG has been derived.

Analysis and Discussion
To illustrate the reasons for the enhancement of SHG CE, the transmission spectra and CE of the FW and SHW are shown in Figure 2. Figure 2a displays the transmission spectrum of the FW in the frequency range of 357.5~360.0THz.At the fundamental frequency sideband of the EMBGs, with a frequency of 359.4 THz, the transmittance is 0.678.Figure 2b shows the transmission spectrum of the SHW in the frequency range of 715~720 THz.The SHW frequency of the sideband of the EMBGs is 718.8THz, with a transmittance of 0.368.Under QPM conditions, when both the FW and the SHW are simultaneously tuned to the edge of the EMBGs, the electric field density is increased, leading to a decrease in the group velocity of EMWs [29].This results in a slow-wave effect, where the interaction time between EMWs and the nonlinear medium is prolonged, thereby enhancing the nonlinear effects and significantly increasing the CE of the SHW. Figure 2c displays the CE of the SHW with a frequency range of 715~720 THz.With an incident light intensity of 1 GW/m 2 and a SHW frequency of 718.8 THz, the CE reaches 25.1%.It is noteworthy that the overall thickness of the SHMS is only about 190 µm.
crease in the group velocity of EMWs [29].This results in a slow-wave effect, where the interaction time between EMWs and the nonlinear medium is prolonged, thereby enhancing the nonlinear effects and significantly increasing the CE of the SHW. Figure 2c displays the CE of the SHW with a frequency range of 715~720 THz.With an incident light intensity of 1 GW/m 2 and a SHW frequency of 718.8 THz, the CE reaches 25.1%.It is noteworthy that the overall thickness of the SHMS is only about 190 µm.Additionally, the distribution of electric field energies of the FW and SHW in the layered metastructure is also a method to explain the nonlinear effects.Figure 3 displays the internal electric field distribution of the FW and SHW under normal incidence of EMWs.At this point, the incident frequency of the FW is 359.4THz, with a normalized incident electric field amplitude of 1 V/m.It is observed that, at the fundamental frequency, the maximum localized electric field energy throughout the SHMS is 115 V/m, while for the SHW, the maximum electric field value reaches 144 V/m.This demonstrates the effective localization of electric field energy throughout the SHMS for the SHW, thereby amplifying the SHW CE [16].Additionally, the distribution of electric field energies of the FW and SHW in the layered metastructure is also a method to explain the nonlinear effects.Figure 3 displays the internal electric field distribution of the FW and SHW under normal incidence of EMWs.At this point, the incident frequency of the FW is 359.4THz, with a normalized incident electric field amplitude of 1 V/m.It is observed that, at the fundamental frequency, the maximum localized electric field energy throughout the SHMS is 115 V/m, while for the SHW, the maximum electric field value reaches 144 V/m.This demonstrates the effective localization of electric field energy throughout the SHMS for the SHW, thereby amplifying the SHW CE [16].After considering the nonlinear effects of SHG and combining with the study by L et al. [16], it is recognized that the SHW CE is not only associated with the power of th EMWs but also considered to be influenced by EMWs intensity [29].SHG in bulk material typically exhibits a quadratic dependence on the fundamental power.However, whe employing QPM configurations, SHG may exhibit a globally linear behavior with increas ing fundamental power.This is because in QPM, the increase in SHG intensity relative t After considering the nonlinear effects of SHG and combining with the study by Li et al. [16], it is recognized that the SHW CE is not only associated with the power of the EMWs but also considered to be influenced by EMWs intensity [29].SHG in bulk materials typically exhibits a quadratic dependence on the fundamental power.However, when employing QPM configurations, SHG may exhibit a globally linear behavior with increasing fundamental power.This is because in QPM, the increase in SHG intensity relative to the increase in fundamental intensity is much slower, and it can manifest a linear phenomenon within a limited range of incident EMW intensities [23].The QPM condition is a crucial factor in achieving high SHW CE.In this study, by tuning both the FW and SHW to the edge of the EMBGs, where the electromagnetic field density is higher and the group velocity is lower, and local field enhancement, all contribute significantly to enhancing nonlinear optical interactions and improving the SHW CE [16].Therefore, under the premise of realizing these factors, the relationship between the incident EMWs intensity and the SHW CE is shown in Figure 4. Within the range of EMW intensities from 0.1 GW/m 2 to 1 GW/m 2 , with intervals of 0.1 GW/m 2 , the SHW CE is provided.When the intensity of the EMWs is 0.1 GW/m 2 , the CE is lowest, with a value of 2.511%.When the intensity of the EMWs is 1 GW/m 2 , the CE reaches its maximum value of 25.108%.There is also a linear relationship between CE and EMW intensity, implying that SHG increases with increasing basic intensity in a continuous manner, leading to overall linear behavior.Efforts have been made to achieve better SHW CE at the most suitable intensities of EMWs [28].
Sensors 2024, 24, x FOR PEER REVIEW Under QPM conditions and the intensity of the EMWs being 1 GW/m 2 , subtle in temperature may lead to an imbalance of phase-matching conditions [22].Envir tal temperature can affect the generation of the SHW. Figure 5 illustrates the vari SHW CE with temperature in the range of 280~320 K, where the SHW frequenc tween 718.6~719.2THz.The portion highlighted in Figure 5 represents the rang the SHW CE is above 0.298%, with the temperature range being 291.4~307.9K (T perature, SHW frequency, and SHW CE data are shown in parentheses).In other ature ranges, the CE of the SHW is below 0.298%.Using the SHW CE value of 0. a threshold, a temperature switch is defined based on the response of the CE.Under QPM conditions and the intensity of the EMWs being 1 GW/m 2 , subtle changes in temperature may lead to an imbalance of phase-matching conditions [22].Environmental temperature can affect the generation of the SHW. Figure 5 illustrates the variation of SHW CE with temperature in the range of 280~320 K, where the SHW frequency is between 718.6~719.2THz.The portion highlighted in Figure 5 represents the range where the SHW CE is above 0.298%, with the temperature range being 291.4~307.9K (The temperature, SHW frequency, and SHW CE data are shown in parentheses).In other temperature ranges, the CE of the SHW is below 0.298%.Using the SHW CE value of 0.298% as a threshold, a temperature switch is defined based on the response of the CE.
Sensors 2024, 24, 3065 9 of 14 SHW CE with temperature in the range of 280~320 K, where the SHW frequency is between 718.6~719.2THz.The portion highlighted in Figure 5 represents the range where the SHW CE is above 0.298%, with the temperature range being 291.4~307.9K (The temperature, SHW frequency, and SHW CE data are shown in parentheses).In other temperature ranges, the CE of the SHW is below 0.298%.Using the SHW CE value of 0.298% as a threshold, a temperature switch is defined based on the response of the CE.When the temperature is within the range of 291.4~307.9K, the temperature switch is defined to be in the "open" state, as the SHW CE is greater than 0.298%.Conversely, when the temperature is outside this range, the temperature switch is defined to be in the "off" state, as the SHW CE is less than 0.298%.With this temperature as a control signal and the SHW CE as a discriminant signal, the temperature-switch function is achieved.In addition, to achieve a design that better aligns with experimental precision, an allowable When the temperature is within the range of 291.4~307.9K, the temperature switch is defined to be in the "open" state, as the SHW CE is greater than 0.298%.Conversely, when the temperature is outside this range, the temperature switch is defined to be in the "off" state, as the SHW CE is less than 0.298%.With this temperature as a control signal and the SHW CE as a discriminant signal, the temperature-switch function is achieved.In addition, to achieve a design that better aligns with experimental precision, an allowable error of 0.002% in conversion efficiency has also been reserved.This means that a conversion efficiency of 0.3% is used as the threshold.The green dashed line in Figure 5 represents the scenario where the conversion efficiency is 0.3%, and the result is close to 0.298%, meeting our expected design criteria.
At a fixed ambient temperature of 300 K and the intensity of the EMWs being 1 GW/m 2 , changes in the RI of sample layer C will lead to variations in the SHW CE.When the SHW frequency is fixed at 718.8 THz, optimal SHW CE is achieved.By correlating the SHW with the type of sample layer C, sensing functionality can be achieved using the second harmonic mode.Figure 6a illustrates the situation of SHW CE when the RI of sample layer C n c ranges from 1.18 RIU to 1.45 RIU, with the SHW frequency ranging from 718.6 THz to 719.1 THz.It is observed that, when the SHW frequency is around 718.8 THz, its CE varies with the RI of sample layer C, showing two linear relationships.Figure 6b shows the relationship between n c and the CE at an SHW frequency of 718.8 THz, with n c ranging from 1.18 RIU to 1.45 RIU, revealing two linear relationships.At an n c of 1.23~1.31RIU, the CE decreases with the increasing n c , while at an n c of 1.38~1.44RIU, the CE increases with the increasing n c , showing a positive correlation.
Figure 7 depicts linear fitting graphs for n c detection, where dashed lines represent the fitted lines and pentagram symbols denote selected data points.Figure 7a shows a negatively correlated linear fitting graph, with the n c range selected as 1.23~1.31RIU and a sampling interval of 0.02 RIU.The linear equation is CE = −0.8597nc + 1.3689, with a sensitivity of 0.8597 RIU −1 and a correlation coefficient of R 2 = 0.99979 [32], indicating a high detection capability of the CE to the n c with a probability of 99.979%.Figure 7b presents another negatively correlated linear fitting graph, with the n c values ranging from 1.28 RIU to 1.44 RIU.The linear equation is CE = 1.2967n c − 1.5398, with a sensitivity of 1.2967 RIU −1 and a correlation coefficient R 2 = 0.99738, indicating a better linear fitting effect with a correlation coefficient closer to one [32].Moreover, by utilizing precise techniques based on microinfusion and hollow submicron-level microtubes [32], RI detection of brain tissue under experimentation is achievable.Figure 8 illustrates the application of relevant brain-tissue cells under the SHMS.Detectable brain-tissue cells include gray matter (1.3951 RIU), white matter (1.4121 RIU), and low-grade glioma (1.4320 RIU), with their optimal conversion efficiencies being 0.345413, 0.315777, and 0.291582, respectively.second harmonic mode.Figure 6a illustrates the situation of SHW CE when the RI of sample layer C nc ranges from 1.18 RIU to 1.45 RIU, with the SHW frequency ranging from 718.6 THz to 719.1 THz.It is observed that, when the SHW frequency is around 718.8 THz, its CE varies with the RI of sample layer C, showing two linear relationships.Figure 6b shows the relationship between nc and the CE at an SHW frequency of 718.8 THz, with nc ranging from 1.18 RIU to 1.45 RIU, revealing linear relationships.At an nc of 1.23~1.31RIU, the CE decreases with the increasing nc, while at an nc of 1.38~1.44RIU, the CE increases with the increasing nc, showing a positive correlation.Figure 7 depicts linear fitting graphs for nc detection, where dashed lines represent the fitted lines and pentagram symbols denote selected data points.Figure 7a shows a negatively correlated linear fitting graph, with the nc range selected as 1.23~1.31RIU and a sampling interval of 0.02 RIU.The linear equation is CE = −0.8597nc+ 1.3689, with a sensitivity of 0.8597 RIU −1 and a correlation coefficient of R 2 = 0.99979 [32], indicating a high detection capability of the CE to the nc with a probability of 99.979%.Figure 7b presents another negatively correlated linear fitting graph, with the nc values ranging from 1.28 RIU to 1.44 RIU.The linear equation is CE = 1.2967nc − 1.5398, with a sensitivity of 1.2967 RIU −1 and a correlation coefficient R 2 = 0.99738, indicating a better linear fitting effect with a correlation coefficient closer to one [32].Moreover, by utilizing precise techniques based on microinfusion and hollow submicron-level microtubes [32], RI detection of brain tissue under experimentation is achievable.Figure 8 illustrates the application of relevant braintissue cells under the SHMS.Detectable brain-tissue cells include gray matter (1.3951 RIU), white matter (1.4121 RIU), and low-grade glioma (1.4320 RIU), with their optimal conversion efficiencies being 0.345413, 0.315777, and 0.291582, respectively.Although the article is purely theoretical, the feasibility of the sensor is also worth noting.Various errors may be introduced during the experimental process.Thickness errors of the medium are typically random, and thus, assuming a variation of +0.5% in the sample layer s thickness, Figure 9 presents the detection performance of the SHMS with respect to the RI.At an environmental temperature of 300 K and an incident EMW intensity of 1 GW/m 2 , Figure 9a illustrates the influence of SHW frequency and nc on SHW CE, with the maximum SHW CE observed at a frequency of 717.352THz. Figure 9b    Although the article is purely theoretical, the feasibility of the sensor is also worth noting.Various errors may be introduced during the experimental process.Thickness errors of the medium are typically random, and thus, assuming a variation of +0.5% in the sample layer s thickness, Figure 9 presents the detection performance of the SHMS with respect to the RI.At an environmental temperature of 300 K and an incident EMW intensity of 1 GW/m 2 , Figure 9a illustrates the influence of SHW frequency and nc on SHW CE, with the maximum SHW CE observed at a frequency of 717.352THz. Figure 9b   Although the article is purely theoretical, the feasibility of the sensor is also worth noting.Various errors may be introduced during the experimental process.Thickness errors of the medium are typically random, and thus, assuming a variation of +0.5% in the sample layer's thickness, Figure 9 presents the detection performance of the SHMS with respect to the RI.At an environmental temperature of 300 K and an incident EMW intensity of 1 GW/m 2 , Figure 9a illustrates the influence of SHW frequency and n c on SHW CE, with the maximum SHW CE observed at a frequency of 717.352THz. Figure 9b specifically depicts the impact of n c on SHW CE at a frequency of 717.352THz, indicating a decreasing trend in SHW CE as the n c increases from 1.3 RIU to 1.37 RIU and a significant increasing trend as the n c increases from 1.40 RIU to 1.44 RIU, with good linearity.Figure 9c,d present two types of linear fitting, negative correlation and positive correlation, with the fitting equations being CE = −4.611× 10 −6 n c + 7.04 × 10 −6 and CE = 6.67 × 10 −6 n c −8.57 × 10 −6 and R 2 = 0.9911 and R 2 = 0.996, respectively.The dashed represent the fitted lines, while the pentagram symbols denote the selected data points.It has been observed that variations in thickness due to disorderliness have a negative impact on measurement performance.However, this also serves to validate the correctness of the designed SHMS detection principle.Moving forward, it is anticipated that improvements in detection performance can be achieved through the utilization of optimization algorithms.These algorithms can be employed to enhance structural parameters and elevate the intensity of incident EMWs.Addressing the challenge posed by disorderliness in structural manufacturing to enhance detection performance represents a promising avenue for future research.To better understand the advantages of the designed SHMS compared to previously published reports, a comparison was made.Specific performance analyses are presented in Table 1.Ref. [35] demonstrated RI detection at terahertz frequencies, Ref. [36] checked the large RI range, Ref. [37] could detect microorganisms, and Ref. [38] achieved measurement of creatinine blood concentration through voltage control.Unfortunately, the aforementioned studies all focused on FW detection, whereas Ref. [39] focused on SHW detection capable of distinguishing various biomolecules.In contrast, the design presented in this paper not only employs SHW detection but also utilizes temperature for control, enabling the detection of brain tissue, which is of significant value in the sensing field.To better understand the advantages of the designed SHMS compared to previously published reports, a comparison was made.Specific performance analyses are presented in Table 1.Ref. [35] demonstrated RI detection at terahertz frequencies, Ref. [36] checked the large RI range, Ref. [37] could detect microorganisms, and Ref. [38] achieved measurement of creatinine blood concentration through voltage control.Unfortunately, the aforementioned studies all focused on FW detection, whereas Ref. [39] focused on SHW detection capable of distinguishing various biomolecules.In contrast, the design presented in this paper not only employs SHW detection but also utilizes temperature for control, enabling the detection of brain tissue, which is of significant value in the sensing field.

Conclusions
In conclusion, the SHG in layered metastructures is derived using the transfer matrix method in this paper.By exploiting the relationship between SHW CE and the RI of the filling material, RI detection of various brain tissues can be achieved.Additionally, by considering the influence of temperature on CE, a temperature-switch function was established.When the temperature falls within the range of 291.4~307.9K and the highest SHW CE exceeds 0.298%, the temperature switch is defined to be in the "open" state, indicating normal operation of the SHMS.Conversely, when the temperature is outside 291.4~307.9K, leading to a lower SHW CE and poorer detection performance, the temperature switch is defined to be in the "off" state, indicating that the SHMS is not functioning.This completes the temperature-switch function and brain-tissue detection, providing a new approach for nonlinear electromagnetic detectors or sensors.

Figure 1 .
Figure 1.Schematic diagram of the SHMS: (a) Cartesian coordinate system, (b) EMWs direction of the TM and TE modes, (c) the detailed diagram of the materials composing the SHMS, and (d) the distribution of materials in each layer of the SHMS.

Figure 1 .
Figure 1.Schematic diagram of the SHMS: (a) Cartesian coordinate system, (b) EMWs direction of the TM and TE modes, (c) the detailed diagram of the materials composing the SHMS, and (d) the distribution of materials in each layer of the SHMS.

Sensors 2024 , 1 Figure 3 .
Figure 3.The electric field distribution of (a) the SHW and (b) the FW in the case of the forwar incident.

Figure 3 .
Figure 3.The electric field distribution of (a) the SHW and (b) the FW in the case of the forward incident.

Figure 4 .
Figure 4.The relationship between CE and incident EMW intensity.

Figure 4 .
Figure 4.The relationship between CE and incident EMW intensity.

Figure 5 .
Figure 5. Effects of CE with temperature and SHW frequency.

Figure 5 .
Figure 5. Effects of CE with temperature and SHW frequency.

Figure 6 .
Figure 6.(a) Effects of CE with RI nc of the sample layer and SHW frequency, and (b) the relationship between nc and CE at fixed frequency points.

Figure 6 . 14 Figure 7 .
Figure 6.(a) Effects of CE with RI n c of the sample layer and SHW frequency, and (b) the relationship between n c and CE at fixed frequency points.Sensors 2024, 24, x FOR PEER REVIEW 11 of 14

Figure 8 .
Figure 8.Detection of cells of the related brain tissue.
specifically depicts the impact of nc on SHW CE at a frequency of 717.352THz, indicating a decreasing trend in SHW CE as the nc increases from 1.3 RIU to 1.37 RIU and a significant increasing trend as the nc increases from 1.40 RIU to 1.44 RIU, with good linearity.Figure 9c,d present two types of linear fitting, negative correlation and positive correlation, with the fitting

Figure 7 . 14 Figure 7 .
Figure 7. (a) Negative and (b) positive correlation linear fit to n c and CE.

Figure 8 .
Figure 8.Detection of cells of the related brain tissue.
specifically depicts the impact of nc on SHW CE at a frequency of 717.352THz, indicating a decreasing trend in SHW CE as the nc increases from 1.3 RIU to 1.37 RIU and a significant increasing trend as the nc increases from 1.40 RIU to 1.44 RIU, with good linearity.Figure 9c,d present two types of linear fitting, negative correlation and positive correlation, with the fitting equations being CE = −4.611× 10 −6 nc + 7.04 × 10 −6 and CE = 6.67 × 10 −6 nc−8.57× 10 −6 and R 2 =

Figure 8 .
Figure 8.Detection of cells of the related brain tissue.

Sensors 2024 , 14 Figure 9 .
Figure 9.The values of SHW CE with nc when the sample thickness increases by (a) The relationship between SHW CE and nc and SHW frequency.(b) Variation of SHW CE with nc at an SHW frequency of 717.352THz.(c) Negative correlation detection of SHW CE with nc variation.(d) Positive correlation detection of SHW CE with nc variation.

Figure 9 .
Figure 9.The values of SHW CE with n c when the sample thickness increases by 0.5%.(a) The relationship between SHW CE and n c and SHW frequency.(b) Variation of SHW CE with n c at an SHW frequency of 717.352THz.(c) Negative correlation detection of SHW CE with n c variation.(d) Positive correlation detection of SHW CE with n c variation.

Table 1 .
Comparison with the previously published reports.

Table 1 .
Comparison with the previously published reports.