Resonant scanning design and control for fast spatial sampling

Two-dimensional, resonant scanners have been utilized in a large variety of imaging modules due to their compact form, low power consumption, large angular range, and high speed. However, resonant scanners have problems with non-optimal and inflexible scanning patterns and inherent phase uncertainty, which limit practical applications. Here we propose methods for optimized design and control of the scanning trajectory of two-dimensional resonant scanners under various physical constraints, including high frame-rate and limited actuation amplitude. First, we propose an analytical design rule for uniform spatial sampling. We demonstrate theoretically and experimentally that by expanding the design space, the proposed designs outperform previous designs in terms of scanning range and fill factor. Second, we show that we can create flexible scanning patterns that allow focusing on user-defined Regions-of-Interest (RoI) by modulation of the scanning parameters. The scanning parameters are found by an optimization algorithm. In simulations, we demonstrate the benefits of these designs with standard metrics and higher-level computer vision tasks (LiDAR odometry and 3D object detection). Finally, we experimentally implement and verify both unmodulated and modulated scanning modes using a two-dimensional, resonant MEMS scanner. Central to the implementations is high bandwidth monitoring of the phase of the angular scans in both dimensions. This task is carried out with a position-sensitive photodetector combined with high-bandwidth electronics, enabling fast spatial sampling at \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sim 100$$\end{document}∼100 Hz frame-rate.

In this work, we demonstrate optimized designs for resonant scanning patterns with frame-rate ∼ 100 Hz and limited actuation amplitudes. We first analyze uniform spatial sampling and introduce two metrics: fillfactor and scanning range. We show a trade-off between these two metrics in previous designs to motivate a better solution. An analytical design rule based on unmodulated scanning patterns (both axes have single-tone scanner motion) is proposed that takes various practical considerations into account, such as high frame-rate, bounded actuation amplitude, scanner phase, and pattern repeating period. The proposed design out-performs previous designs that fail to consider these factors. Furthermore, we consider RoI-focused spatial sampling with resonant scanners. For this purpose, we demonstrate the utility of modulated resonant scanning patterns, which contain multiple frequency components around resonance. We develop a task-driven optimization framework to integrate scanning pattern design with post-processing on sampled 3D data.
To demonstrate the applications of designed resonant scanning patterns, we evaluate them in simulated 3D computer vision tasks including LiDAR odometry and object detection 3,21-23 (section "Simulations"). To experimentally implement the designed patterns, we built a hardware prototype based on a MEMS scanner (section "Experiments"). We developed a control system that stabilizes the scanner phase during operation, which is critical for resonant mechanical systems 8,[24][25][26][27][28] . Compared to previously designed high-accuracy, narrow bandwidth phase control systems, the proposed method is wide-band and thus can operates in both unmodulated and modulated scanning modes.

