Improved Carrier Frequency-Shifting Algorithm Based on 2-FFT for Phase Wrap Reduction

The number of phase wraps that result from the carrier component can be completely eliminated or reduced by first applying a fast Fourier transform (FFT) to the image and then shifting the spectrum to the origin. However, because the spectrum can only be shifted by an integer number, the phase wraps of the carrier component cannot be completely reduced. In this paper, an improved carrier frequency-shifting algorithm based on 2-FFT for phase wrap reduction is proposed which allows the spectrum to be shifted by a rational number. Firstly, the phase wraps are reduced by the conventional FFT frequency shift method. Secondly, the wrapped phase with residual carrier components is filtered and magnified sequentially; the amplified phase is transformed into the frequency domain using an FFT, and then, the wrapped phase with the residual carrier components can be further reduced by shifting the spectrum by a rational number. Simulations and experiments were conducted to validate the efficiency of the proposed method.


Introduction
In optical metrology, two-dimensional (2D) phase-based techniques have been widely used in various measurement applications, such as deformation and vibration measurement and three-dimensional (3D) surface measurement [1][2][3]. In these applications, information is always encoded in a modulated fringe, which can be directly projected by a commercial projector or generated using the interference method [4][5][6]. en, the phase is calculated from the arctangent function based on a phase-shifting or Fourier transform method [7]. From the mathematical properties of the arctangent function, 2π phase jumps exist in the recovery phase signal, which is called a wrapped phase. To obtain a continuous phase distribution, a phase unwrapping procedure is required [8]. eoretically, a phase unwrapping algorithm starts at a particular pixel and then searches for the phase jumps; it adds +2π or − 2π at each jump detected, and the phase of two neighboring points becomes continuous; however, it is easily affected by phase noise in practical applications. In recent years, researchers have conducted many studies on the phase unwrapping algorithm, which has made phase unwrapping technology more powerful; however, there are still problems, such as poor accuracy and low efficiency [9][10][11].
In some cases, phase unwrapping can be avoided or the phase wraps can be significantly reduced, for example, in fringe projection or off-axis holographic profilometry [12][13][14]. In these techniques, a carrier signal is included in the extracted phase information. By applying a Fourier transform and shifting the spectrum to the origin, the carrier phase can be eliminated. erefore, fewer wraps or even phase unwrapping are obtained. Because the spectrum can only be shifted by an integer number in a conventional fast Fourier transform (FFT), while the carrier frequency is always a fraction in a practical application, the carrier phase cannot be reduced completely, thereby resulting in a measurement error. To solve this problem, researchers have developed several approaches. Gdeisat et al. proposed a zeropadding method to enlarge the array size of the origin phase image, which achieves a high frequency resolution [15]. Good results can be obtained but with low computational efficiency. Wang et al. presented a fast two-step method to reduce the phase wraps. In their method, a frequency peak was calculated first using an FFT, and then, the sub-pixel spectral peak was determined by applying a discrete Fourier transform to the iteratively up-sampled area around the initial frequency peak location [16]. High accuracy and efficiency can be achieved based on their method.
In this paper, an improved carrier frequency-shifting algorithm based on 2-FFT for phase wrap reduction is proposed, which is more concise and intuitive and does not require zero-padding and iterative sampling. In the first step, an FFT is applied to an image, and the phase wraps are reduced by shifting the spectrum to the origin by an integer number. In the second step, the wrapped phase that results from the residual carrier components is filtered and magnified sequentially, and then, the amplified phase is transformed into the frequency domain using an FFT. Finally, the wrapped phase that results from the residual carrier components is further reduced by shifting the spectrum by a rational number.

