## Abstract

In Phase Stepping Interferometry (PSI) an interferogram sequence having a known, and constant phase shift between the interferograms is required. Here we take the case where this constant phase shift is unknown and the only assumption is that the interferograms do have a temporal carrier. To recover the modulating phase from the interferograms, we propose a self-tuning phase-shifting algorithm. Our algorithm estimates the temporal frequency first, and then this knowledge is used to estimate the interesting modulating phase. There are several well known iterative schemes published before, but our approach has the unique advantage of being very fast. Our new temporal carrier, and phase estimator is capable of obtaining a very good approximation of their temporal carrier in a single iteration. Numerical experiments are given to show the performance of this simple yet powerful self-tuning phase shifting algorithm.

©2009 Optical Society of America

## 1. Introduction

Phase Stepping Interferometry (PSI), is one of the most useful techniques in optical metrology for estimating the modulating phase of interferograms [1]. In standard PSI, an interferogram sequence of N interferograms is taken having a known temporal carrier. When the actual temporal frequency of the interferograms does not match with the expected carrier of the phase shifting algorithm, a phase estimation error is introduced; a detuning error [2, 3]. To minimize most of this detuning error, people have proposed phase estimation techniques robust to this [2, 4, 5, 6, 7, 8]. One class of such methods are designed to be less sensitive to detuning [2, 4]. In this way one tolerates small deviations between the actual temporal frequency, and the carrier of the phase-shifting algorithm. However, these methods still assume that the temporal frequency of interferograms is known but having a small uncertainty region. The best known example of this is the 5-steps phase-shifting algorithm proposed by Hariharan [2], which assumes that the interferogram sequence has a temporal frequency of *π*/2 radians, and tolerates small detuning around *π*/2 radians.

Another class of phase stepping techniques with much poorly known carrier, estimates this carrier from the interferometric data. These methods are named self-calibrating, and are always iterative [5, 6, 7, 8]. These algorithms work in such a way that concurrently estimates the modulating phase and their carrier frequency. The most common of these methods uses the least-squares approach [9]. They make a rough estimation of the modulating phase by solving a linear equation system, and guessing a temporal frequency. Then, using this initial phase estimation, the tuning carrier is improved by solving other *N* linear equation systems (one for each interferogram). Iterating this process it eventually it settles down in the actual carrier and the searched modulated phase [5, 8]. A drawback if this techniques, is that the background illumination and contrast of the interferograms must be spatially constant. Otherwise we may obtain erroneous results. We emphasize that this drawback is not present in our method.

A desired goal in PSI is to recover the modulating phase from an interferogram sequence keeping the whole phase estimation process as simple as possible. Our new algorithm obtains good temporal carrier estimations in one stroke. Having this carrier estimation one then uses it to obtain the searched modulating phase using a tunable 5 steps algorithm. This tunable 5 steps algorithm is also developed in this paper. Doing the phase estimation in this new way, it is far simpler than solving several times (iteratively) a set of linear equations [5, 8]. The algorithm herein presented is of the iterative class; however, in practice, it can obtain very good modulating phase estimation in a single iteration.

The structure of the paper is as follows: in the next section we show two useful tunable phase-shifting algorithms; these are not iterative, they are just plain PSI algorithms but may be tuned anywhere in the spectral domain. After this, we show our algorithm to estimate the temporal carrier in a single stroke. Having this fairly good carrier estimation we introduce this result into our tunable 5 steps PSI algorithm to obtain the searched modulated phase. Finally we show some numerical experiments with the aim of seeing the performance of this algorithm.

## 2. Tunable phase-shifting algorithms

In PSI, a discreet temporal interferogram may be mathematically described using the following mathematical expression:

where *a*(*x,y*) is the interferogram’s background illumination, *b*(*x,y*) its contrast, *ϕ*(*x,y*) its modulating phase that we want to recover, and *ω*
_{0} its temporal frequency carrier, referred here simply as the temporal frequency. The integer index *t* refers to the *n*-interferogram taken at time *t*. For simplicity, in what follows the spatial dependence (*x,y*) of the temporal interferogram signal is not shown, however, the reader must take into account that *I _{t}*,