Scanning Pattern Design
Laser beams reflected from scanners that are resonant in two orthogonal dimensions create "Lissajous patterns" that are described mathematically as follows: where f x , f y are the scanning frequencies, which are assumed to be close to resonant frequencies ( f r x , f r y ). The quantities A x (t) , A y (t) and φ x (t) , φ y (t) are the amplitudes and phases for the two scanning axes. When amplitudes and phases are static, both x(t) and y(t) are single-tone, and we denote the corresponding scanning patterns as unmodulated patterns. When small modulations (or, equivalently, multiple frequency components within resonance bandwidth) are added, we denote the corresponding scanning patterns as modulated patterns.
To make the problem of optimizing the scanning patterns tractable, we make the following assumptions: (1) The amplitude of the actuation signal is bounded to reflect limitations on practical hardware. (2) We define a "frame time" T frame (Note that this "frame time" is different from that used in previous literature 9, 10 , we provide a comparison between these two concepts in Supplementary Information). Data collected within T frame is used for evaluation or post-processing. We show that the bounded actuation amplitude and short frame time introduce a trade-off between two important metrics for spatial coverage: scanning range and fill factor, and motivates a better design rule. For simplicity, we choose T frame = m , m being an integer between 6 and 9 (corresponding to 6 − 9 ms T frame with a 1 kHz resonant scanner). (3) Without loss of generality, we assume resonant frequencies for the two scanning axes to be f r x = r , f r y = 1 . In all the simulations, time is scaled by the scanning cycle in the y-axis and is dimensionless. To model typical MEMS scanners, we set a quality factor Q = 20 . We also limit r ∈ [1,3] . When r gets higher, the resonant scanning system gradually transitions to a raster-scanning system, with one axis scanning much slower than the other. Unmodulated pattern design. We first analyze the spatial coverage of resonant scanning with bounded actuation amplitude. The goal is to achieve uniform spatial sampling in a normalized [−1, 1] × [−1, 1] Fieldof-View (FoV). We use fill-factor and scanning range to characterize the spatial coverage of scanning patterns, following common usage in the literature 15,18 . The fill factor characterizes the spatial coverage within a normalized scanning range. The range is determined by the scanning frequencies f x , f y and the transfer function of the resonant scanner H x (f x ) , H y (f y ) . We quantify the two metrics in Eq. (2): We normalize the transfer function amplitudes to 1. Note that we only consider the amplitudes of the transfer functions because in the proposed control scheme, we directly monitor phase of the scanner motion, instead of the phase of the actuation signals. Without loss of generality, we assume an ideal harmonic oscillator model for the resonant-scanner because the following analysis is only based on the band-pass characteristic, which are common to all resonant scanners. We also ignore cross-talk between x and y-axis motions in this simplified model. More discussions on cross-talk are presented in the discussion section. Similar to previous literature 17,18 , fill-factor is defined through the radius of the largest inscribed circle R max in the sampling pattern, as shown in Fig. 1a. To decouple the two metrics, the scanning pattern is normalized to [−1, 1] × [−1, 1] when calculating R max (See Supplementary Information for details).
With bounded actuation amplitude, there is a fundamental trade-off between fill-factor and scanning range. As an example, we show several scanning patterns with f r x = 1.5 , f r y = 1 , T frame = 7 in Fig. 1a. If we actuate onresonance, the scanning range is at maximum ( = 1.0 ), as shown in pattern P 0 . P 0 repeats in t = 2 with φ x = π/4 , www.nature.com/scientificreports/ φ y = 0 and it samples on exactly the same trajectory multiple times within T frame . This results in a low fill-factor = 1.63 . On the other hand, if actuated off-resonance, with f x = 11/7 , f y = 1 , φ x = π/14 , φ y = 0 , the sampling pattern has high fill-factor = 1.89 (pattern P 1 ). However, off resonance actuation leads to large reduction in scanning range ( = 0.45 ). In the lower part of Fig. 1a, we show another design (pattern P 2 ) with f x = 41/28 , f y = 1 , φ x = φ y = 0 . P 2 has repeating period 14 = 2T frame . In each frame, P 2 has fill-factor 1.88 and scanning range 0.74. The fill-factor is almost the same as that in P 1 and the scanning range ( = 0.74 ) is 1.6× larger. Therefore, with respect to spatial coverage within T frame , we regard P 2 to be a better scanning pattern when compared to P 1 . Previous resonant scanning pattern designs generally consider patterns that repeat in each T frame = m , with f x = k/m , f y = l/m , k, l ∈ Z 15,18 and we denote these "repeating patterns". (Note that the "repeating"/"nonrepeating" pattern definition here is different from the definition used in some previous literature 9, 10 , we provide a comparison between these two concepts in Supplementary Information) However, for a specific f r x , f r y , T frame combination, there might not be a repeating pattern with ( f x , f y ) close enough to resonance. As in the example in Fig. 1a, it can be verified that P 1 is the repeating pattern with ( f x , f y ) closest to resonance, but P 1 still suffers from small scanning range. In this paper, we expand the design space by considering not only repeating patterns, but also patterns with repeating periods longer than T frame , such as P 2 in the above example. We propose an analytical design rule in design rule 1 to maximize the scanning range while still achieve comparable fill-factors to that of repeating patterns (derivations are provided in Supplementary Information). In the design rule, we search over ( f x , f y ) pairs around the resonance frequencies (in a close-to-far order) until we find a pair that falls in one of three "good spatial coverage" cases: Case1, where the scanning pattern repeats in 2T frame time and a criterion in line 4 of design rule 1 is met. Case2, where the scanning pattern repeats every T frame with φ x = φ y = 0 and Case3, where the scanning pattern repeats in T frame time with φ x = φ y . After the frequencies ( f x , f y ) are chosen, we determine the phases ( φ x , φ y ). The three "good spatial coverage" cases and the criterion in line 4 of design rule 1 guarantee that the scanning trajectory does not repeat within T frame . Mathematical proofs for the three "good spatial coverage" cases are provided in Supplementary Information. A very recent paper presented a design rule |f x φ y − f y φ x |m = π/2 to achieve a high fill-factor for repeating patterns 18 , which is similar to the phase selection rule in Case3. However, design rule 1 is more complete and performs better under the physical constraints. Figure 1b,c quantitatively show the dependence of fill-factor and scanning range on different settings r ∈ [1, 3] and T frame ∈ [6,9] . The figures compare the metrics of our proposed designs (blue, solid) and traditional repeating pattern designs 18 (black, dashed), with a fixed actuation amplitude of 1 in all cases. The comparisons show that: (1) In most cases, the proposed designs have the same fill-factor as the repeating patterns, but larger scanning range. (2) When T frame is shorter, and when m has more prime factors, the trade-off is generally less favorable. This is because with f x = k/4m , the greatest common divider (GCD) of k and 4m are usually larger than 4 and do not fall in the three "good spatial coverage" cases in design rule 1. (3) Integer frequency ratios r lead to worse trade-offs between fill-factor and scanning range. More discussions about this special case is provided in the discussion section. Pattern P 0 is the on-resonance actuated pattern, Although it has large scannning range 1.0, fill-factor is low (0.63), as indicated by the radius of its largest inscribed circle. Pattern P 1 uses f x = 11/7 , f y = 1 , φ x = π/14 , φ y = 0 as parameters. The fill-factor is improved to 0.89 but scanning range is reduced to 0.45. Pattern P 2 uses f x = 41/28 , f y = 1 , φ x = 0 , φ y = 0 , derived from design rule 1. It has fill-factor = 0.88 and scanning range = 0.74 . (b,c) Fill-factor/Scanning range with proposed design rule 1 (blue, solid) and repeating-pattern design rule 18  Regions-of-Interest (RoI) focusing. In a LiDAR system, through-put of the 3D sensor is fixed, which makes adaptive spatial sampling beneficial for various applications 20,29,30 . More specifically, given a user-defined RoI, we aim at sampling the RoI as densely as possible in all frames. This type of scanning is particularly challenging for resonant scanners and is beyond the capability of the unmodulated scanning patterns, so we propose to use modulated scanning patterns. Such patterns contain multiple frequency components within the resonance bandwidth. However, due to the higher degrees-of-freedom and the complexity of user-defined RoI, analytical design rules are inadequate, so to design modulated scanning patterns, we develop an optimization-based approach. The framework is task-driven because different imaging tasks have different Regions-of-Interest (RoI) for spatial sampling. We seek to improve, by optimized modulation of the parameters, the operation of the resonant scanner as characterized by Eq. (1). However, this model has continuous input parameters so we simplify the model through a Fourier expansion: where H x and H y are transfer function amplitudes. We ignore the phases of the transfer functions because they are included in the coefficients of the cosine and sine terms. m specifies the frame time T frame . n 1 , n 2 , k 1 , k 2 defines the number of frequency components in optimization. We find that generally, 5 frequency components give very good optimization results, and in most cases, 3 frequency components are enough. L is an integer that controls the spacing of the frequency components. Note that the amplitude constraints in Eq. (3) are equivalent to bounding the root-mean-square ( RMS ) amplitudes of the actuation signals. This is a looser constraint than bounding the absolute actuation amplitude in unmodulated scanning, which can be expressed as n α 2 n + γ 2 n <= 1 , (3), we notice that the scanner motion is linearly determined by the parameter set {α n } , {β s } , {γ n } , {δ s } . Also, due to the band-pass characteristics of the transfer functions H x , H y , only frequency components close enough to resonant frequencies f r x , f r y have significant impact on scanner motion. This allows efficient optimization of the parameter set. We further discretize time in Eq. (3) to get the sampled scanning pattern x ∈ R N , y ∈ R N , where N is the number of sampling points. The resonant frequencies f r x , f r y , frame time T frame and N are chosen as hyper-parameters in the optimization.
The optimization framework is shown in Fig. 2a. First, the parameter set is converted into a sampled scanning pattern x , y . For the specific task (in Fig. 2a, we use 3D object detection as an example), Regions-of-Interest (RoI) are proposed by a fast processing on 2D RGB image, or other heuristic rules and sensing results. The RoI is represented by a weight map W and its values correspond to the importance of each regions in the FoV. With x , y and W , we define the objective function L pattern as: The [−1, 1] × [−1, 1] FoV (normalized by the product of amplitudes with on-resonance actuation) is divided into M × M patches. For each patch (i, j), we get the closest sampling point ( x[n i,j ] , y[n i,j ] ) to its center location ( x i , y j ) and calculate the distance between these two points. W i,j indicates the importance of each patch and is defined as the average weight in patch (i, j). Patches with larger average weights have a higher priority during  The RoI focusing improvement depends on the shape of the specified RoI. With r ∼ 1 , the RoI focusing is more successful for RoI A compared to RoI B, while it is the opposite with r ∼ 2 . (3) With r ∼ 1.3 , the RoI focusing improvement is very limited. The optimization results are only slightly improved compared to the unmodulated scanning patterns. We provide a qualitative explanation for this dependence of RoI focusing improvement on resonant frequency ratio: A modulated scanning pattern "dithers" around a basic unmodulated scanning pattern, as shown in Fig. 2b at the lower-right corner of each modulated pattern. This basic pattern corresponds to one pair of ( f x , f y ) in Eq. (3) (it also needs to be in the resonance bandwidth). If the basic pattern has a short repeating period, it only traverse part of the scanning range. For example, with f x = 1, f y = 1 , the scanning trajectory is a simple ellipse. Shape of the basic pattern is controlled by its amplitudes and phases in x and y-axis motion. When appropriate modulations are added, a small shift exists between the scanning trajectories in different repeating periods, and this leads to a focused sampling in the regions close to the basic pattern. However, if the basic pattern has a long repeating period and covers the scanning range uniformly, the modulated scanning patterns can't be focused onto a certain portion of FoV through optimization. For r ∼ 1 , r ∼ 2 , the repeating period is very short with f x = f y , f x = 2f y . However, for r ∼ 1.3 , there does not exist a ( f x , f y ) pair close enough to resonance while also has a short repeating period (for example, shorter than t = 2).

