1 Introduction

In opaque media such as biological tissues, the heterogeneous refractive index distribution causes light scattering, which makes the media appear opaque, preventing us from focusing, imaging, and manipulating light through the media [1, 2]. Hence, the ability to focus light through scattering media could revolutionize bio-photonics by enabling deep-tissue non-invasive fluorescence microscopy, optical tweezing, optogenetics, microsurgery, and phototherapy. Wavefront shaping refocuses light through or inside thick scattering media and has attracted increasing research interest.

Imaging techniques through scattering media can be classified into three categories: the transmission matrix (TM) method [3,4,5,6], optical phase conjugation (OPC) [7,8,9,10,11,12,13], and feedback-based wavefront shaping [14,15,16,17,18,19,20,21,22,23,24,25]. The TM method expressing the quantitative relationship between input and output light fields through scattering media is used to retrieve the object. However, in the TM calibration process, long-term measurement and many calculations are necessary [26]. OPC can focus through or inside dynamic media [27,28,29]. However, its implementation relies on a rather complicated optical system alignment and the phase conjugated beam needs precise alignment projection back from the other side of the media; it also requires complex calculations for phase extraction and phase unwrapping [30]. Feedback-based iterative wavefront shaping allows light focusing at a target position with a simple detection [31, 32]. Iterative algorithms sequentially change the phase delay between 0 and 2π at each SLM pixel and select the phase that leads to the desirable pattern at the MMF distal end. By recording the optimized phase masks for light focusing at each output location and projecting the masks for desired output patterns, phase modulation is implemented by an SLM. We previously proposed an efficient wavefront shaping method using an SLM to rapidly generate a series of focused spots through an MMF [33]. However, the phase optimization speed is limited by the SLM’s switching rate, which operates at a maximum refresh rate of approximately 400 Hz. To increase the focus optimization speed, a digital micromirror device (DMD) was employed for wavefront shaping [34,35,36,37]. Based on this relationship, we further propose a binary amplitude-only modulation parallel coordinate algorithm based on a DMD, analyse the relationship between the system’s input and output light fields, and derive the phase relations between the objective function and the DMD reflectance [38]. However, using a DMD involves two restrictions on wavefront shaping applications: (a) a DMD achieves binary amplitude-only modulation, resulting in a lower focusing contrast than that of phase modulation and (b) aligning a DMD-based system is quite complicated due to its oblique reflection angle.

In this paper, we propose a fast focusing method using binary phase-only patterns to modulate the incident wavefront and demonstrate that it is feasible to focus and scan light through an MMF utilizing the SLM’s phase values of 0 and π. This method has the following advantages for wavefront shaping applications: (a) the number of iterations is equal to the number of modulation modes using binary phase-only modulation based on an SLM. For the same number of modulation modes, the number of iterations necessary to obtain a globally optimal solution using our binary phase-only modulation technique is 1/256 of that using phase-only iterative optimization or 1/3 of that using phase-only computation optimization based on an SLM. (b) The refresh speed of the modulation device can reach 3.2 kHz using binary phase-only modulation based on an SLM, and the system’s modulation time is one to two orders of magnitude higher than that of previous phase-only optimization systems based on an SLM. (c) Compared with a DMD performing binary amplitude modulation, an SLM doubles the peak-to-background ratio (PBR) and simplifies the system’s alignment because SLMs do not have oblique reflection angles such as DMDs.

In this experiment, multiple focused spots are generated at the distal end of an MMF (with a 105 μm core diameter and 5 m length). Using the proposed method, the globally optimal solution of a focused spot requires only 0.8 s, which is approximately 1/94 of the time necessary using full-phase computation. We also demonstrate that the method also be extended to focus and scan light at multiple planes along the axial direction by just modifying the input wavefront. This feature is necessary to obtain the sample’s depth information.

2 Method

2.1 Binary phase-only modulation

Figure 1 shows a comparison of the three wavefront modulation methods. In this case, the input light’s unshaped wavefront and the light field at a targeted location through a scattering medium is a random phasor sum. In full-phase wavefront shaping, the SLM rotates each phasor to align them so that they constructively interfere and focus on the target position. The DMD achieves wavefront shaping by binary amplitude modulation and switches off “bad” phasors that destructively interfere and are formed by the rest of the phasors. In contrast, instead of switching off the “bad” phasors, this method rotates the “bad” phasors by 180°, making them constructively interfere with the other phasors and focus on the target position [13].

Fig. 1
figure 1

Comparison of the three wavefront modulation techniques