*a*,

*b*, and

*ϕ*, are scalar fields laying in a rectangular grid of

*M*×

*N*pixels and equals the spatial size of the interferograms.

A phase-shifting algorithm can be seeing as a complex quadrature filter, and we said that it is tunable because the temporal frequency of the algorithm can be introduced as a free parameter of the algorithm [10]. For example, the following quadrature filter:

where *ω*
_{0} is its tuning frequency, *δ*(*t*) is the Dirac delta function, and *i* = √-1. Using this quadrature filter, the modulating phase is given by the following well known *tunable* 3-steps phase-shifting algorithm:

where Re{[*h***I*](0)}, and Im{[*h***I*](0)} are the real and imaginary part of the convolution *I***h* evaluated at time zero, and *ω*
_{0} is the algorithm’s tuning frequency. Here, the interferograms in the sequence are ordered as {*I*
_{-1},*I*
_{0},*I*
_{1}}.

The quadrature filter of the 3-steps phase-shifting algorithm shown in Eq. (2), has the following frequency response [10]:

where *H*(*ω*) is the Fourier transform of (2). By inspecting this frequency response, into the interval [- *π*, *π*], we can see that this filter has a zero at *ω* = 0, and at *ω* = *ω*
_{0}. In this way this quadrature filter removes these frequency components. Therefore, applying this quadrature filter to the interferogram signal (1), it just let pass the complex signal *I*̂_{t} = *c* · *e*
^{(ϕ+ω0)} from which the modulating phase is taken. The constant *c* is related with the frequency response of*H*(*ω*) at *ω* = -*ω*
_{0}. This simple result shows what a quadrature filter *H*(*ω*) must do for real interferogram signals like the given in Eq. (1). In general, the spectra *H*(*ω*) of a quadrature filter for phase-shifting interferometry must have at least the following conditions *H*(0) = 0, *H*(*ω*
_{0}) = 0, and *H*(-*ω*
_{0})≠ 0 in the spectral line.

Using this way of thinking, we may extend this attractive tunable feature of the 3 steps algorithm to PSI algorithms of higher order. For example, we may build a quadrature filter for a 5 steps phase-shifting algorithm with the following two basic filters [11]:

By simple evaluation, we can see that the filter *H*
_{1}(*ω*) has a zero at frequency *ω* = 0, and that the filter *H*
_{2}(*ω*) has a (tangential) zero at frequency *ω* = *ω*
_{0}. This tangential touch at *ω* = *ω*
_{0} of filter *H*
_{2}, makes it more robust to detuning errors in a neighborhood of *ω* = *ω*
_{0} [3]. Then, the quadrature filter that we are looking for can be obtained as the product of these filters in the following way:

$$\phantom{\rule{1.5em}{0ex}}=\mathrm{sin}\left(\omega \right)\left[1-\mathrm{cos}\left(\omega -{\omega}_{0}\right)\right].$$

Having this, to obtain the *formula* for our phase-shifting algorithm it is necessary to obtain the inverse Fourier transform to get:

$$\phantom{\rule{10em}{0ex}}+i\left[2\delta \left(t-1\right)-2\delta \left(t+1\right)\right]/2-i\left[\delta \left(t-2\right)-\delta \left(t+2\right)\right]\mathrm{cos}\left({\omega}_{0}\right)/2.$$

Taking the convolution of this filter operator with the signal given in Eq. (1), we have the following complex signal:

$$=\left[2{I}_{t}-{I}_{t-2}-{I}_{t+2}\right]\mathrm{sin}\left({\omega}_{0}\right)/2+i\left(2{I}_{t-1}-2{I}_{t+1}\right)/2-i\left({I}_{t-2}-{I}_{t+2}\right)\mathrm{cos}\left({\omega}_{0}\right)/2],$$

which needs at least 5 interferograms in order to be applied at time *t*. Finally we obtain the *formula* four our tunable 5 steps phase-shifting algorithm as the argument of this complex signal at *t* = 0 in the following way:

