Terahertz-Based Porosity Measurement of Pharmaceutical Tablets: a Tutorial

Porosity, one of the important quality attributes of pharmaceutical tablets, directly affects the mechanical properties, the mass transport and hence tablet disintegration, dissolution and ultimately the bioavailability of an orally administered drug. The ability to accurately and quickly monitor the porosity of tablets during manufacture or during the manufacturing process will enable a greater assurance of product quality. This tutorial systematically outlines the steps involved in the terahertz-based measurement method that can be used to quantify the porosity of a tablet within seconds in a non-destructive and non-invasive manner. The terahertz-based porosity measurement can be performed using one of the three main methods, which are (i) the zero-porosity approximation (ZPA); (ii) the traditional Bruggeman effective medium approximation (TB-EMA); and (iii) the anisotropic Bruggeman effective medium approximation (AB-EMA). By using a set of batches of flat-faced and biconvex tablets as a case study, the three main methods are compared and contrasted. Overall, frequency-domain signal processing coupled with the AB-EMA method was found to be most suitable approach in terms of accuracy and robustness when predicting the porosity of tablets over a range of complexities and geometries. This tutorial aims to concisely outline all the necessary steps, precautions and unique advantages associated with the terahertz-based porosity measurement method.


Introduction
Terahertz technology has attracted considerable interest for a range of application scenarios. Among these applications are the detection of explosives [1][2][3] in the security sector and industrial implementations, for example, in automotive [4], paper [5] and pharmaceutical [6,7] https://doi.org/10.1007/s10762-019-00659-0 In subsequent studies, Markl el al. [44] showed that the assumption of the spherical inclusion in the Bruggeman effective medium approximation (from now onwards known as the traditional Bruggeman effective medium approximation, TB-EMA) can limit the accurate prediction of the effective refractive index when tablets containing API and those composed of a highly porous excipient, such as functionalised calcium carbonate, are tested. This led to the adoption of the anisotropic Bruggeman effective medium approximation (AB-EMA), which takes into consideration the presence of non-spherical inclusions within a tablet. The ability to predict the pore shape based on the AB-EMA model led to a stream of follow-up studies that sought to critically analyse the pore structure of pharmaceutical tablets using THz-TDS [39,[44][45][46]. A detailed description of pore structure analyses of tablets will be reported in a future tutorial paper.
Finally, we want to highlight that the insights on tablets using THz-TDS outlined above are fundamentally based on two unique properties of the terahertz radiation: (1) the relatively long wavelength of terahertz radiation in comparison to the typical particle sizes of materials that are used to make tablets results in low scattering losses, and (2) the ability of the terahertz radiation to permeate a wide range of polymers and ceramic materials that commonly serve as excipients in pharmaceutical tablets.
The current tutorial seeks to systematically take the reader through the steps required for the THz-TDS approach to non-invasively measure the total porosity of pharmaceutical tablets. Several batches of flat-faced and biconvex ibuprofen-based tablets are used to illustrate the concepts in a case study. By using tablets with different geometries the various approaches involved in the terahertz porosity method are compared and contrasted. The reasons for when and how to adopt a specific approach are outlined based on material properties, the complexity of the tablet formulations and the geometry of the tablets in concern.
Finally, we want to emphasise that the use of the terahertz porosity method on any batches of tablets compressed from a given formulation will ideally require an initial set of flat-faced tablets of the same formulation that are compressed at different porosity levels. Our recommendation is to have at least five porosity levels that cover the entire range of expected porosity values. The use of flat-faced tablets, aside from being simple and easy to compact, will ensure accurate material parameter estimation of the intrinsic refractive index of the solid matrix.