Simulations
We evaluate the analytical design rule 1 and the proposed optimization framework in simulated 3D environments 2,32 . Because most 3D imaging datasets currently available are acquired with a raster-scanned or a flash LiDAR, we develop a point cloud generation tool that generates a point cloud corresponding to a resonant LiDAR odometry with unmodulated scanning. LiDAR odometry algorithms estimate the trajectory of a moving agent during navigation. They extract feature points from a 3D point cloud acquired in each frame. By comparing the spatial positions of these feature points between successive frames, the position of the agent in a world coordinate can be estimated.
In this work, we consider LiDAR odometry with resonant scanning patterns on the KITTI dataset 2 . We adapt a LiDAR odometry framework, named "LOAM" 3,33 , into the resonant scanning scenario. For comparison, we use the example discussed in Fig. 1a with pattern P 1 as the baseline and pattern P 2 as the designed pattern. As shown in Fig. 3a, Field-of-View (FoV) of P 2 is ∼ 1.6× larger than that of P 1 . This much larger spatial region gives us more feature points to be observed and processed, which leads to more reliable trajectory estimation (for details of the extracted feature points, please refer to Supplementary Information).
3D object detection with moduated scanning. Object detection is another task that is of great interest in 3D computer vision 22,23 . The requirement it imposes on data collection is different from that in odometry. For each scene, important objects (e.g., cars, pedestrians) might concentrate in specific regions in the FoV. Therefore, a denser sampling in these Regions-of-Interest (RoI) is required. As an example, we use hyper-parameters f r x = 1 , f r y = 2 , T frame = 7 and number of sampling points N = 30000 . In Fig. 3c Using more frequency components in this special case won't generate significant improvements. When compared to the sampling pattern designed for uniform sampling (lower row), the RoI-focused pattern samples significantly more points ( ∼ 3× ) in regions that contain important objects (cars in this scene). This will largely facilitate the object detection process 23 . We do not conduct quantitative comparisons on object detection, due to the imperfectness in resonant-scanned point cloud generation. However, because of the positive relationship between sampling density and detection accuracy presented in previous literature 2, 23 , it is reasonable to expect an increase in accuracy when the optimized scanning pattern is used in real-world LiDAR system. Note that in this task we do not follow the f r x = r , f r y = 1 setting. This is because the dataset we experiment on contains only road scenes. Such a scene is more likely to be symmetric in the horizontal direction compared to the vertical direction. For example, cars are more likely to be on the left and right sides of a road, instead of on the up and down sides of a road. As mentioned above, the performance of RoI focusing depends on the RoI shape. When the axis of symmetry of the RoI shape aligns with that of the scanning pattern, performance is improved. Therefore, we make the scanning pattern also symmetric in horizontal direction by choosing f r x = 1.0 , f r y = 2.0 instead of f r x = 2.0 , f r y = 1.0 . Optimization results with f r x = 2.0 , f r y = 1.0 are also presented in Supplementary Information, where the performance is not as good as that in Fig. 3, but still beats the reference unmodulated scanning pattern.