Algorithm Principle.
e proposed method includes two steps, which both use carrier frequency-shifting algorithm based on 2-FFT to roughly remove and precisely remove the phase wraps respectively, which further reduce the wrapped phase that results from the residual carrier components. Suppose the deformation fringe pattern modulated by the surface of the object is where (A + C)/N is the carrier frequency along the X direction, A is an integer, C is a rational number, C ∈ (0, 1), and φ(x, y) is the modulation phase produced by the modulation of the object surface. In the first step, the phase wrap is roughly eliminated using the conventional FFT frequency shift method. Since the spectrum can only be shifted by an integer number, its residual linear phase is 2π(B/N)x, B ∈ (− 0.5, 0.5). In order to eliminate the residual phase, in the second step, the phase information of equation (1) is amplified by multiplying it by a large number K; the corresponding cosine fringe pattern is where KB � A 0 + C 0 , A 0 is an integer, and C 0 ∈ (0, 1). Similarly, A 0 can be obtained by applying a Fourier transform and shifting the spectrum of equation (2). Now, A 0 and K are both known, the dominant component of the original residual linear phase can be determined as 2πA 0 /(KN)x, and the residual linear phase becomes 2pB 0 /(KN)x, B 0 ∈ (− 0.5, 0.5). erefore, the phase wraps can be further reduced by eliminating the residual carrier phase information 2πA 0 /(KN)x, and the theoretical accuracy is 1/K. It is worth mentioning that there is a problem on the above analysis, which is that the phase of the object will change from φ(x, y) to Kφ(x, y) according to equation (2), namely, when the residual carrier frequency is amplified and frequency of the object will be amplified too, which may cause frequency aliasing and exceed the Nyquist sampling frequency, thereby causing wrong determination of A 0 . To avoid this problem, Gauss filtering is first carried out before amplifying the phase information to suppress the high frequency information. Meanwhile, in order to avoid under sampling from the amplification of residual carrier information, we have Since |B| < 0.5, K < N can be calculated using equation (3), that is, the theoretical maximum value of the large number K is N.