Terahertz Time-Domain Spectroscopy
A typical terahertz time-domain spectrometer has four major components: a femtosecond pulsed NIR laser, the terahertz emitter (photoconductive antenna), a delay mechanism between a pump and probe beam and a time-gated detector. Sub-picosecond coherent pulses of broadband terahertz radiation are generated based on the principle of photoexcitation [22]. The photoconductive antenna (PCA) is basically made of a fast optically activated switch that is embedded in an antenna structure (e.g. DC biased semi-insulating GaAs substrate). The emitted coherent terahertz pulse is guided via an assembly of off-axis parabolic or ellipsoid mirrors and focused on the sample after which the transmitted waveform is detected either by a similar PCA detector [47] or by an electro-optic (EO) sampling technique [48,49]. With THz-TDS the electric field, which encompasses both the amplitude and phase of the radiation, is measured and hence gives direct access to the complex refractive index of materials. The ability to directly access the complex refractive index makes THz-TDS advantageous compared with other far-infrared spectroscopic techniques like conventional Fourier-transform spectroscopy.

Measurements and Data Acquisition Routines
Data acquisition using THz-TDS is typically carried out with the sample in either a reflection or transmission geometry depending on the objectives of the experiment to be conducted, and the absorption properties of the material used. In order to measure the porosity of a pharmaceutical tablet measurements are typically performed in a transmission geometry given the transparency of most excipients that are used to make tablets. Figure 1a illustrates the transmission configuration, where a tablet is placed at the focal point of the terahertz beam and the transmitted signal is detected.
In this tutorial, the transmitted terahertz pulse through a pharmaceutical tablet was detected using a Terapulse 4000 (TeraView Ltd., Cambridge, UK) with generation and detection routines similar to that described previously [22,23]. It is worth mentioning that, with the Terapulse 4000, the emitted terahertz beam is not tightly focused on the sample. The THz beam therefore does not rapidly diverge at the vicinity of the focal plane and can be assumed to be a propagating plane wave. In other words, the Rayleigh range of the focused beam is significantly long compared with samples' thicknesses. This should ensure a near constant beam geometry through the tablets and hence accuracy of the measured optical constants. On Fig. 1 An illustration of reference and sample transmission measurement routine the contrary, a tightly focused beam will rapidly diverge (short Rayleigh range compared with the sample thickness) and the plane wave assumption will add significant errors to the extracted optical constants. The effect of beam focusing, Gouy phase shift and sample thickness on the extracted optical constants, has been reported [50,51] and is discussed in Section 6.
Due to the significant absorption of the terahertz radiation by water vapour [52], the sample compartment of the THz-TDS was continuously purged with nitrogen gas throughout the measuring process. The Terapulse 4000 comes with two waveform scanning methods: the slow, but high-resolution, scanning method (HiResScannerSeries) and the fast scan with low resolution (SpectralSeries). For example, with the slow scan option, it takes about a minute to acquire and average 20 time-domain waveforms whereas for the fast scan method, it takes just about a second to acquire similar waveform averages. In this tutorial, the fast scan option was used due to our current target of developing an in-line/atline terahertz porosity method for pharmaceutical tablets. As a typical routine, a reference measurement, i.e. conducting the measurement with an empty (nitrogen gas) compartment, was acquired before each sample measurement. Figure 1 illustrates the measurement principle of measuring the time delay between a reference pulse (time of flight given as t r ) and sample pulse (time of flight given as t s ).

Data Processing and Analysis
The time-and frequency-domain data processing routines are typically performed for comparison purposes and also based on the terahertz absorption behaviour of the concerned material. For example, the frequency-domain approach is the best option when dealing with materials that exhibit distinct absorption features within the frequency range of 0.1-3.0 THz as it allows for the selection of the effective refractive index values at a portion of the spectra with little or no additional dispersion effects. However, the extraction of the frequency-domain effective refractive index demands extra mathematical steps such as the use of the fast Fourier transform, phase extraction and correction, the Beer Lamberts law and the Fresnel coefficients. On the other hand, the time-domain method is a straightforward approach to quickly calculate the effective refractive index based on the optical path length difference between the measured reference and sample signals. It is worth mentioning that the time-domain method is limited in terms of yielding an accurate prediction of the effective refractive index in cases where the terahertz pulse suffers significant broadening as a result of dispersion or absorption.