Experiments
We implement the designed scanning patterns (Fig. 4a) using a MEMS scanner 34 with resonant frequencies f r x = 2660 Hz, f r y = 1100 Hz, i.e., a resonant frequency ratio r = 2.42 . The quality factors for the two axis are Q x ∼ 30 and Q y ∼ 50 . Because of the high Q factor and associated low bandwidth, we actuate the y-axis with a single frequency, and restrict modulation to the x-axis. A high-gain amplifier is used to maintain the scanning range when we operate at more than FWHM (Full Width at Half Maximum) away from the resonance. We developed a wide-band phase detection and control system to eliminate the inherent phase uncertainty in MEMS scanners. This uncertainty originates from the environmental sensitivity (e.g. to temperature) of MEMS devices and the strong dependence of the phase on deviations of the resonant frequency [25][26][27][28] . With the control system, we achieve ∼ 1 • phase control accuracy, as shown in Fig. 4b. To measure the accuracy, we detect the scanner phase at beginning of each frame and compare it to the required phase, over 10 minutes of scanner operation. This calibration is conducted with a high-speed oscilloscope not shown in Fig. 4a. The accuracy can be improved with faster MPU or better position detection hardware. Phase stability with and without control are further discussed in the Supplementary Information. Phase control in unmodulated scanning. We first demonstrate unmodulated scanning. During the experiments, the scanning patterns are recorded with a high-speed position sensor (PSD). We choose T frame = 6.4ms , corresponding to T frame = 7 in design rule 1. Scanning patterns with on-resonance actuation ( f x = 2660 Hz, f y = 1100 Hz) and without phase control are shown in Fig. 4c, for two successive frames. Most portions of the FoV are either over-sampled or under-sampled. Using our proposed design rule, the parameters are changed to f x = 2672 Hz, f y = 1100 Hz, φ x = π/14 and φ y = 0 . The corresponding scanning patterns have much higher fill factor as shown in Fig. 4d. Phase control in modulated scanning. To demonstrate modulated scanning, we drive the x-axis at three frequencies f x , 13/14f x , 15/14f x and drive the y-axis at a single frequency f y . Phases of the three components in the x-axis scanning are monitored and controlled at the beginning of every 2 frames (when all three phases repeat). Resonant frequencies and frame time are set to be the same as that in the unmodulated scanning experiment. As discussed above, with r = 2.42 , RoI focusing improvement is limited. Therefore, we go beyond the x-axis resonance bandwidth and select f x actuation frequency components around 2200 Hz while fix f y = 1100 Hz to emulate a MEMS scanner with r = 2.0 . We focus the scanning pattern to RoI B in Fig. 2b for demonstration. Due to the high quality factor in y-axis, the degrees-of-freedom in optimization is reduced by 2× . However, RoI sampling density in modulated scanning pattern still increases by 1.3× compared to the unmodulated scanning pattern, as shown in Fig. 4e. The experimentally acquired modulated sampling pattern is resampled to 500 sampling points per T frame for comparison with the sampling patterns in Fig. 2.