Analysis of the Algorithm.
In this section, the effectiveness of the proposed algorithm is demonstrated using a numerical simulation based on fringe projection profilometry. A simulation object with a pixel size of 512 × 512 is generated by the peak function in MATLAB. Its 3D surface shape is shown in Figure 1, and the mathematical expression is as follows: e fringe pattern of the simulated object is generated by where f x and f y are the carrier frequencies along the X and Y directions, respectively. In the simulation, the value of f x is set to 50/512, and to simplify the model, the value of f y is set to 0. e four-step phase-shifting method is used to calculate the phase information of the simulated object. First, four simulated fringe patterns are generated using equation (6), and a π/2 increment of the phase is introduced between the four fringe patterns. en, the phase information is extracted using equation (7), and the wrapped phase map is shown in Figure 2: Mathematical Problems in Engineering where φ 1 (x, y) is the wrapped phase produced using the four-step phase-shifting method and tan − 1 is the fourquadrant arctangent operator. From Figure 2, we can see that many wraps appear in the phase image. To eliminate the phase wraps, the conventional FFT frequency shift method is used first. e following is used to convert the wrapped phase map into the complex array O(x, y): where j is equal to . e 2D Fourier transform is applied to O(x, y) as follows: where F[·] is the 2D Fourier transform operator, and the terms u and v are the horizontal and vertical frequencies, respectively. Assuming that the peak of the spectrum is located at (u 0 , v 0 ), the phase is eliminated by shifting the spectrum to the origin, that is, inverse Fourier transform of the phase-shifted frequency signal is calculated as where F − 1 [·] is the 2D inverse Fourier transform operator. Phase information is extracted using where Im and Re represent the imaginary part and real part of the complex array ψ(x, y), respectively, and the phase wraps in the original phase map are eliminated, as shown in Figure 3.
As can be seen from Figure 3, the phase wraps are completely eliminated. Note that the size of the simulated object is 512 × 512. e frequency interval after the Fourier transform is 1/512, and the simulated carrier frequency is set to 50/512, which is exactly an integer multiple of the frequency interval. erefore, in this case, the carrier frequency is precisely determined from the peak location of the spectrum based on the conventional FFT method, and no residual carrier signal exists in the phase map.
However, the carrier frequency is rarely exactly an integer multiple of the frequency interval in a practical application. e carrier phase cannot be reduced completely using the conventional FFT frequency shift method. To visualize this problem, a second simulation is conducted. All parameters are the same as those in the first simulation, except that the value of f x is set to 50.32/512. e simulation results are presented in Figure 4. Because the carrier frequency calculated from the peak location of the spectrum is 50/512, a residual carrier phase exists, as shown in Figure 4(b). erefore, the phase wraps that result from the carrier phase cannot be completely eliminated using the conventional FFT frequency shift method.
To overcome this problem, a simple two-step algorithm for phase wrap reduction is presented as follows: the principle of this method is demonstrated based on a simulation in which all the simulation parameters are the same as those in the second simulation. In the first step, the carrier frequency is roughly determined based on the conventional FFT frequency-shifting method, and the phase with the residual carrier information is shown in Figure 4(b).
In the second step, the residual phase shown in Figure 4(b) is amplified by multiplying it by a large number K and then calculating the magnified residual carrier frequency using an FFT. Consequently, the residual carrier frequency is further roughly determined by dividing the known number K, and the phase wraps are further reduced by removing this residual carrier information.
It is worth mentioning that when the residual phase is amplified, the frequency of the detected object is amplified simultaneously, which may cause frequency aliasing and exceed the Nyquist sampling frequency. e magnified  Mathematical Problems in Engineering residual carrier frequency may be incorrectly determined. erefore, high frequency information needs to be suppressed. Before the residual phase shown in Figure 4(b) is amplified, a Gauss filter shown in Figure 5(a) is used first. Additionally, the phase information after the phase wraps are initially eliminated is processed using Gauss filtering where σ is set to 25. Figure 5(b) shows the filtered phase shown in Figure 4(b). Following the above analysis, the filtered phase shown in Figure 5(b) is multiplied by a factor of K, where K � 50, and the amplified phase is shown in Figure 6(a). Using an FFT again, the location of the spectral peak of the amplified phase is determined, thereby obtaining the magnified residual carrier frequency. Finally, the magnified residual carrier frequency is divided by K, that is, 50, and the residual carrier frequency with a rational number is obtained. By reducing this residual carrier information from the phase shown in Figure 4, the unwrapped phase shown in Figure 6(b), and its 3D distribution shown in Figure 6(c), the phase wraps that result from the carrier phase are completely eliminated based on our proposed method.
As we can see, although the spectrum can only be shifted by an integer number based on the conventional FFT method, it can be shifted by a rational number, that is, an integer times 1/K, based on our proposed method. eoretically, the larger the value of K, the better. However, the value of K cannot be infinite, and K < N was determined by equation (3). When K is too large, the remaining frequency of the object after Gauss filtering is still very high, and the magnified residual carrier frequency will be mis-determined because of frequency aliasing. To demonstrate this issue, different amplification factors (K) and standard deviations (σ) are selected for a simulation, and the corresponding relationship between K, σ, and residual carrier frequency is obtained, as shown in Table 1.
Because the carrier frequency of the simulation object is 50.32/512 and, in the first step, the carrier frequency calculated from the peak location of the spectrum is 50/512, the residual carrier frequency is 0.32/512. From Table 1, we can see that when the amplification factor is 50, 100, and 250, the residual carrier frequency is 0.320/512; and, if K is equal to 500, the residual carrier frequency is 0.320/512 only when σ is equal to 25. In a practical application, to avoid frequency aliasing, the recommended value is K � 50 and σ � 25. Note that this is not a strict criterion, and a slightly larger or smaller value would not affect the result significantly. Clearly, carrier information still exists because the residual carrier frequency can be only shifted by a rational number that is an integer times 1/50; however, this remaining carrier frequency is very small and can be ignored in most cases.

