1 Introduction

Surface profilometry encompasses a series of techniques to characterize the topography of a surface to determine, amongst other things, its curvature, flatness or thickness [1,2,3,4,5,6]. In particular, the development of novel methods to measure the thickness of a sample, either with higher resolutions or straight forward implementations, are crucial in many scientific and technological applications [7,8,9,10]. In this context, optical methods are highly preferred over mechanical profilometers [11,12,13] or atomic force and tunneling microscopy [14,15,16,17], in part due to their high speed and reliability but also because they are non-invasive [18,19,20,21,22,23]. Common optical methods include chromatic confocal microscopy [24], phase measuring deflectometry [25, 26], phase shifting interferometry [27] and digital holographic microscopy [28]. Interferometric approaches rely on measuring the phase difference between a signal and a reference optical waves, from which the sample’s topography can be inferred [27]. In this case, it is customary to separate a Gaussian beam into two paths, one that serves as the reference beam and another that illuminates the sample, which are later recombined to perform measurements. Since each beam travels along independent paths, the optical aberrations they experience are different and the system is prone to fluctuations caused by external disturbances and vibrations. In addition, they often use mechanical systems to scan the sample spatially or to introduce controlled phase delays between the two beams, which might introduce instabilities in the system. Both aberrations and instabilities translate into additional uncontrolled phase delays uncorrelated with the sample, which, if not taken into account, negatively affect the topography measurements.

To overcome these limitations, here we propose an all-digital interferometric approach to measure nano-scaled topographies based on computer generated holograms (digital holograms) written to a spatial light modulator (SLM). Our approach has two key advantages: First, since we use a common-path interferometer (CPI), both the reference and measuring beams travel along the same path, ensuring that upon propagation they will experience the same optical aberrations and vibrations [29,30,31]. Second, since our system is all-digital, we can scan the sample and introduce controlled phase delays with no moving parts, thus avoiding the typical instabilities common to mechanical scanning systems. We achieve this by patterning an initial flat field by means of a liquid-crystal SLM [32], following standard structured or tailored light [33] generation techniques [34], as has already proven useful in diverse applications in optical metrology [35, 36], such as rotation velocity [37,38,39] and refractive index [40] measurements. We implemented our system experimentally and tested it on artificial samples of diverse topographies and on real samples with a step in their height, obtaining in both cases good agreement between the measurements and the known surfaces.

2 Concept

Our method is based on interference. Specifically, on how interference fringes shift as a result of changes in the relative phase between two interfering fields (Fig. 1a). Let’s consider two beams impinging onto a reflective sample with two height levels, in such a way that each beam falls onto one of them. As a result, there will be a path difference between the two beams, which translates into a phase difference between them given by

$$\begin{aligned} \varphi _\text {sample} = \frac{4\pi }{\lambda }h, \end{aligned}$$
(1)

with h the height difference between the two levels and \(\lambda\) the wavelength. Equation 1 implies that we can determine the height of the sample by measuring the phase difference between the two beams after interacting with the sample, which can be accomplished from the interference fringes formed at the Fourier plane of the sample. In the laboratory, we can create the two beams as two apertures and access the sample’s Fourier plane by positioning it at the front focal plane of a lens while measuring at its back focal plane. Mathematically, the optical field U(xyf) resulting from the interference is given by [41]

$$\begin{aligned} U(x,y;\,f) = \frac{e^{i2kf}}{i\lambda f} \iint _{-\infty }^{\infty } A(x_0,y_0)e^{ -i\frac{2\pi}{\lambda f} \left[ xx_0 + yy_0 \right] }dx_0dy_0, \end{aligned} $$
(2)

where \((x_0,y_0)\) and (xy) are the coordinates at the front (input) and back (output) planes, respectively, f is the focal length of the Fourier transforming lens, \(\lambda\) is the wavelength, k the wave number and \(A(x_0,y_0)\) represents the functional form of the apertures. For convenience, we use square shaped apertures and locate the centre of the first aperture at the origin of the coordinate system and refer to it as the reference aperture. The centre of the second aperture, which we call the scanning aperture, is located at \((x_s,y_s)\). In this case, the apertures function is