Discussion
It is important to note how performance depends on resonant frequency ratios for unmodulated scanning design rule 1 and modulated scanning. Different ( f x , f y ) pairs generate unmodulated scanning patterns with different repeating periods. For any resonant frequency ratio r, pairs of ( f x , f y ) that correspond to long repeating period always exist in resonance bandwidth 15 . However, a pair of ( f x , f y ) that corresponds to short repeating period might not exist, as in the case of r ∼ 1.3 . Also, a pair of ( f x , f y ) that corresponds to repeating period 1/2T frame , www.nature.com/scientificreports/ T frame or 2T frame do not always exist, as in the case of r ∼ 1 , r ∼ 2 . n the first situation, RoI focusing can't be achieved while in the second situation, uniform spatial sampling is difficult. In the experiments, we noticed that RoI focusing performs efficiently only with r ∼ 1 or r ∼ 2 while these are the worst cases in uniform spatial sampling, as shown in Fig. 1. This result suggests the special usage for resonant scanners with resonance frequency ratio r ∼ 1 , r ∼ 2 in RoI focused sampling. Although the proposed scanning pattern designs outperform the baselines, they have the following limitations. First, both designs are based on a moderate quality factor Q. If the quality factor is too high, neither the frequency selection rule in design rule 1 nor the modulated scanning pattern designs produce good results. Only small deviations from resonance requires large actuation amplitudes, which is inconsistent with our bounded actuation setting. Second, the optimization problem in modulated scanning pattern design is non-convex. Therefore, our approach does not guarantee convergence to a global optimal. We also assume no cross-talk between x and y-axis scanner motions. This is consistent with the negligible cross talk we observe in our MEMS scanners 34 . If scanners with significant cross talk are employed, then the design rule for unmodulated patterns have to be changed to give good results. ROI focusing, on the other hand, does not need substantial changes to work with scanner that have cross talk. It is straightforward to contain the cross-talk in Eq. (3) and use the optimization framework for both uniform and RoI-focused spatial sampling design.