The principle of binary phase-only modulation based on an SLM is shown in Fig. 2. According to the mode-division theory, the incident light is a linear superposition of serial orthogonal modes. As shown in Fig. 2a, the incident light is scattered by the MMF and forms a random speckle pattern. The goal is to modulate the incident wavefront so that the scattered light through the MMF can be focused on a specified target area as demonstrated in Fig. 2b. As shown in Fig. 2c, we first divide the SLM into a number of sub-regions (each sub-region corresponds to a mode), then modulate the light mode in sequence by adding 0 or π phases to the corresponding SLM sub-region. Of note, the adding phase is determined based on whether it is able to increase the focusing efficiency within the target area. As a result, using this binary phase-only modulation technique, a focused spot can form at the distal end of an MMF.

Fig. 2
figure 2

Principle of focusing light through an MMF based on the binary phase-only modulation SLM technique. a A plane wave is focused at the proximal end of an MMF, while a random speckle pattern appears at its distal end. b The incident light’s wavefront is shaped so that the scattered light through the MMF focuses on a target area. c The binary phase-only modulation process

A mathematical model of the MMF output light field is established based on the theories of scalar diffraction, optical transmission matrix, and mode division. Each globally optimal solution is obtained by utilising phase modulation values of 0 and π to modulate the incident wavefront phase. The system is assumed to be linear and time-invariant. The incident light can be described as a linear superposition of M orthonormal modes. Each mode corresponds to an SLM sub-region.

$$E_{n} = \sum\limits_{m = 1}^{M} {t_{mn} A_{m} e^{{i\varphi_{m} }} } \, ,$$
(1)

where En represents the electric field at the nth output segment. Am and φm are the amplitude and phase of the mth input segment’s field, respectively. The matrix element tmn is related to the field at the mth input segment to the nth output segment. The observed intensity of the nth output segment with a given input wavefront is defined as:

$$I_{n} = \left| {\sum\limits_{m = 1}^{M} {t_{mn} A_{m} e^{{i\varphi_{m} }} } } \right|^{2} \, .$$
(2)

To determine the phase modulation values (0 or π) of all of the sub-regions in an SLM to obtain a properly focused spot with high focusing efficiency and quantitatively evaluate the focusing quality, the focusing efficiency as an objective indication parameter is defined as F(φm), the ratio of the total light intensity within the focused region to the total light intensity of the MMF output:

$$F(\varphi_{m} ) = \frac{{\sum\nolimits_{{R_{1} }} {I(x,y)} }}{{\sum\nolimits_{{R_{1} + R_{2} }} {I(x,y)} }},$$
(3)

where φm is the phase modulation values of the SLM’s mth sub-region, R1 is the focused region and R2 is the outside of R1 at the distal end of an MMF.

The globally optimal solution can be obtained if the following criterion is adopted in sequence to every SLM sub-region to determine its phase modulation values:

$$\varphi_{m} = \left\{ {\begin{array}{*{20}c} {0{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\text{if}}{\kern 1pt} F(0) \ge F(\pi )} \\ {\pi {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\text{if}}{\kern 1pt} F(0) < F(\pi ).} \\ \end{array} } \right.$$
(4)

Of note, to determine the φm of the mth SLM sub-region, all of the sub-regions’ phase modulation values from 1 to m − 1 are calculated. F(0) is known since these sub-regions based on their determined phase modulation values have already been derived. When adding the phase π to the mth sub-region, F(π) is obtained. Based on Eq. (4), the value of φm can be determined, that is, the phase modulation values of the mth sub-region are finally ascertained.

2.2 Experimental setup

The experimental design to implement high-speed focusing and scanning light through the MMF based on the binary phase modulation SLM is depicted in Fig. 3. The laser source is an He–Ne laser (Thorlabs HNL050R-EC) operating at a 632.8 nm wavelength with linearly polarized light. The output laser expands through the light beam expander (LBE) (Thorlabs GBE20-A-20X) with a 20-fold magnification of the beam size. The expanded beam diameter is ~ 1 inch. The light polarization is controlled in sequence by a half-wave plate (λ/2, 1 inch in diameter) and a polarizer (P1, 1 inch in diameter), which then illuminates the SLM (Meadowlark Optics, P1920-0635-HDMI, 1920 pixels × 1152 pixels, 9.2 μm × 9.2 μm). An achromatic doublet lens L1 (Thorlabs AC254-125-A-ML, f = 125 mm, 1 inch in diameter) is placed one focal length away from the SLM. An iris (I, 1 mm aperture) is placed after the lens in the Fourier plane to block all other diffraction orders except for the first-order diffraction light where the modulation information is encoded. The first-order diffraction light is then propagated through another achromatic L2 doublet lens (Thorlabs AC254-125-A-ML, f = 125 mm, 1 inch in diameter) that images the modulation information at the back aperture of objective lens OBJ1 [10 ×, numerical aperture (NA) = 0.25] that focuses the beam at the proximal end of the MMF (Nufern MM-S105/125-22A, 105 μm core diameter, 5 m length, and 0.21 NA). The MMF output facet is the focused plane that is magnified by objective OBJ2 (20 × , NA = 0.30) and imaged on a CCD (Hamamatsu, C13440-20CU). The CCD is used to record the MMF output facet’s speckle images, which are then used to calculate the compensated phase mask to generate focused spots.

Fig. 3
figure 3

Schematic of the experimental setup. LBE light beam expander, λ/2 half-wave plate, P polarizer, SLM spatial light modulator, L1, L2 achromatic doublet lens, I iris, OBJ1, OBJ2 objective lens, MMF multimode fiber

3 Results and discussion

As an example, the SLM’s 800 × 800 pixel central area is used for modulation. It is divided into 50 × 50 sub-regions (the physical size of each SLM sub-region is 0.147 mm × 0.147 mm) corresponding to 2500 input channels. As previously mentioned, the MMF output images are captured and the value of φm is determined based on Eq. (4). In this case, only 2500 images need to be recorded by CCD for obtaining the mask, which is added to the SLM for yield tightly focused spot at the fiber’s distal end. Figure 4 shows the evolution of the focused spot’s focusing intensity when the SLM sub-regions are determined individually. This proves that the focusing intensity gradually increases as the sub-regions individually add the 0 and π phase values.

Fig. 4
figure 4

Relationship between the focused spot’s intensity and controlled segments

Using this system, we demonstrated that it is also feasible to focus light through an MMF utilising the SLM’s 0 and π phase values. Figure 5a shows the speckle field’s intensity distribution without optimization. Figure 5b presents an example of a focus spot created using the MMF.

Fig. 5
figure 5

a Speckle field without optimization. b Focus spot after optimization

The diameter of focused spot is calculated using the equivalent pixel coefficient, which is defined by the ratio of the MMF’s diameter to the number of pixels occupied by the image (corresponding to the fiber diameter) on the CCD. In this study, the experimentally measured one pixel is equivalent to 0.3143um and the minimum focused spot we obtained occupies 6 pixels. The focused spot’s diameter is the equivalent pixel.

coefficient multiplied by the number of occupied CCD pixels. The ideal diameter of the focused spot generated by our system can be calculated by the radius of airy spot, which is expressed as \(\frac{0.61\lambda }{{{\text{NA}}}}\) = 1.8381 μm and NA = 0.21 is the numerical aperture of the employed MMF.

As shown in Fig. 6, the focused spot’s minimum actual diameter is 1.8858 μm. The experimentally measured diameter is approximately to the theoretical value, that is, the optical imaging system’s limited resolution.

Fig. 6
figure 6

The diameter of the focused spot formed at the MMF’s distal end

As shown in Fig. 7, nine focused spots form at nine completely different locations, which proves that this method can focus and scan light at a plane.

Fig. 7
figure 7

Nine focused spots are generated at nine completely different locations by binary phase-only modulation based on an SLM

As shown in Fig. 8, in addition to focusing and scanning light at a specific plane perpendicular to the axial direction, this method can also be extended to focus and scan light at multiple planes along the axial direction by modifying the input wavefront.

Fig. 8
figure 8

Three focused spots generated at three focused planes along the axial direction by modifying the incident wavefront

The performance parameters of the three wavefront modulation methods are compared as shown in Table 1. Using the method established in this study, 2,500 SLM sub-regions can be modulated, and the process requires only 0.9 s. This method’s modulation time is one to two orders of magnitude shorter than that of the full-phase modulation.

Table 1 Comparison of the three wavefront modulation techniques

4 Conclusion

A high-speed binary phase-only modulation SLM technique was proposed to focus and scan light through an MMF. By modulating the binary phase-only instead of the full-phase incident light wavefront, the phase retrieval requirements decrease. By adding either phase 0 or π to each SLM sub-region, a globally optimal solution to the phase statuses of all of the SLM sub-regions can be obtained to focus and scan light through an MMF. The focused spot’s diameter is 1.8858 μm, close to the optical imaging system’s limited resolution of 1.8381 μm. This also demonstrates that this method can be extended to focus and scan light around the field of view at multiple planes along the axial direction to obtain a sample’s depth information by modifying the input wavefront accordingly. This spot scanning method is applicable for sensing and imaging biological materials and might be suitable for single MMF endoscopic imaging. Because the size of the focused spots is close to the resolution limit and the high-speed SLM’s maximum full-image frame rate can reach 3.2 kHz during binary phase-only modulation, this method can be used for a variety of biomedical sensing and imaging applications, such as living neuron imaging.