Sampling rate in the dynamic speckle analysis

Dynamic laser speckle and its biological version (biospeckle laser) have been used in many areas of knowledge. Its non-invasive approach allows the application in advantage regarding those that need contact or damage the analyzed sample. However, one needs the sharp adjust of the image acquiring and processing. In this article, we show how the variation of sampling rate in a dynamic speckle analysis affects the value of dynamic speckle indexes concerning the absolute value of the differences index, the temporal speckle standard deviation index, and the temporal speckle mean index. We show that the dynamic speckle index value changes its maximum excursion with the variation of sampling rate, affected directly by the camera's time integration (time of exposure). We highlight the importance of knowing the frequency band of the analyzed phenomenon and its signal to choose the appropriate sampling rate, with the recommendation of using the lowest sampling rate possible—without compromise the speckle grains—to obtain an acceptable maximum excursion and an illumination level with a good signal–noise ratio. The results will help those who work with the phenomenon/technique to enhance their analysis tailoring the set up and yielding reliable results, since the optical method demands a rigorous bias of the image acquiring and processing.


Introduction
Dynamic laser speckle (DLS) has been used in many applications in medicine and agriculture. This non-invasive optical technique, through the temporal variation of the speckle pattern, evaluates the activity of cells, bacteria, and other biological fluids [1][2][3][4].
The influence of the relationship between the size of the speckle and the size of the pixel is an important aspect that must be considered in all these applications. It was verified that the signal obtained by this technique varies in frequency composition regarding the biological activity. Despite considering the well-known Nyquist theorem (sampling frequency) during the assembling of the signal, it is not enough since the configuration of the optical camera with its attached photographic objective and its numerical aperture (f-number) must also be guaranteed according to the frequency response [5].
Another important aspect is the stability of the laser illumination when using laser diodes or a He-Ne laser to ensure that the speckled grains fluctuate only due to biological changes and not because of changes in illumination. The experimental results show that the stability of the diode laser is greater than that of the He-Ne laser in all cases, breaking the paradigm of the stability of He-Ne devices [6].
Thus, it is necessary to analyze the effect of technical parameters that affect the perceived illumination level. In this sense, we studied the effect of sampling rate and, consequently, the time of exposure in a dynamic laser speckle analysis considering the absolute value of the differences index, the temporal speckle standard deviation index, and the temporal speckle mean index [7][8][9].
Knowing the effect of sampling rate over an index value, a researcher will be able to establish criteria to choose the appropriate sampling rate for a specific monitored phenomenon [10][11][12].
For this purpose, we show that, given a dynamic speckle test, there is an appropriate frequency band (frequency range in which all the waves that compose the analyzed signal are contained) to the sampling rate. High sampling rate values may cause unintended consequences on the index value, such as the decrease of the excursion between two activity levels, given a determinate index value and illumination level. In turn, decreasing the sampling rate promoted by increasing the time of exposure will cause a reduction of the temporal speckle contrast and, consequently, limit the possibility of obtaining information from the sample.
To demonstrate the existence of this appropriate frequency band, we performed two types of tests; in the first, we analyzed an ink drying process over time; in the second, we tested the activity state of a corn seed with three days of germination. In both cases, we used four different sampling rates and compared the behavior of speckle indexes.
The next section describes how the speckle images were acquired and the setup used to analyze them. All theoretical definitions necessary to understand the analysis are presented in Sect. 3. The numerical results of the analysis are presented in Sect. 4, and an analysis of the results in Sect. 5. Finally, we present our conclusion in Sect. 6.

Time of exposure of the camera
The sampling rate (F s ) or acquisition time in frames per second (fps), using the camera Marlin F-033, is obtained according to Table 1, where we can see the four sampling frequencies used in the tests.
These values were obtained using the camera parameters: the shutter register value (Shutter), the time base register value (Base), the offset time of exposure (Offset), and the effective time of exposure (E). These registers are numbers in the memory of the camera that in combination help us to configure many values of exposure times. So that, the shutter and base are multiplier, and the offset correspond to the hardware delay in the execution of operations. Thus, the time of exposure (Exposure), where F s is calculated in relation to E, considering that the Exposure represents the photography integration time and E the effective time between photographs, the difference between these two exposures arises from the Offset time, i.e., the time between the end and the beginning of a photograph. In all cases, the time of exposure is much longer than the Offset; therefore, we can approximate that F s ≈ 1/Exposure.