Conclusion
Spatial information acquisition is at the heart of many recent advances in the imaging and display industry. A fast and flexible spatial sampling solution will largely improve the robustness and consumer experience. In this paper, we propose resonant scanning pattern design and control schemes that improve the coverage, flexibility, and accuracy in fast spatial sampling. We propose an analytical design rule for uniform spatial sampling, and an optimization-based framework for flexible, Regions-of-Interest (RoI) focused spatial sampling. We also demonstrate the designed scanning patterns in an experimental prototype that applies wide-band control on scanner motion. The proposed methods enable resonant-scanner LiDAR with a high frame-rate ∼ 100 Hz. When integrated with high-speed point cloud processing algorithms, such systems can be utilized in applications across disciplines, including navigation, robotics, and augmented reality.

Methods
Phase control experimental setup. As shown in Fig. 4a, the MEMS scanner is actuated with signal generators (SIGLENT SDG2000X) controlled by external phase modulation signals. The motion of MEMS is detected with a high-speed position sensor (ON-TRAK OT-301). This motion signal is fed into an analog wideband Hilbert transformer board for 90 degrees phase shift. Both motion signals x(t), y(t) and the 90degrees phase shifted signals x(t) , ȳ(t) are sampled with an MPU chip (PJRC Teensy3.6). In practice, the Hilbert transformer applies a frequency dependent phase shift on both output signals while the relative phase between these two outputs is fixed to be π/2 . We conduct calibrations to remove the phase offset and will ignore it in the following sections. For more details, please refer to Supplementary Information. A fast processing algorithm is performed on the two signals to get the phase and a feed-back signal is generated to the external modulation port of signal generators. Calibrations for each components used in experiment are provided in Supplementary Information. Phase calculation process. Phase calculations are simple for the unmodulated actuation case. After collecting x(t) and x(t) at the beginning of each frame, a fast arctangent calculation 35 is performed to get the phase. The detection process takes ∼ 15 us.
For modulated actuation, phase detection and control is more complicated, because x(t), y(t) and x(t) , ȳ(t) contain multiple frequency components. In this paper, we constrain ourselves to a comparatively simple situation: x axis actuation contains three frequency components and y axis contains only single frequency component. Similar method can be extended to a more general case. We express the scanner motion in the x-axis as: There are three phases φ i x , i = 0, 1, 2 . We detect at both beginning of each frame and at the center of each frame to get six equations: Equation (6) is linear in {α i cos(φ i x ), α i sin(φ i x )}, i = 1, 2, 3 , a fast matrix multiplication is used to solve them. Then we apply the fast arctangent calculation on each (cos, sin) pair separately to get the phases. The whole data acquisition and processing takes ∼ 40 us for three frequency components.