Time-Domain Signal Processing
As already mentioned, the time-domain (TD) method is a fast and a straightforward way of measuring the effective refractive index of a tablet from the terahertz pulse delay without the need of expertise in signal processing. The pulse delay is calculated from the measured time-of-flight (TOF) difference between the sample (t s ) and reference (t r ) pulses (see Fig. 1a).
A very simple case is illustrated in Fig. 2 where a terahertz pulse travelling from air, with refractive index n air , is incident on a homogeneous tablet with effective refractive index n eff . The use of n eff in this context is due to the fact that a tablet is an effective medium, i.e. composed of various materials, i.e. API(s) and excipients, with different optical constants and pores. Its bulk properties are hence governed by effective medium models.
The optical path length (OPL) travelled by the terahertz pulse during the reference (OPL r ) and sample (OPL s ) measurements can be expressed mathematically as, where c is the speed of light in vacuum and H is the thickness of the tablet. The TD effective refractive index (n eff.TD ) of the tablet is obtained by subtracting the OPL of the reference from that of the sample (see Eq. 2).
where Δt = t s − t r is the pulse delay and n air = 1. It is worth noting that the above OPL method works perfectly for homogenous tablets with no/little variations in the n eff values across the terahertz frequency range. Any significant variation in the n eff will broaden the transmitted terahertz pulse and hence limit the accuracy of the Δt measurement and in turn affect the accuracy of n eff.TD .