Ink drying process data
The data set came from an ink drying process, where a group of N images of same size is stacked forming, what we call, data package at times {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} min. Thus, at each time, a data package has N = 512 images of 147 pixels of height and 166 pixels of width. Four different sampling rates were used to take the images, using the rates 15, 30, 45, and 60 Hz.

Data package of the corn seed germination
This data package has the speckle pattern of a corn seed with three days of germination, where four data packages with different sampling rates (15,30,45, and 60 Hz) were built. Each package has 512 images of 15 pixels of height and 15 pixels of width. Figure 1 represents the data analysis method in an ink drying process to an F s sampling rate. Where P(t) is a data package with images at t minutes, this package has N images with M pixels each. P n,m (t) defines the n-th image and m-th pixel

Test 1: ink drying process
The MEAN block represents the calculation of the temporal speckle mean index on the package P(t), giving the value The AVD block represents the calculation of the absolute values of the differences index on the package P(t), giving the value AVD(t). The STD block represents the calculation of the temporal speckle standard deviation index on the package P(t) or Q(t), giving the value STD(t) or STDF(t), respectively. And finally, the block HPF represents a digital finite impulse response "high-pass filter" with order 40 and cut-off at 0.25F s , calculated by the P (t) package and return Q(t), leading to the STD block and the STDF(t) index value. According to the information in the data packages, we will have speckle indexes values for each minute for 10 min.

Test 2: Corn seed germination
The speckle activity of a corn seed was analyzed similarly to the ink drying, seen in Sect. 2.4, with the difference that only one data package was considered at time t, equal to three days of germination. Figure 2 represents the frequency band analysis method of data package P, acquired with a sampling rate of F s . This package is the input of many band-pass filter (BPF) blocks, described in Sect. 3.5. These band-pass filter blocks have cut-off frequencies between f 1 (l) and f 2 (l), where l indicates the current band, so that 1 ≤ l ≤ L; with L as the total number of analysis frequency bands. Thus, we obtained the R l package (a filtered version of P). R l was processed by a σ block, where the standard speckle value is calculated for each pixel in the package R l , as described in Sect. 3.3. Finally, an image is obtained, named variable STDB l .

Theoretical definitions
In the following subsections, we use the variable P to define P(t) at any time t; thus, P represents a data collection of images at any time.

MEAN index
The temporal speckle mean index (µ m ) [8] gives the mean value of the illumination level to the m-th pixel in the package P, implemented as presented in Eq. 3, where N is the number of images in the package Finally, the MEAN (t) index is the spatial mean value of all µ m results, as demonstrated in Eq. 4,

AVD index
The Absolute Values of the Differences (AVD m ) [6,7] gives the mean value of the absolute differences in the illumination level of the m-th pixel in the package P, implemented by Eq. 5, Finally, the AVD(t) index is the spatial mean value of all AVD m results, as indicated in Eq. 6,

STD index
The temporal speckle standard deviation index (σ m ) [8] gives the standard deviation value of the illumination level to the m-th pixel in the package P, implemented with Eq. 7, Finally, the STD(t) index is the spatial mean value of all σ m results, as presented in Eq. 8,

HPF block
The high-pass filter (HPF) block was implemented (Fig. 1) with a finite impulse response (FIR) [13] filter of order 40 and cut-off at 0.25F s . The 41 values in the filter are represented with h(i) for all 0 ≤ i ≤ 40, with zero in other cases. Thus, a data package P as input of the HPF block gives us a data package Q as a result, as indicated in Eq. 9,