$$\phantom{\rule{.8em}{0ex}}=\mathrm{arctan}\left[\frac{2{I}_{-1}-{2I}_{-1}-\left[{I}_{-2}-{I}_{2}\right]\mathrm{cos}\left({\omega}_{0}\right)}{\left[2{I}_{0}{-I}_{-2}-{I}_{2}\right]\mathrm{sin}\left({\omega}_{0}\right)}\right]\phantom{\rule{.2em}{0ex}},$$

where Re{}, and Im{}, takes the real and imaginary part of the complex signal *I*̂_{t} . In this point, the reader can prove by direct substitution that if we take the particular case when *ω*
_{0} = *π*/2, then you obtain the 5-steps phase-shifting algorithm published by Hariharan in Ref. [2]. However, the formula given in (10), is therefore a more general expression of a 5-steps phase-shifting algorithm.

## 3. Self-tuning phase-shifting algorithm

Consider that we have an interferogram sequence of five interferograms ordered as {*I*
_{-2},*I*
_{-1},*I*
_{0},*I*
_{1},*I*
_{2}}, and that *ω*
_{0} is its temporal carrier. Now suppose that we are going to recover the modulating phase using the 3-steps phase shifting algorithm shown in Eq. (3), and that instead of have used *ω*
_{0} as tuning frequency we have used a tuning frequency *ω*̂_{0} not equal to *ω*
_{0}. Using this, we estimate two phase maps: *ϕ*̂_{0} using the interferograms *I*
_{-1},*I*
_{0},*I*
_{1}, and *ϕ*̂_{1} using the interferograms *I*
_{0},*I*
_{1},*I*
_{2}. Given that *ω*̂_{0} ≠ *ω*
_{0}, these phase maps will be obtained with errors as follows:

$${\hat{\varphi}}_{1}=\varphi +{\omega}_{0}+{\epsilon}_{1},$$

where *ε*
_{0}, and *ε*
_{1} are the detuning errors. As shown in [3], we can see that these detuning errors are given as:

Here *H*() is the frequency response of the quadrature filter corresponding to the 3-steps phase-shifting algorithm (see Eq. (2)). From the previous section, we must note that we would obtain *H*(*ω*
_{0}) = 0 only if *ω*
_{0} would be used as tuning frequency of the 3-steps algorithm. Taking the phase difference between *ϕ*̂_{0}, and *ϕ*̂_{1}, and using some trigonometric identities this phase difference has the following form:

In this equation, we see that we can obtain a good estimator for the actual temporal frequency *ω*
_{0} by eliminating the contribution of the detuning error. To eliminate this sinusoidal detuning error, we can take the spatial mean. The spatial mean of the sinusoidal detuning error is zero if for complete spatial periods or fringes. We may have full spatial periods in the sinusoidal error if the interferograms of the sequence have several fringes, as usually it occurs in practice. Therefore we suggest the following temporal frequency estimator:

which takes the spatial mean of the wrapped phase difference between *ϕ*̂_{0}, and *ϕ*̂_{1}, being *W*[] the wrapping operator. Here it is necessary to wrap the phase difference because we actually obtain the phase maps *ϕ*
_{0}, and *ϕ*
_{1} wrapped. In this way, we have a good (in one stroke) frequency estimator no matter if *ϕ*̂_{0}, and *ϕ*̂_{1} were given with detuning errors.

Having estimated the temporal frequency *ω*
_{0}, we proceed to demodulate our 5-sample interferogram sequence using Eq. (10). Thus, the self-tuning phase-shifting algorithm can be given in the following way: Given an interferogram sequence of 5 interferograms arrayed as {*I*
_{-2},*I*
_{-1},*I*
_{0},*I*
_{1},*I*
_{2}} with an unknown temporal frequency,

- Use the 3-steps phase-shifting algorithm shown in (3), and guess a reasonable temporal frequency to estimate the phase
*ϕ*̂_{0}using images*I*_{-1},*I*_{0},*I*_{1}, and the phase*ϕ*̂_{1}using images*I*_{0},*I*_{1},*I*_{2}. - Given
*ϕ*̂_{0}, and*ϕ*̂_{1}, estimate the actual temporal frequency*ω*̂_{0}using (14). - Using this last estimated temporal frequency
*ω*̂_{0}as tuning frequency, obtain the modulating phase*ϕ*̂ using (10).