Frequency-Domain Signal Processing
As a normal routine for the frequency-domain (FD) method, the acquired terahertz electric fields of both the sample and the reference measurements in time-domain, E(t), are converted to complex FD electric field, e E v ð Þ;via a fast Fourier transform (FFT). The sample spectrum is then normalised by the reference spectrum to obtain a complex-valued transmission function, e T v ð Þ;that contains both the amplitude and the phase information of the FD electric field.
where T(v) is the amplitude and θ(v) is the phase of the complex transmittance. Herein, the terahertz beam is assumed to be a plane wave, as already discussed in Section 2.1, with a normal incidence on the tablet. The frequency-dependent effective refractive index of the tablet is then accurately extracted from the phase information by, firstly, unwrapping and correcting the phase and, secondly, determining the phase difference between the reference and the sample signals similar to the routine extensively discussed by Jepsen [53]. Further detailed mathematical description of the various steps involved in the FD method has been reported in the literature [47,[54][55][56][57]. Once the phase difference (θ) has been accurately determined, the FD effective refractive index (n eff.FD ) is estimated by where v is the frequency in THz, c is the speed of light in vacuum and H is the thickness of the tablet. It is worth noting that Eq. (4) is only valid for a directly transmitted terahertz signal without multiple reflections (etalon effects) by the sample. In order to eliminate the typical ripple effect in the extracted refractive index spectra due to multiple reflections, the timedomain waveform was initially truncated closely before the back reflected signal from the sample. Zero padding and a suitable apodization function were used to reduce the effect of spectral leakage introduced by the truncated time-domain signal algorithm when applying the fast Fourier transform (FFT). Additionally, in order to decrease errors in the extracted phase, the phase is unwrapped starting from the frequency v = 0.8 THz as this frequency exhibits a high signal-to-noise ratio of the used instrument. The correction of the unwrapped phase is to ensure that θ = 0 at v = 0 and this was done by determining the phase offset based on a linear regression of the data within the frequency range of 0.2-0.4 THz. The FD analysis, despite being relatively cumbersome compared with the TD method, has an added merit of revealing specific phonon vibrations (spectral features) of crystalline constituents of tablets. Due to the crystalline nature of most active pharmaceutical ingredients (APIs), THz-TDS has been used for the identification of specific drugs in pharmaceutical tablets [58,59]. The presence of the spectral features can cause significant dispersion or variations in the effective refractive at the respective resonant frequencies. Dispersion will cause each wavelength component of the terahertz pulse to travel at a different group velocity and in turn broadens the transmitted terahertz pulse. A broadened pulse, as already mentioned, will limit the use of the TD method to accurately measure the effective refractive index and hence the terahertz porosity of the tablets. In such cases the application of the FD method becomes very useful since it allows for the selection of the effective refractive index at a spectral region where no significant dispersion effect is observed. By measuring the effective refractive index over the same frequency range for all tablets within a given batch, accuracy and consistency are assured in the extracted tablets porosity.
In this tutorial, the selected FD effective refractive index values used for the calculation of the terahertz porosity of the batches were obtained by averaging the effective refractive index values within the frequency range of 0.4-0.8 THz. The selected frequency range, as shown by the rectangular shaded portion in Fig. 3, was observed to be a dispersion free region for all the batches. Additionally, the selected frequency range lies within the range of 0.3-0.9 THz, where the current instrument has its maximum signal-to-noise ratio and this further serves as a reason for deciding on the frequency(ies) to be selected for the analysis. However, in the case of nonpolar polymers that exhibit a sloping or dispersive refractive index across the measured frequency range, the selection of the refractive index at a single terahertz frequency will be more appropriate. Depending on the instrument characteristics as well as the dispersion properties of the materials involved, different frequency ranges, or indeed a single frequency, could be chosen.
Finally, potential scattering from individual particles, granules or clusters within the powder matrix will further affect the choice of the most suitable frequency (range) for subsequent porosity analysis. For example, in this work the particle size distribution for the powders used range from a few tens of micrometres to a few hundreds of micrometres in diameter: for example the dominant material has an average particle size in the range of about 160-340 μm. Hence, significant scattering is expected at frequencies above 0.9 THz, which can be clearly seen in the refractive index spectra presented in Fig. 3. Nevertheless, the relatively narrow frequency range due to scattering and absorption should not limit the applicability of the method since the refractive index can be selected at any frequency(ies) based on the above selection criteria.

Tablet Compaction
In this tutorial, five batches, each, of flat-faced and biconvex tablets were directly compressed using the same formulation (see Table 1) with commonly used excipients (microcrystalline cellulose, lactose, croscarmellose sodium, magnesium stearate, and ibuprofen as the API. Microcrystalline cellulose and lactose served as both diluents and binders to achieve tablets with reasonable mass and hardness properties. Magnesium stearate was used as a lubricant to ease the in-die ejection of the tablets after compaction and the croscarmellose sodium acts as a disintegrant. The proportions of the various powders, as given in Table 1, were weighed and properly mixed to ensure homogeneity using a Turbula® T2F Mixer (Willy A. Bachofen AG, Switzerland). The blending process lasted for 11 min with a speed of 32 rpm. All the material  components except magnesium stearate were added to a plastic bottle and blended for 10 min followed by the addition of the magnesium stearate and further blending for 1 min. After the blending, five batches of both the flat-faced and biconvex tablets with different porosities and thicknesses, within the respective range of 6-25% and 3.7-5.5 mm, were directly compressed using a compaction simulator (HB50, Huxley Bertram Engineering Ltd., UK). For a given batch, 15 tablets were compacted with each tablet stored in a labelled and sealed plastic bag. By using the compaction simulator, we were able to mimic the manufacturing characteristics of tablets produced in a typical industrial setting at full production scale and speed. In this study, the production-scale tablet press, Fette 2090 compression profile, with a compression speed of 60 rpm, i.e. ≈ 0.35 s to compress and eject a tablet, was used for compacting all the batches. The targeted porosity for each batch was achieved by keeping the weight of all tablets at about 400 mg and adjusting their thickness.

Porosity Measurement
Porosity, a potential critical quality attribute (CQA) of tablets, is one of the most important contributors to tablet disintegration and dissolution characteristics [46]. Porosity governs the mass transport processes and mechanical changes in tablets during disintegration and hence directly affects the dissolution time of tablets. Since porosity is a volumetric property, the use of the THz-TDS method, which is conducted in the transmission configuration, has been demonstrated to accurately measure porosity of homogenous tablets compared to conventional methods like mercury porosimetry [46]. This is due to the fact that the terahertz method is able to probe both connected and isolated pores whereas conventional methods like mercury porosimetry only capture connected pores. Adding to the above merits, THz-TDS is a reliable method for measuring the bulk properties of tablets compared with other spectroscopic counterparts, e.g. Raman and near infrared (NIR) spectrometers, that typically probe only surface properties that do not necessarily represent the bulk tablet property. Finally, we want to reiterate that the terahertz method is robust, non-destructive, contactless and sufficiently fast (within a second) to meet the speed requirements for both at-line and in-line applications.
This tutorial explains the chronological steps involved in the use of the THz-TDS method for the accurate measurement of tablet porosity. We shall commence by discussing the steps involved in measuring a tablet porosity from its weight and dimensions, which is dubbed as its nominal porosity, and proceed with how the nominal porosity in conjunction with the measured effective refractive index is used for the extraction of the terahertz porosity based on the Bruggeman EMA. It should be made clear at this point that the use of the terahertz porosity method will always demand the preparation and measurement of a materials characterisation set composed of tablets that were compacted over a range of porosities. Results obtained from this set will then be used as a yardstick for tracking the porosity of all batches compressed with the same formulation.

Nominal Porosity
The bulk density (ρ tablet ) of the tablet was calculated from its measured weight, W, and the volume, V: For the case of a flat-faced tablet, V ¼ π d 2 À Á 2 H with the height / thickness, H, and diameter, d (see Fig. 4a). For a biconvex tablet with dimensions as illustrated in Fig. 4b, the volume was obtained by where R p is the punch radius (the radius of curvature of the tablet). L is the length of the cylindrical portion sandwiched between the two identical spherical caps, and d is the diameter of the tablet. H is the height of the biconvex tablet measured from the centre whereas h is the height of the spherical cap.
The nominal porosity (f nominal ) was then estimated from the bulk density and the true density (ρ true ) of the powder formulation as follows (a) (b) The nominal porosity of the batches was measured several days after the compaction to allow for possible after-compaction mechanical relaxation of the tablets due to elastic recovery of the tablet matrix. In this tutorial, five batches each of flat-faced and biconvex tablets were used. The height and diameter of each tablet within a batch were measured using a micrometre (Sealey Digital External Micrometer 0-25mm; Rapid Electronics Limited, Colchester, UK) and weight measured using an analytical balance (Fisher Scientific, Illkirch-Graffenstaden, France). The spherical cap h which is given by the radius of curvature of the concave punches was measured with a digital calliper. The true density, ρ true , of the powder mixer was measured by using a helium pycnometer (Multipycnometer MVP-1; Quantachrome Corporation, New York, NY). The averaged measured tablet parameters of each batch (15 tablets) are summarised in Tables 2 and 3.

Terahertz Porosity Measurement
Three approaches based on refractive index-porosity relationships have mostly been exploited for the extraction of the porosity of tablets from terahertz measurements. For all the approaches, a pharmaceutical tablet is assumed to be a two-phase effective medium that composes of air and a solid medium. In the simplest case the solid medium could be a particular compound for tablets made of one powder only or, more commonly, it would constitute a mixture of different solid compounds of excipient(s) and API(s) for typical commercial tablets. The first approach is based on an established simple linear model between the effective refractive index (n eff ) and the porosity of tablets, namely the zero-porosity approximation (ZPA) given as where n eff could be either the values of n eff.TD or n eff.FD depending on which data analysis approach, FD or TD, is used. f is the terahertz-based porosity value. The second and third approaches are based on the use of the Bruggeman effective medium approximation (Br-EMA) [60] to relate the effective refractive index to the porosity, f, of the tablets. The porosity range of typical pharmaceutical tablets is mostly around 10-15%, which makes the Br-EMA the best model to be adopted as compared with the Maxwell Garnett's EMA that is valid at low very porosities (less than 2%). The general form of the Br-EMA follows naturally from the Maxwell Garnett's EMA [61] as Table 2 The measured averaged parameters of the five batches of flat-faced tablets. Each batch composed of 15 tablets. The tablet density, ρ tablet , was calculated from the weight and dimensions using Eq. 5. The measured true density was, ρ true = 1.439 g cm −3 , and the nominal porosity was estimated using Eq. 7 Batch where j is the number of inclusions (j =1,2,3…J) and with ∑ J j¼1 f j ¼ 1. g is a depolarisation or shape factor, ε j is the permittivity of the various inclusions and ε eff is the permittivity of the effective medium. The second approach, henceforth referred to as the traditional Bruggeman effective medium approximation (TB-EMA), is constructed based on an assumption of spherical inclusions where g = 1/3. From Eq. 9 and by considering a tablet as a two-phase medium (air and solid), the TB-EMA takes the form where we have used a straightforward conversion between permittivity (ε) and the refractive index (n) as ε = n 2 . A typical limitation of the TB-EMA approach arises when the actual shape of the inclusions significantly deviates from a sphere. This phenomenon leads to the introduction of a symmetric error, which is observed when the extracted terahertz porosity is plotted against the nominal porosity.
Finally, the third terahertz porosity measurement approach, called the anisotropic Bruggeman effective medium approximation (AB-EMA), is also based on similar analogy as the TB-EMA but considers non-spherical inclusions given as follows [44].
The AB-EMA allows the calculation and use of the g factor and therefore corrects the existing symmetric error (a major limitation of the TB-EMA), which enhances the accuracy of the measured terahertz porosity. Moreover, the knowledge of the g factor permits the prediction of the pore shape, which is an added merit of the AB-EMA compared with both the ZPA and TB-EMA methods. As already mentioned, this terahertz porosity measurement method always demands the use of a flat-faced tablets set with known nominal porosities and effective refractive index values determined in TD or in FD. These known parameters in conjunction with the ZPA (Eq. 8), TB-EMA (Eq. 10), or AB-EMA (Eq. 11) are used to accurately calculate the refractive index of the solid matrix. In order words, the initial flat-faced tablets set is used to obtain the intrinsic (solid) refractive index of the solid matrix (powder blend) that is used for further analyses. Henceforth, the porosity of any batch of any shape tablets compressed from a powder blend with known intrinsic refractive index of the solid matrix (n solid ) can be measured non- Table 3 The measured averaged parameters of the five batches of biconvex tablets. Each batch contained 15 tablets. From Eq. 6 the tablets' volume was calculated with the parameters h = 1.01 mm and L = H − 2h. The tablet density, ρ tablet , was then determined from the weight and volume using Eq. 5. With the measured true density, ρ true = 1.439 g cm −3 , the nominal porosity was estimated using Eq. 7 invasively by solving for f (henceforth referred to as the terahertz porosity) using either the ZPA (Eq. 8), TB-EMA (Eq. 10), or AB-EMA (Eq. 11) as given in Eq. 12 below.

Case Study and Discussions
This tutorial has utilised prepared batches of flat-faced and biconvex tablets as a case study to systematically demonstrate the application of the terahertz porosity measurement technique.

Terahertz Effective Refractive Index by TD and FD Methods
The conduction of the reference and sample measurements marks the onset of the terahertz method, which leads to the measurements of the effective refractive index of the tablets either by the TD or the FD method. As shown in Fig. 5a-d for the flat-faced and biconvex tablets, respectively, the measured n eff based on the TD (Fig. 5a, c) and FD (Fig. 5b, d) methods are compared. The TD effective refractive index, n eff.TD , was extracted from the measured terahertz pulse delay using Eq. 2 whereas the n eff.FD was obtained from the phase difference using Eq. 4. The values of n eff.FD , shown in Fig. 5, were obtained by selecting and averaging the refractive indices from a dispersion-free portion of the refractive index spectra as already illustrated in Fig. 3. Herein, the averaged n eff.FD values within the frequency range of 0.4-0.8 THz were used for all the batches. Both the TD and FD approach worked well for the samples given their closely matched values. The slight differences in values between the TD and FD approaches can be attributed to possible dispersion effects that may have caused a broadening effect on the terahertz pulse as it traverses the sample ( Table 4). The broadening effect will decrease the accuracy of the pulse delay extraction and hence increase the error in the measured n eff.TD . However, with the FD approach the dispersion effect is eliminated through the n eff.FD selection process outlined above. Also, the FD approach ensures consistency and allows comparison of the measured n eff.FD among the various tablets given the use of a constant frequency range for selection of n eff.FD for all the tablets. Based on the proven confidence in the accuracy of the FD method, the n eff.FD was used in the rest of the analyses in this tutorial.

Terahertz Porosity Measurement
From the known effective refractive index coupled with either the ZPA, the TB-EMA or the AB-EMA method (see Eq. 12), the terahertz porosity for the sets of tablets was measured. The intrinsic refractive index, n solid , was calculated using the n eff.FD and the nominal porosity, coupled with the respective Eqs. 8, 10 and 11 for the ZPA, the TB-EMA and the AB-EMA methods. The three methods are in an excellent agreement for the flatfaced tablets as reflected in the closely matched values of the estimated n solid (see Table 5). Hence, the assumption of spherical inclusions was valid for the flat-faced tablets. However, the assumption of the spherical inclusions did not hold for the biconvex tablets as observed in the deviation of the n solid obtained by the TB-EMA method compared with that of the ZPA and the AB-EMA methods. Although both the flat-faced and biconvex tablets were compacted from a similar formulation, it is surprising to observe the significant difference in their n solid values. The high values of n solid for the biconvex tablets can be attributed to the non-sphericity, as given by the g factor, and orientation of the solid particles within the tablet. The values of g used in the current analyses for the flat-faced and biconvex tablets were 0.36 and 0.51, respectively. It is worth mentioning that the authors are currently working on a tutorial that seeks to provide an in-depth discussion on pore structure analyses of pharmaceutical tablets. Prone to errors due to dispersion and absorption that cause broadening of the terahertz pulse. FD Insensitive to errors due to dispersion and hence applicable for samples with profound absorption peak(s) in the terahertz region.
Involves technical signal processing and data analyses method that requires expertise.
Once the intrinsic refractive index, n solid , of the tablets is known, the terahertz porosity can be estimated using the three methods as given by Eq. 12. In the case of the flat-faced tablets, Fig. 6a shows how similar the results are derived from the three methods (ZPA, TB-EMA and AB-EMA) for the accurate estimation of the terahertz porosity. The values of the coefficient of determination, R 2 ; the root mean square error, RMSE; and the slope given in Table 5 further show how closely the three methods perform for measuring the porosity of flat-faced tablets. However, in the case of the biconvex tablets, the AB-EMA outperforms both the ZPA and the TB-EMA methods. Based on the data shown in Fig. 6b, the ZPA appears to overestimate the terahertz porosity whereas, unsurprisingly, an existing symmetric error was detected in the porosity extracted by the TB-EMA method. Despite the observed perfect linear relation between f THz and f nominal for the three methods (see the R 2 values for the biconvex tablets in Table 5), the AB-EMA outperformed both the ZPA and the TB-EMA in terms of accuracy (AB-EMA gave the least RMSE and a slope ≈ 1).
From the above observation, the choice of a particular method depends on the type of materials and their relative composition as well as the geometry of the tablet. By bearing in mind the close performance of the three methods in case of the flat-faced tablets, one can conveniently adopt any of the three methods without worrying so much about errors in the extracted parameters. From a research point of view, flat-faced tablets are more convenient to study due to the ability to precisely measure their dimensions (thickness and diameter) and the nominal porosity that serve as the basic input parameters in the terahertz porosity method. Additionally, it is quite intuitive to assume that flat-faced compression tooling will naturally allow for a more even distribution of pressure across the surface of the tablet during compaction; hence, the anisotropic phenomena that can take place during compaction of tablets may be less pronounced since the pores are more likely to assume spherical shape. Table 5 Comparing the performance of the three terahertz porosity measurement methods for both the flat-faced and biconvex tablets (Fig. 6  In contrast, for biconvex tablets, the situation can become more complicated due to possible uneven pressure distribution as well as the difficulty to precisely measure the compaction parameters during compaction. Furthermore, it is more difficult to ensure that the terahertz beam propagates exactly through the centre of the tablet during the transmission measurements as well as maintaining consistency to accurately measure the thickness of the tablets at exactly the same spot. These are additional challenges that need to be considered when dealing with biconvex tablets. Studies have shown that the presence of uneven pressure distribution during compaction yields biconvex tablets with high density distribution along the centre [62], which may partly explain the higher n eff values obtained for the biconvex tablets compared with the flat-faced tablets (Fig. 5).
Differences observed in the refractive index values can also be attributed to thickness variations (≈ 1 mm) between the flat-faced and the biconvex tablets. The relatively thick biconvex tablets, during the transmission measurement, may cause a significant shift in the focal plane of the terahertz beam compared with its reference measurement. The shift in the focal plane of the transmitted terahertz beam means that the reference and sample signal will be detected at a different axial position with different Gouy phases at the detector level. The induced relatively larger Gouy phase shift for the biconvex tablets will introduce a significant uncertainty in the extracted refractive index [50,51]. Nonetheless, by considering the relatively long Rayleigh range of the focused terahertz beam used in this study, a shift in the Gouy phase due to a thickness difference should have negligible effect on the extracted refractive index of the tablets. The estimated Rayleigh range at 1 THz of the beam with a waist radius of 1 mm is about 10.5 mm, which is greater than the maximum thickness of the analysed tablets, i.e. 5.53 mm.
Moreover, curvature and possible lensing effect of the biconvex tablets can cause further refraction of the THz beam and hence influence the level of uncertainty in the extracted refractive index.
An extensive study aimed to critically ascertain the effect of density distribution, Gouy phase shift, geometry and lensing effects of pharmaceutical tablets on the measured optical constants and hence the porosity using the proposed THz method is currently ongoing. We recently conducted experiments by mapping over biconvex tablets in transmission using a moving sample stage. The preliminary results (unpublished) have shown the possibility of resolving density differences/ spatially dependent porosity values within the tablets using the terahertz method.
It is important to emphasise that the thickness and the nominal porosity measurements are absolutely critical for the accuracy of the terahertz porosity method. Thickness and nominal porosity serve as the basic inputs variables for all analyses involved in the terahertz porosity method. For example, an error introduced in the measured thickness and porosity will propagate, and significantly affect, the measured effective refractive index, the solid refractive index and hence the predicted terahertz porosity as well as the pore structure. It is therefore strongly recommended that care and consistency must be maintained especially during the thickness measurement as it affects every aspect involved in the data analysis process.

Conclusions
This tutorial has outlined the steps required in the use of THz-TDS to quickly and nondestructively measure the porosity of the pharmaceutical tablets. As a case study, two sets of tablets, i.e. flat-faced and biconvex tablets, were prepared and measured. Five batches of each set composed of 10% ibuprofen were compacted with varying porosity within the range of 7-23%. A comparison made from the use of the TD and FD signal processing techniques has clearly shown that the FD approach comes with additional merits that typically outperforms the TD approach. For example, the FD approach is insensitive to dispersion-based errors and allows consistency in the extraction of the effective refractive index for all the samples.
The results of a similar comparison of the three terahertz porosity measurement methods (ZPA, TB-EMA and AB-EMA) have resulted in the recommendation to use the AB-EMA method due to its ability to account for non-spherical inclusions and is therefore more robust for tablets of a wide range of size and geometry. The performance of the AB-EMA method was found to be independent of the pore shape, material, complexity and geometry of the tablets. The ZPA and the TB-EMA methods were found to be strongly influenced by the pore shape, formulation material, tablet complexity and geometry and hence should only be chosen and used in well-defined situations.
Funding Information The authors would like to acknowledge funding from Innovate UK, project reference 104196. All raw data shown in this manuscript can be downloaded from https://doi.org/10.17863 /CAM.47564 Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.