BPF block
The band-pass filter (BPF) block is implemented (Fig. 2) similarly to the. HPF block, with an FIR filter of order 40 but with a cut-off in f 1 (l) and f 2 (l), representing l, for all 1 ≤ l ≤ L, the l-th band of L bands; each band has F S /2L Hz. The filter is represented with g(i) for all 0 ≤ i ≤ 40, with zero in other cases. Thus, a data package P as input of the BPF block gives us a data package R as a result, as indicated in Eq. 11,

Test 1: ink drying process
This test shows the analysis result of an ink drying process for 10 min, using the sampling rates: 15, 30, 45, and 60 Hz. Figure 3 presents the MEAN (t) index in the test shown in Sect. 2.4 for each time t for the four sampling rates. It can be seen that the value of the index has a monotonous behavior over time. On the other hand, the values in the curves decrease in proportion to the growing sampling rate. Figure 4 shows the analysis result explained in Sect. 2.4 regarding the AVD(t) index. Figure 4a shows the AVD(t) index, in each time t, of four sampling rates, showing a different behavior in time of each sampling rate so that the value of the index in all curves decreases in proportion with the increase in the sampling rate. On the other hand, Fig. 4b shows a normalized version of the AVD(t) index so that the maximum value of curves has a unit value; thus, the maximum excursion of the curve is most significant when the (11) R n,m = N ∑ k=1 P k,m g(n − k + 20).
sampling rate decreases. It is worth noting that this index uses information from a frequency band between F s /4 and F s /2 Hz [7]. Figure 5 presents the STD(t) index in the test presented in Sect. 2.4. Figure 5a shows the behavior of the STD(t) index, in each time t, for four different sampling rates. This index uses information in the entire frequency band (0 until F s /2 Hz), as seen in Sect. 3.3. It shows different behavior in time to each sampling rate so that the value of the index in each time decreases in proportion to the increase in sampling rate. On the other hand, Fig. 5b shows a normalized version of the STD(t) index, with the unit as the maximum value of curves. Therefore, it can be seen that there is a slight difference between the maximum excursions of the curves with different sampling rates. Despite this, it is possible to observe a slight decrease in the maximum excursion in the curve with the increase in the sampling rate, unlike the AVD(t) index. Figure 6 presents the STDF(t) index in the test presented in Sect. 2.4. Figure 6a shows the behavior of the STDF(t) index, in each time t, for four different sampling rates. This index uses filtered information from the data pack so that the frequency band is between F s /4 and F s /2 Hz. It shows monotone decreasing behavior in time, with a different behavior in time to each different sampling rate so that the value of the index at each time decreases in proportion to the increase in sampling rate. In contrast, Fig. 6b shows a normalized version of the STDF(t) index with the unit as the maximum value of the curves. Therefore, there is a considerable difference between the maximum excursion of the curves using the sampling rate, allowing us to observe a rise in the maximum excursion when the sampling rate decrease, like the AVD(t) index.

Test 2: corn seed germination
This test shows the result of the analysis of a corn seed at 3 days of germination. The images were taken using the sampling rates 15, 30, 45, and 60 Hz. Figure 7 shows the MEAN(t) index with the mean value of illumination (from 0 to 255) in the pixels, this value decreases when the sampling rate increases, where the index value reached 20.1% of its value from 15 to 60 Hz. Figure 8 shows the AVD(t), STD(t), and STDF(t) indexes with the same behavior presented by the MEAN index. The decrease in the activity observed is related to the increase of Fs where STD, AVD, and STDF presented decreasing values of 22.2%, 19.3%, and 20.4%, respectively. Table 2 shows the STDB l image in different frequency bands of the corn seed, using four different sampling rates of 15, 30, 45, and 60 Hz, as indicated in the first column.