In our experience, this process is good enough to give a very good phase estimation in a single stroke of this scheme. As expected, having noisy interferograms this exactitude is reduced. To increase the accuracy, one may iterate this scheme as a refinement process converging to the actual phase map. Doing this, as we will see in the next section, having interferograms with a low noise we can rapidly reach detuning errors of the order of 10^{-3} radians in a single iteration.

## 4. Numerical experiment

To test the self-tuning phase-shifting algorithm developed here, we simulated 5 interferogram sequences with different temporal frequencies. Each sequence has five interferograms. For comparison purposes, we have added white noise with mean zero and a variance of 0.09 radians. An example of these interferogram sequences is shown in Fig. 1. These simulated interferograms have very poor fringe visibility since we have added a non constant background illumination and contrast. To reproduce the interferogram sequences that we used in these tests, the reader can use the following expressions: the discreet-time interferogram sequence was simulated as follows:

where *ω*
_{0} is the actual temporal carrier, *η _{t}*(

*x,y*) is a white noise random field with mean zero and a variance of 0.09 radians that changes for each interferogram. The phase is given as a simple plane in the following way:

where *M* = *N* = 256, and (*x,y*) are in a rectangular grid of *M* × *N*. The background and the contrast are given as

considering that the upper left corner is the image origin.

We made two numerical tests, one without noise (the variance of the white noise *η _{t}*(

*x,y*) is zero), and other with noise as described above. In table 1, we can see the numerical results of these two tests. The results of these two tests were obtained in a single iteration of the algorithm shown in the previous section guessing the first temporal frequency arbitrary as

*ω*̂

_{0}= 1.8 radians. We have three columns for each sequence tested; the first column indicates the actual temporal frequency of the interferogram sequence, the second is the absolute difference between the actual temporal frequency and the estimated frequency, and the third column indicates the absolute phase error between the actual modulating phase, and the estimated phase. These absolute phase errors are obtained as:

being *ϕ*̂(*x,y*) the estimated phase, and *ϕ*(*x,y*) the actual modulating phase that must be wrapped since *ϕ*̂(*x,y*) is given modulus 2*π*. In the test without noise the numerical results are very clear.

These results let us see the high accuracy of the self-tuning algorithm shown here, obtaining phase errors less than 10^{-8} radians in a single iteration. On the other hand, the test with noise obtains phase errors of the order of 10^{-3} radians in a single stroke of the self-tuning algorithm shown here. As the reader can anticipate, if we increase the variance of the noise this accuracy is reduced considerably. However, in practice when we have very noised image interferograms the first tool that we use is a low-pass filter to remove the excessive noise from the interferograms.

#### 4.1. Difference with other works

In the works published before, we found the work given in Ref. [8]. Its approach uses iteratively the phase shifting least-squares technique, and from this class of methods this is one of the fastest and more accurate self-tuning algorithms published before the work we are presenting here. As shown in Ref. [8], to apply the algorithm it is assumed that the background illumination, and contrast are spatially and temporally constants. This is the principle of phase shifting techniques that uses a least-squares approach [9]. Therefore if we apply the algorithm shown in Ref. [8] to the interferograms sequence shown in Fig. 1 (without noise), this algorithm only obtains mistaken phase maps and phase shifts. In Fig. 2 we see an example of this result for the phase. There we show the phase map obtained with the algorithm shown in Ref. [8], and the phase map obtained with the self-tuning algorithm shown here. The expected phase is as the phase obtained with the self-tuning algorithm shown here. Our algorithm converges to this phase map after two iterations with a relative phase error of the order of 10^{-6} radians, that is, the absolute phase difference between the phase obtained in the current iteration, and the phase obtained in the previous iteration. On the other hand, using the least-squares approach after 55 iterations we see the mistaken phase shown in Fig. 2, with a relative error of 0.405158 radians. This simple test, let exposed that using least-squares as in [8], we will not converge to the actual modulating phase if the background illumination and contrast are not spatially constants. However, It is necessary to remark that the main importance of the work published in Ref. [8] is that it is able to obtain the phase shifting of all interferograms in the sequence, and it is not necessary to have a linear temporal phase shifting. The main drawback of this method is that the background illumination and contrast must be spatially constants.

