## 3 Results and Discussion  
Figure 2 shows the results of the simulation on the freestanding GMR device under variations in the refractive index of the rectangular grating. As can be seen in Figure 2a, because of the same refractive index of the substrate, we changed the refractive index (\(n_{\mathit{eff}}\)) of the grating layer from 1.55 to 2.05, with the filling factor, \(F=0.25\). Thus, as the refractive index of the grating was increased, the resonance frequency was red shifted. In our previous study, a model for the wavelength sensitivity of GMR structures was proposed [23]. When the incident waves pass through a grating layer, the equation for the diffraction grating becomes [24] the following:  
\[\Lambda[n_{eff}\sin(\theta_{d})-n_{L}\sin(\theta_{i})]=m_{g}\lambda,\ m_{g}=0, \pm 1,\pm 2,\ldots \tag{2}\]  
where \(\Lambda\) is the grating period, \(\theta_{d}\) is the diffraction angle, \(\theta_{i}\) is the incident angle, and \(m_{g}\) is the order of the diffracted wave, respectively. Under the conditions used in our simulation, \(n_{L}\) equals 1, and \(\theta_{i}\) equals 0, because light is considered to pass through free space with normal incidence. As the refractive index of the grating layer changes, \(n_{\mathit{eff}}\) also varies and vice versa. As a result, the resonance frequency can be shifted. Moreover, when \(n_{\mathit{eff}}\) decreases, the quality factor (Q-factor) increases dramatically. As shown in Figure 2b, the Q-factor at \(n_{\mathit{eff}}=1.55\) is almost seven times higher than 2.05. Thereafter, we calculated the reflectance of the GMR structure by varying the filling factor of the grating, as shown in Figure 3a. Figure 3: (**a**) Scheme of the simulated THz reflectance with size dependency of the grating layer, where \(n_{\mathit{eff}}=2.05\); (**b**) peak frequency and Q-factor for the rectangular pattern. Figure 2: (**a**) Scheme of the simulated THz reflectance with varying refractive index of the grating layer; (**b**) peak frequency and Q-factor for the rectangular pattern, where \(F=0.25\). Figure 3 shows the results of the simulation under varying grating size (\(n_{\mathit{eff}}\) = 2.05). As the filling factor decreased, which denotes a decreased grating size, the resonance frequency shifted to a higher frequency. Furthermore, the Q-factor increased from 28 to 194. For both the resonance peak and Q-factor, the resonance frequency showed almost a linear relation with refractive index and grating size. However, the Q-factor indicated a slightly different trend, i.e., a nonlinear relation, compared with the resonance-frequency variation. This is because the Q-factor is more applicable to the sensitive detection of such materials than the frequency change. GMR structures usually have a rectangular grating layer; otherwise, spherically shaped structures can be applied as the grating layer. To realize the spherically shaped grating for the GMR structure, the spherical particle should be embedded in the waveguide or sensing layers. This is because the particles cannot firmly lie at the top of the waveguide. [PERSON] et al. demonstrated a GMR sensor for humidity, using a spherically shaped GMR device [10]. In this study, ZrO\({}_{2}\) particles, which are spherically shaped particles, were adopted for the grating layer, and good experimental results were reported when compared with the theoretical results. Thus, we calculated the THz spectrum of the GMR structure with a circular pattern, as shown in Figure 1b. Figures 4 and 5 show the THz spectrum of the GMR structure, with the circular pattern with the dependency on the refractive index and size of the grating layer. The figures indicate that the spectral trends of the GMR structure with a circular pattern were similar to those of the rectangular-shaped GMR structure. However, as the refractive index decreased, the resonance frequency changed from 860 to 910 GHz. The rate of change with the circular-shaped GMR structure was greater than that with the rectangular pattern. In addition, the Q-factor was significantly sharpened.