Test 3: frequency band activity analysis
The other columns show the results of eight frequency bands of package P, represented in the first line of the Table, where l indicates the position of the frequency band in crescent order, relative to its frequency components, with limits assigned at the frequencies of 0, 3.75, 7.5, 11.25, 15, 18.75, 22.5, 26.25, and 30 Hz, so that the frequency band to l = 1 is {0, 3.75} Hz, to l = 2 is {3.75, 7.5} Hz and so on, as can be seen in the second line of Table 2. These frequency bands are subordinated to the rates (sampling frequencies) F s : 15, 30, 45, and 60 Hz, seen in the column 1 ( Table 2). The  The matrices STDB l are represented using a color palette from dark blue (low values) to dark red (high values), linked to the activity values. As shown, the index values decrease with the increase of sampling rate F s . The index values also decrease with the increase of the position of the frequency band between 0 Hz and 3.75, with a sampling rate of 15 Hz, the better analysis case: in the sense of better differentiating places of lower and higher index value. Figures 3 and 7 show a relationship between the profile of the mean index curve and the sampling rate of the data pack. The temporal speckle mean index (Fig. 3) is related to the observed illumination level on the surface of the material [8] and corresponds to the analysis of zero frequency components of the signal. Thus, we can conclude that the level of illumination perceived by the camera decreases with the sampling rate increment. This occurs due to the modification of the time of exposure with the alteration of sampling frequency to commercial cameras so that less lighting is used to take the picture. Consequently, the value of the temporal   [14,15], causes the limitation of the frequency band between 0 and F s /2 Hz. Thus, we have an index, such as the STD(t), that uses information between [0, F s /2] Hz, while other indexes, such as the AVD(t) and STDF(t), that use the information of a half frequency band, between [F s /4, F s /2] Hz. In the comparison between STD(t) vs {STDF(t) and AVD(t)}, we can see how the use of half of a frequency band causes the decrease in the values of the curves but give us considerably good values in the maximum excursion of the curve over time. In contrast, using a complete frequency band in the ink drying process (STD(t) index) returns low values of maximum excursion in the curves over time. The importance of excursion in this test is due to significant differences between the values of two states during the drying process.

Discussion
It is necessary to highlight the importance of choosing the best value of sampling rate F s ; so that the frequency band of a signal contains the frequency components with the information necessary to analyze the data. Therefore, the index values have the greatest figures and a good excursion compared with an inert part of the sample. For example, in Table 2, a corn seed is analyzed, where we can see the significant index values obtained from 0 to 7.5 Hz when F s = 15 Hz.
Thus, at this point, a question is evident: What is the best frequency band? According to the corn seed test, the best range for all frequency bands is the one with the components with the lowest frequencies. However, we must consider that this index extracts information from inner parts of material [8], and this information decreases along with the decrease in a frequency band, given an STD(t) analysis. This is demonstrated when comparing the result in the excursion of STD(t) with components in low frequencies and the excursion of {STDF(t) and AVD(t)} with components in high frequencies. Therefore, we must compromise between the desired quantity of inner information in the sample, the perceived illumination level, and the sampling rate.
Dynamic laser speckle (or biospeckle laser) is a feasible and a reliable alternative to analyze phenomena that produce tiny changes in time. However, that property brings the need to guarantee the ideal adjustment of the experimental configuration of the image acquiring. The sampling rate is one of the features that the users must be alert with, to obtain the best assembling possible of the interferometric patterns in time. The complexity of the signal (images in time) requires more than just collect the images expecting to provide corrections in the step of images processing.

Conclusion
This work compared three dynamic laser speckle indexes, subject to different sampling rate values. We conclude that it is essential to choose an appropriate sampling rate, Table 2 Frequency band analysis recommending the minimal sampling rate possible to obtain an acceptable maximum excursion for indexed, such as the AVD and STDF, and an illumination level in the images with a good signal-noise ratio so that the phenomenon under study can be collected in the chosen analysis frequency band. We showed that the digitization of a speckle signal implies a restriction of the signal's frequency band, and, consequently, this affects the result of a speckle analysis. Additionally, the digital camera user must be aware that the increase in the frame rate (fps) forces commercial cameras to change the perceived illumination level in the camera sensor.