## 5. Commentaries and conclusions

Summing up, we have show a new technique to estimate in a single stroke the temporal carrier frequency, and modulating phase of a set of 5 interferometric temporal data, as well as its modulating phase. As shown in the results section, the self-tuning phase-shifting algorithm herein presented is very efficient and accurate. With a single iteration, the algorithm obtains pretty good approximations to the actual carrier and (as a consequence) the modulating phase of the interferogram sequence. For all practical purposes, our carrier and phase estimation far exceeds the standard experimental sources of error. However, if the experimental application requires more accuracy, this algorithm may be further iterated to obtain even better estimations.

## References and links

**1. **D. Malacara, M. Servin, and Z. Malacara, *Interferogram Analysis for Optical Testing*, 2nd ed. (CRC, 2005). [CrossRef]

**2. **P. Hariharan, B. F. Oreb, and T. Eiju, “Digital phase-shifting interferometry: a simple error-compensating phase calculation algorithm,” Appl. Opt. **26**(13), 2504–2506 (1987). http://ao.osa.org/abstract.cfm?URI=ao-26-13-2504. [CrossRef] [PubMed]

**3. **J. F. Mosino, M. Servin, J. C. Estrada, and J. A. Quiroga, “Phasorial analysis of detuning error in temporal phase shifting algorithms,” Opt. Express **17**(7), 5618–5623 (2009). http://www.opticsexpress.org/abstract.cfm?URI=oe-17-7-5618. [CrossRef] [PubMed]

**4. **Y. Surrel, “Phase stepping: a new self-calibrating algorithm,” Appl. Opt. **32**(19), 3598–3600 (1993). http://ao.osa.org/abstract.cfm?URI=ao-32-19-3598. [CrossRef] [PubMed]

**5. **I.-B. Kong and S.-W. Kim, “General algorithm of phase-shifting interferometry by iterative least-squares fitting,” Opt. Eng. **34**(1), 183–188 (1995). http://link.aip.org/link/?JOE/34/183/1. [CrossRef]

**6. **J. L. Marroquin, M. Servin, and R. R. Vera, “Adaptive quadrature filters for multiple phase-stepping images,” Opt. Lett. **23**(4), 238–240 (1998). http://ol.osa.org/abstract.cfm?URI=ol-23-4-238. [CrossRef]

**7. **K. G. Larkin, “A self-calibrating phase-shifting algorithm based on the natural demodulation of two-dimensional fringe patterns,” Opt. Express **9**(5), 236–253 (2001). http://www.opticsinfobase.org/oe/abstract.cfm?URI=oe-9-5-236. [CrossRef] [PubMed]

**8. **Z. Y. Wang and B. T. Han, “Advanced iterative algorithm for phase extraction of randomly phase-shifted interferograms,” Opt. Lett. **29**(14), 1671–1673 (2004). http://ol.osa.org/abstract.cfm?URI=ol-29-14-1671. [CrossRef] [PubMed]

**9. **C. J. Morgan, “Least-squares estimation in phase-measurement interferometry,” Opt. Lett. **7**(8), 368 (1982). http://www.opticsinfobase.org/abstract.cfm?id=59997. [CrossRef] [PubMed]

**10. **M. Servin, J. C. Estrada, and J. A. Quiroga, “Spectral analysis of phase?shifting algorithms,” Opt. Express **17**(19), 16,423–16,428 (2009). http://www.opticsexpress.org/abstract.cfm?URI=oe-17-19-16423. [CrossRef]

**11. **J. Estrada, M. Servin, and J. Quiroga, “Easy and straightforward construction of wideband phase-shifting algorithms for interferometry,” Opt. Lett. **34**(4), 413–415 (2009). http://ol.osa.org/abstract.cfm?URI=ol-34-4-413. [CrossRef] [PubMed]