Experimental Results
To verify the feasibility of the proposed method, we tested a face model with smooth shapes using a fringe projection measurement system. e fringe projection measurement   Mathematical Problems in Engineering 5 system consisted of a computer, DLP projector, and CCD camera, as shown in Figure 7. One of the deformed fringe patterns captured by the CCD camera is shown in Figure 8(a).
In the above simulation analysis, the phase information of the model was calculated using the four-step phase-shifting method; however, this method still had phase errors [17]. To reduce these errors and improve accuracy, the fivestep phase-shifting method was adopted to calculate the phase information of the object in the experiment; the phase-shifted fringe images are given by I i (x, y) � I a (x, y) + M(x, y)cos 2πf 0 x + φ e (x, y) + 2π 5 * (i − 1) , i � 1, 2, 3, 4, and 5, where I a (x, y) is the background intensity, M(x, y) is the modulation of the fringe, and a 2π/5 increment of the phase is introduced between the five fringe patterns. e phase information is given by φ e 1 � tan − 1 I 1 sin(0π/5) + I 2 sin(2π/5) + I 3 sin(4π/5) + I 4 sin(6π/5) + I 5 sin(8π/5) I 1 cos(0π/5) + I 2 cos(2π/5) + I 3 cos(4π/5) + I 4 cos(6π/5) + I 5 cos(8π/5) , (14) and this is shown as a wrapped phase map in Figure 8(b). We first used the conventional FFT frequency shift method to reduce the phase wraps that resulted from the carrier phase. e wrapped phase map shown in Figure 8(b) was Fourier transformed using equations (8) and (9). e resultant phase map was then calculated using equations (10) and (11) and is shown in Figures 9(a) and 9(b). e unwrapped phase image for this case is shown in Figure 9(c). However, the phase wraps that resulted from the carrier phase could not be completely eliminated.
To further improve the calculation accuracy and reduce the error in the process of phase wrap reduction, we used the proposed method to further reduce the residual carrier phase of Figure 9(b). e filtered phase was calculated using  Figure 7: e fringe projection measurement system. equation (12), which is shown in Figure 10(a), and amplified by multiplying it by 50. en, the magnified residual carrier frequency was calculated using an FFT. e inverse Fourier transform was then calculated using equation (10). e phase was extracted using equation (11) and is shown in Figures 10(b) and 10(c). e unwrapped image is shown in Figure 10(d), which shows that the phase wraps that resulted from the carrier phase were completely eliminated.
In order to further test the performance of our proposed method, a USB disk was measured. One of the deformed fringe patterns is shown in Figure 11  Mathematical Problems in Engineering shifting method was adopted to calculate the phase information of the object, and the wrapped phase map is shown in Figure 11(b). Firstly, the conventional FFT frequency shift method was used to reduce the phase wraps that resulted from the carrier phase. e resultant phase map is shown in Figures 11(c) and 11(d), and the phase wraps that resulted from the carrier phase could not be completely eliminated. en, the proposed method was used to further reduce the residual carrier phase. e filtered phase is shown in Figure 11(e), which was multiplied by 50. And, the magnified residual carrier frequency was calculated using an FFT. e wrapped phase that results from the residual carrier components is further reduced by shifting the spectrum, as shown in Figures 11(f) and 11(g). Because the existence of the high order harmonic in the projected fringe affects the initial determination of the initial carrier frequency, it can be seen that the wraps from the residual linear phase in Figure 11(d) are more than those in  Figure 11: (a) One of the deformed fringe patterns, (b) wrapped phase image, (c) resultant phase using the conventional FFT frequency shift method (2D), (d) 3D image of the resultant phase, (e) phase image after removing the high frequency, (f ) resultant phase using the proposed method, and (g) 3D image of the resultant phase. Figure 9(b). However, as shown in Figure 11(g), the linear phase can be basically eliminated based on our proposed method, which further demonstrates the superiority of the proposed method compared with the conventional method.

Conclusion
In this paper, we presented an improved carrier frequencyshifting algorithm based on 2-FFT for phase wrap reduction. By first applying an FFT to the wrapped phase with the carrier, most of the carrier components were removed by spectrum shifting. Because the spectrum can only be shifted by an integer number, residual carrier information remained. By applying a second FFT to the filtered and amplified phases with the residual carrier information, the carrier frequency was further determined, and the wrapped phase that resulted from the carrier was almost eliminated. And, we demonstrated both theoretically and experimentally the reliability of the proposed method and contrasted this method with the conventional FFT method. As a result, the spectrum can be only shifted by an integer number in the conventional FFT method, and the phase wraps resulting from the carrier phase cannot be eliminated entirely, while noninteger frequency shift can be achieved in our proposed method, and the phase wraps resulting from the carrier phase can be significantly eliminated.

Data Availability
e data used to support the findings of the study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.