$$\begin{aligned} A(x_0,y_0)= {\left\{ \begin{array}{ll} \sqrt{R_R}e^{i\varphi _R} &{} |x_0| \le a \;\text {and}\; |y_0| \le a \\ \sqrt{R_s}e^{i\varphi _s} &{} |x_0-x_s| \le a \;\text {and}\; |y_0-y_s| \le a \\ 0 &{} \text {elsewhere} \end{array}\right. }, \end{aligned}$$
(3)

where we have assumed an unitary incident field, the apertures’ size to be 2a and we have allowed the apertures to have independent intensities \(R_R\) and \(R_s\) and phases \(\varphi _R\) and \(\varphi _s\). Here, the different intensities might arise as a result of different reflectances of the sample. After replacing Eq. 3 into Eq. 2 and solving the integral, we can calculate the field intensity \(I=I(x,y;f) = |U(x,y;\,f)|^2\) as

$$\begin{aligned}&I\propto {{\,\mathrm{sinc}\,}}^2\left( \frac{ka}{f}x\right) {{\,\mathrm{sinc}\,}}^2\left( \frac{ka}{f}y\right) \left\{\vphantom{\cos\left[\frac{k}{f}(x_sx+y_sy)\right]} R_R+R_s \right. \nonumber \\&\quad \left. +\,2\sqrt{R_RR_s}\cos \left[ \frac{k}{f}(x_sx+y_sy) +(\varphi _R-\varphi _s)\right] \right\} . \end{aligned}$$
(4)
Fig. 1
figure 1

a Conceptual sketch of the topography measurement. Two beams are reflected back from a sample, separated from the incoming ones using a beam splitter (BS) and made interfere by means of a lens (L). At the lens focal plane interference (FP) fringes appear, whose period depends on the separation between the two beams and position on the phase difference between them. By choosing one beam as reference and the other as a probing beam, it is possible to infer the height (h) of the sample at the position of the former with respect to the sample height at the reference position by measuring the interference fringes shift. b Example data points and corresponding fitted curve for one scanning point. Dashed line corresponds to the non-shifted curve (\(h=0\))

Fig. 2
figure 2

Schematic representation of the experimental setup used to measure the topography of a sample in a digital way. HWP half-wave plate, LP linear polariser, L Lens, SLM liquid crystal Spatial light modulator, M Mirror, SF spatial filter, BS Beam splitter, CAM CMOS digital camera. Insets represent examples of the phase mask displayed on the SLM (grating has been omitted for the sake of clarity), as well as example acquired images at the Fourier plane (top) and laser beams (corresponding to the apertures) overlapped onto an image of the sample (bottom)

The cosine term corresponds to interference fringes, which are modulated by the sinc functions. The fringes’ period and inclination depend on the position of the scanning aperture, while their visibility on the ratio between the apertures intensities. The phase term in the cosine function represents the shift of the fringes due to the relative phase between the two apertures, and is the key term in our approach. After evaluating the intensity at the centre of the interference pattern with \(\varphi _R=0\) and taking into account that cosine is an even function, we finally obtain \(I(0,0) \propto R_R + R_s + 2\sqrt{R_RR_s}\cos (\varphi _s)\), which depends solely on the intensities of the apertures and the phase of the scanning aperture. This phase is the combination of the phase resulting from the interaction with the sample \(\varphi _\text {sample}\) and the initial phase of the aperture \(\varphi _\text {SLM}\), so that

$$\begin{aligned} I(0,0) \propto R_R + R_s + 2\sqrt{R_RR_s}\cos (\varphi _\text {SLM}-\varphi _\text {sample}). \end{aligned}$$
(5)

We can infer \(\varphi _\text {sample}\) by measuring the intensity at the centre of the interference pattern for increasing values of \(\varphi _\text {SLM}\) in the interval \([0, 2\pi ]\) and subsequently fitting the data to the model in Eq. 5 (Fig. 1b). The effect of \(\varphi _\text {sample}\) is observed as a shift in the intensity curve, in such a way that for \(\varphi _\text {sample}=0\), the intensity is minimum at \(\varphi _\text {SLM}=\pi\) and for \(\varphi _\text {sample}\ne 0\), the position of said minimum will be shifted by \(\varphi _\text {sample}\). Since this shift is induced by the sample and by virtue of the relationship between phase delay and height (Eq. 1), we can calculate then the height of the sample at the position corresponding to the scanning aperture. As such, the approach does not require a spatially resolved detector because the SLM provides the spatially resolving step. This is the fundamental difference between conventional phase shifting approaches and our digital approach. Experimentally, the measurement is carried out at an area of finite size, which depends on the numerical aperture of the optical system, as illustrated in Fig. 1a as gray circles at the centre of the pattern. Crucially, height measurements are relative to the height at the reference aperture position. Such dynamic increasing of the phase, as well as the ability to scan the sample in 2-Dimensions by moving the position of the scanning aperture can be realised experimentally by means of a spatial light modulator [34], as we will describe next.

Fig. 3
figure 3

a Raw and calibrated data of a flat sample. b Histograms corresponding to the data of panel (a). Standard deviation of the calibrated data distribution is considerably narrower, indicating a better accuracy. c Comparison of the raw and calibrated measured surfaces to the programmed sample for a sample that follows a diagonal sine profile

3 Experimental details

Figure 2 shows a conceptual schematic of the implementation of the technique. Light out of a Helium-Neon laser is expanded by means of a telescope (lenses L\(_1\) and L\(_2\), with focal lengths \(f_1={50}\hbox { mm}\) and \(f_2={500}\hbox { mm}\), respectively) and directed towards a reflective liquid crystal spatial light modulator (SLM, Holoeye, phase only, PLUTO-2 VIS-021-C, \(1920\times 1080\) pixels, \({8}\,\upmu \hbox {m}\) square pixels). The SLM plane is then imaged onto the sample using lenses L\(_3\) (\(f_3={750}\hbox { mm}\)) and L\(_4\) (\(f_4={400}\hbox { mm}\)), which is subsequently imaged using lenses L\(_5\) and L\(_6\) (\(f_5=f_6={150}\hbox { mm}\)), and thereafter Fourier transformed by lens L\(_7\) (\(f_7={100}\hbox { mm}\)). Light reflected back from the sample is separated from the incoming beam using a beam splitter (BS). A digital camera (Thorlabs DCC1240C, CMOS colour sensor, \(1280\times 1024\) pixels, \({5.3}\,\upmu \hbox {m}\) square pixels) is placed either at the Fourier (CAM\(_\text {FP}\)) or image (CAM\(_\text {IP}\)) planes of the sample for topography measurement or acquiring an image of the sample, respectively. The latter were acquired using an incoherent light source, which is not shown in the figure. Typical images of each case are shown as insets on the right hand side, where the interference fringes at the Fourier plane and the sample at the image plane can be seen. We have overlapped the apertures image onto to the latter for reference. The linear polariser (LP) is used to ensure the SLM is illuminated with horizontally polarised light, and the half-wave plate (HWP) enables the control of the beam power. Spatial filters (SFs) were introduced to remove unwanted light resulting from, for instance, diffraction orders from the SLM. An example phase mask is presented next to the SLM in the drawing, where, for the sake of clarity, we have omitted the blazed grating, necessary to separate the modulated light from other diffraction orders (zeroth and higher). The gray and white squares represent the reference and scanning apertures, respectively.

The use of the SLM allows full control of the aperture’s attributes, including their size, position and phase, with a single element in an all-digital manner. Its size determines the probed area on the sample at each scanning position, and its smallest achievable value is limited mainly by the system’s numerical aperture. It is important to guarantee it is small enough so that the sample can be considered flat within the aperture. Its position is used to spatially scan the sample by moving it on the phase mask, by virtue of the imaging system between the SLM and sample planes. Its phase is constant across the aperture (effectively shifting laterally the grating in the direction perpendicular to its ruling) and it is used for the measurement as explain below. Crucially, to ensure the phase value applied to the modulated light is indeed linear with the gray levels of the phase masks displayed on the SLM, the correct voltage correction lookup table (gamma file in the case of Holoeye SLMs) must loaded into the SLM driver.

The measurement consists of capturing the intensity at the centre of the interference pattern using a digital camera for several phase values (\(\varphi _\text {SLM}\)) of the scanning aperture and fitting the data according to the model in Eq. 5, as illustrated in Fig. 1b. The height of the sample at the position given by the aperture location on the sample is then computed from the phase shift of the cosine function and using Eq. 1. In our experiment, for each scanning position, we measured 19 \(\varphi _\text {SLM}\) values in approximately \({10}\,\hbox {s}\), corresponding to nearly half an hour for a 169-point scan. This could be made considerably faster by using speed-up approaches [42], or by replacing the liquid crystal device with a digital micro-mirror device (DMD) [43], capable of kilohertz refresh rates.

An important step is to calibrate the optical system to remove any errors due to aberrations in the beams (caused by imperfections of the optical elements or minor misalignment). Calibration data is obtained by performing a measurement on an optically flat sample, and subtracting it from the measurement of the sample of interest. The effect of this calibration will be shown in more detail in the next section.

4 Results

To test the performance of our method, we first carry out measurements on an artificial sample that we could control on demand. For doing so, we placed a second SLM in the sample plane and created phase masks representing diverse topographies. We computed the appropriate phase maps from the desired topographies in nanometers and using Eq. 1. In this case, the calibration data was acquired by performing a measurement for a phase mask with zero phase across the whole scanning area. Figure 3a presents raw and calibrated data for a flat sample. It can be seen that while the raw data features a structure that does not corresponds to the real topography of the sample, which we know to be flat, the calibrated one accurately depicts it. The positive effect of the calibration procedure can be further observed in Fig. 3b, where we have plotted histograms of the measured heights for both cases. Since the sample is flat, an ideal measurement would yield a unique bar at \(h=0\), and a real one should be as close as possible to it. This is the case of the calibrated data, whose distribution is centred around \(h=0\) with a standard deviation of \({4.3}\hbox { nm}\), which is about 15 times smaller than the one corresponding to the raw data. An additional example of the effect of this data calibration for a sample that follows a diagonal sine function is shown in Fig. 3c, where we present raw, calibrated and programmed topography data. It is clear the calibrated data better resembles the set data, especially near the outer limits of the scanning range, demonstrating the good performance of the calibration procedure.

Next, we programmed a sample containing only a step function of the height and measured its profile for heights of 15, 30 and \({60}\hbox { nm}\) (Fig. 4a). Gray continuous lines correspond to the programmed samples. The presence of an abrupt change in height is easily identifiable on the three cases, as well as their different height levels. Next, we created samples with heights from 0 to \({150}\hbox { nm}\) in intervals of \({5}\hbox { nm}\) and contrasted the measured heights with the programmed ones as presented in Fig. 4b, where for reference we plotted the function \(y=f(x)=x\) (the ideal case in which the measured and set heights are identical) as a gray continuous line. Given that all measured points fall in the vicinity of the reference line, we can conclude that the method gives accurate results. Error bars in Fig. 4a and b are calculated as the standard deviation of the calibrated measurement of a sample with no step.

Fig. 4
figure 4

a Measured height profiles of an artificial sample with a step height of 15, 30 and \({60}\hbox { nm}\). Programmed profiles are shown as grey lines. b Measured against programmed step heights. Ideal case, in which they are identical, is shown as a grey line. c Measured surfaces for artificial samples for \(h(x,y)\propto xy\) (left) and following a spiral phase plate profile \(h(r,\theta )\propto \theta\) (right). Insets show the programmed samples. d Measured topographies of real samples with a sharp step in height. Insets show corresponding images of the samples

On a second stage, we created more complex samples with continuously changing topographies in a wider range of heights within the same sample. Two examples of such are depicted in Fig. 4c, where we show the measured topography as a surface and the programmed sample as an image in the top-right corner for each case. The first example corresponds to a sample whose topography changes proportionally to the product of the the x and y coordinates. It can be seen that although the measured surface is slightly rough, its shape correlates very well with the programmed one. In the second example, we encoded a surface analogous to a spiral phase plate and, as in the previous case, obtained good agreement between the measurement and the programmed sample.

Finally, we evaluated our technique on real samples with a step in height in one dimension. Measurements for two different samples are shown in Fig. 4d, with corresponding sample images at the top-right in each case. The presence of the step is clear in both cases, as evidenced by the sharp change in the height of the sample. Importantly, even though in this case we do not have a reference to directly compare with, both the good agreement between the measured surface and our knowledge of the sample as well as the compelling results obtained with the artificial samples validate the measurements we did of real samples, as the data acquisition and treatment were identical.

5 Discussion and conclusions

The lateral spatial resolution and measurement range of our technique depends on the particular optical system implemented. The former depends on the numerical aperture of the system and the latter on the magnification from the SLM to the sample planes. Our method can therefore be adapted to the particular necessities of the sample of interest regarding field of view and resolution. On the other hand, the longitudinal resolution of our method depends solely on technological aspects and data treatment, such as the detector’s bit depth and the accuracy of the fitting. While in principle the longitudinal measurement range is limited to \(\lambda /4\) (\(\approx {150}\hbox { nm}\) in the case of the He-Ne laser we used in our experiments), since the phase shift measurement is confined to the interval \([0, 2\pi ]\), the use of phase unwrapping techniques [44] can help extending this range above such limitation.

We have demonstrated our approach on real (non-ideal) samples with unknown reflectivities, and shown its versatility. A further extension would be to study diffusive samples where speckle may be an important factor to consider. Rather than something to be avoided in optical systems, the linearity of speckle allows it be exploited as a valuable resource in determining additional features of samples [45], e.g., its spectral properties, and can be enhanced even further by adding in deep learning tools [46]. We hope to explore this avenue further in future work.

In summary, we have proposed an alternative method to measure topographies in the nanometric regime in the longitudinal direction and micro- to millimeters in the transverse direction. Importantly, since the mathematical model we use includes the sample reflectance, our method can be extended to the measurement of the sample reflectance at each point. Moreover, our technique can be used not only on perfectly reflective samples, but also on partially reflective ones with low scattering coefficients, thus broadening considerably the range of samples it can be applied to. Finally, even though we used an SLM to demonstrate our concept, our technique can also be implemented with digital micromirror devices [43], which are low-cost and can reach refreshing rates up to tens of \(\hbox {kHz}\), thus reducing the scanning time.