<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Automatic bilateral filtering of digital X-ray rocking curves using histograms⋆</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Serhiy Balovsyak</string-name>
          <email>s.balovsyak@chnu.edu.ua</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ihor Fodchuk</string-name>
          <email>i.fodchuk@chnu.edu.ua</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zhengbing Hu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Inna Iakovlieva</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Serhii Yakovliev</string-name>
          <email>yakovliev.serhii@chnu.edu.ua</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>School of Computer Science, Hubei University of Technology</institution>
          ,
          <addr-line>Wuhan</addr-line>
          ,
          <country country="CN">China</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Yuriy Fedkovych Chernivtsi National University</institution>
          ,
          <addr-line>Kotsiubynsky 2, 58012, Chernivtsi</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The relevance of the bilateral filtering algorithm for digital signal processing, namely, X-ray rocking curves, has been substantiated. The software for removing noise on digital X-ray curves with automatic determination of the bilateral filter parameters has been developed. The digital bilateral filter has been constructed as a combination of two Gaussian filters that perform signal processing in the intensity domain and in the angular domain. A mathematical model has been developed for calculating the noise level on the curve and the standard deviations of the bilateral filter in the intensity domain and in the angular domain, respectively. The high-frequency component of the signal has been extracted by a Laplace filter. The histogram of the high-frequency component has been calculated, and the acceptable interval for noise values on the high-frequency component has been established. The noise level based on the high-frequency component has been calculated taking into account the established acceptable interval. The software for automatic bilateral filtering of X-ray curves has been developed in the Python. The parameters of bilateral filtering have been set taking into account the results of processing 20 experimental X-ray curves of the train dataset. The bilateral filtering of 10 experimental X-ray curves of the test dataset has been performed. It has been shown that the bilateral filtering of X-ray curves allows not only to significantly reduce their noise level, but also to preserve the shape of the useful signal.</p>
      </abstract>
      <kwd-group>
        <kwd>X-ray rocking curves</kwd>
        <kwd>digital signal processing</kwd>
        <kwd>noise level</kwd>
        <kwd>bilateral filtering algorithm</kwd>
        <kwd>digital filter</kwd>
        <kwd>histogram</kwd>
        <kwd>software</kwd>
        <kwd>Python 1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Experimental X-ray rocking curves are widely used to study the structure of various materials, in
particular crystal ones [1]. X-ray curves are one-dimensional signals, the intensity of which depends
on the angle of rotation of the studied sample or the X-ray detector. Analysis of the angular
distribution of such curves allows us to obtain information about the structural perfection of the
studied samples. However, the analysis of X-ray curves is complicated by the presence of significant
noise levels in them, which is especially noticeable in areas of low intensity. Noise distorts the signal
shape, which leads to a decrease in the accuracy of determining the parameters of the studied
samples. Reducing the noise of X-ray curves and increasing their signal-to-noise ratio at the
hardware level is difficult since there are limitations on the power of the primary X-ray beam. In
addition, it is technically extremely difficult to reduce the level of noise that occurs in X-ray
detectors. Even modern X-ray detectors generate a signal with a certain level of noise [2]. Therefore,
the current task is to programmatically reduce the noise level on X-ray curves using digital filtering
methods [3]. However, in the practical implementation of such signal filtering, distortions occur. For
example, common methods of Gaussian [3], median [5] and wavelet [6] filtering lead to blurring of
the peaks of the curves. Smoothing of the shape of X-ray curves is observed both during filtering in
the spatial domain and during filtering in the frequency domain using the Fourier transforms [7-9].
Compared to Gaussian filtering, wavelet filters lead to less smoothing of peaks, but there is a need
to choose the wavelet family and order, method of correcting the wavelet coefficients [10, 11].</p>
      <p>According to the criterion of preserving the waveform, one of the most effective is the bilateral
filtering algorithm, which processes the signal simultaneously in the spatial (angular) domain and in
the intensity domain [12-14]. By taking into account the difference in intensity for different points
of the curve, the bilateral filtering algorithm allows to significantly remove noise with minor
distortions of the useful signal. However, a certain complexity of the application of bilateral filtering
lies in the selection of filter parameters in the spatial domain and in the intensity domain. The
selection of such parameters in manual mode is subjective and time-consuming. Therefore, in this
work it has been proposed to determine the parameters of the bilateral filter automatically taking
into account the noise level on the X-ray curve. To determine the noise level, the high-frequency
component of the signal is calculated by the Laplace filter, and the histogram of the obtained
highfrequency component is analyzed. Automatic bilateral filtering allows processing of series of curves
obtained on a multi-crystal triaxial X-ray diffractometer with high accuracy and speed [2].</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related works</title>
      <p>The analysis of X-ray rocking curves is described in the work [1], where the dependence of the shape
of the curves on the defects of the studied metal alloys is analyzed. It is shown that based on the
parameters of the shape of the curves, in particular, the half-width (the width of the peak at
halfheight), it is possible to diagnose the mechanical and other properties of the studied materials. In the
work [15], the defective structure of CdTe crystals is investigated by analyzing X-ray rocking curves.
Such studies are important since the structural perfection of the crystals significantly affects the
quality of the detectors made on their basis [16]. In the considered works [14-16], the experimental
X-ray curves contained a certain level of noise, which limits the accuracy of their analysis.</p>
      <p>Signal processing using bilateral filtering is described in the works [17-19]. The possibilities of
bilateral filtering are considered in the work [17] using the example of medical image processing. As
a result of such filtering, the signal-to-noise ratio on the studied images has been increased. However,
bilateral filtering tools can be used to process not only images, but also one-dimensional X-ray
curves. Bilateral filtering using the Fourier transform is described in the work [18]. The possibilities
of bilateral filtering in image processing are also considered in the works [19, 20]. Analysis of the
considered works [14, 17, 20] shows that bilateral filtering provides a reduction in the noise level
with minor signal distortions. At the same time, there is a problem of choosing the parameters of the
bilateral filter.</p>
      <p>A promising direction of noise filtering on signals is the use of artificial neural networks (ANN).
In the work [21], the possibilities of ANN in filtering noise on speech and biomedical signals are
considered. Signal filtering is performed by various types of ANN, in particular, autoencoders [22],
convolutional neural networks and recurrent neural networks [23]. Despite their effectiveness, ANN
require special training before application. In addition, the output signals of ANN with a high
probability may contain artifacts.</p>
      <p>Thus, the analysis of the considered publications confirms the relevance of bilateral filtering and
the need for software development for automatic bilateral filtering of X-ray curves.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Proposed mathematical model of bilateral filtering of X-ray curves</title>
      <p>Digital X-ray curves Ih(ω) describe the dependence of the intensity of the curve Ih on the rotation
angle ω, with the values of Ih and ω given at Q points. Such curves are processed programmatically
as arrays Ih = Ih(i) and ω = ω(i), where i = 0, ..., Q-1; Ih(i) is the intensity of the curve at point number
i; ω(i) is the angular value of point number i.
size Mw elements according to the formula</p>
      <p>Bilateral filtering [14] consists in convolution of the initial curve Ih with the filter kernel wB of</p>
      <p>
        = 3 ∙   ,
  = (
        <xref ref-type="bibr" rid="ref2">−1, 2, −1</xref>
        ).
      </p>
      <p>ℎ =  ℎ ∗   .</p>
      <p>The kernel wB of the bilateral filter is described by the formula
  ( ) = exp
−( −   )</p>
      <p>2
2  2
∙ exp
−( ℎ( ) −   )</p>
      <p>2
2  2
where m = 0,..., Mw-1; m is the kernel element number; Mw is the size of the filter kernel; σBS is the
standard deviation (SD) of the bilateral filter kernel in the spatial (angular) domain; σBI is the standard
deviation of the bilateral filter kernel in the intensity domain; mc is the element number for the center
of the filter kernel; Ih(m) is the intensity of the curve point corresponding to the kernel element with
number m; IC is the intensity of the curve point corresponding to the center of the kernel.</p>
      <p>Thus, the bilateral filter is a combination of two Gaussian filters: one filter performs processing
in the spatial domain (with SD σBS), and the other performs processing in the intensity domain (with
SD σBI). The bilateral noise filtering method allows to preserve the clarity of the curve peaks, since
this method uses spatially weighted averaging of the curve intensity. That is, in the peak region, the
smoothing will be less and the peak shape will be preserved, and in the region with a smooth change
in brightness, the noise smoothing will be stronger.</p>
      <p>The size Mw of the filter kernel wB is calculated taking into account the 3σ rule for a
onedimensional Gaussian distribution. Similarly, the SD σBI of the kernel in the intensity domain is
calculated according to the 3σ rule:</p>
      <p>−1
 =0
 ℎ ( ) =</p>
      <p>ℎ( −  +   ) ∙   ( ),
where IhB is the curve after filtering (of the same size as Ih); Mw is the size of the filter kernel; mc
is the element number for the center of the filter kernel.</p>
      <p>The operation of convolution of the signal Ih with the kernel wB is simply written as
where σN is the noise level on the X-ray curve.</p>
      <p>Since on the experimental X-ray curves are dominated the Gaussian noise [15, 24], as the noise
level σN its standard deviation is used.</p>
      <p>The high-frequency component IhNC is extracted by convolution of the initial curve Ih with the
kernel of the high-frequency Laplace filter wL [24], which is described by the formula:</p>
      <p>For the obtained high-frequency component IhNC, its histogram hN is constructed, defined by Qh
for intervals (bins) (Figure 1).</p>
      <p>
        In order to simplify the analysis of the histogram and to reduce its random deviations, the
convolution of the initial histogram hN with the kernel of the Gaussian filter (with SD σHG; for
example, σHG =1) is performed, as a result of which the smoothed histogram hNF is calculated. In the
resulting histogram, the central peak mainly corresponds to noise (minor deviations from the
average value), and the other (peripheral) parts of the histogram correspond to the high-frequency
component of the useful signal (significant deviations from the average value).
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        )
      </p>
      <p>The central peak of the histogram is extracted using the threshold Th_hNF; the peak includes the
histogram elements whose values exceed Th_hNF. The threshold Th_hNF value is calculated using
the empirical formula:</p>
      <p>
        ℎ_ℎ = ℎ _ ∙   ℎ, (
        <xref ref-type="bibr" rid="ref6">6</xref>
        )
where hNF_max is the maximum value of the hNF histogram;
kTh is the threshold coefficient for extracting the histogram peak (for example, kTh = 0.25).
      </p>
      <p>The left boundary Ih_nbL of the histogram peak is defined as the smallest IhNC value that exceeds
the threshold Th_hNF. The right boundary Ih_nbR of the hNF histogram peak is defined as the largest
IhNC value that exceeds the threshold Th_hNF. For the histogram peak (in the range from Ih_nbL to
Ih_nbR), its SD σH0 is calculated.</p>
      <p>Taking into account the convolution of the initial histogram hN with the Gaussian filter kernel
(with SD σHG), the exact value of SD σH of the histogram peak is calculated by the formula:</p>
      <p>
        After that, the Gaussian distribution hNG (with SD σH) is calculated, which describes the central
peak of the histogram (Figure 1). The noise level σN is calculated based on such values of the
highfrequency component IhNC that correspond mainly to noise (and not to sharp changes in the useful
signal) and are in the interval (ThIh_min, ThIh_max). The limits of the interval are calculated by
empirical formulas:
(
        <xref ref-type="bibr" rid="ref7">7</xref>
        )
(
        <xref ref-type="bibr" rid="ref8">8</xref>
        )
(
        <xref ref-type="bibr" rid="ref9">9</xref>
        )
where kσ = 2.
      </p>
      <p>The value of the coefficient kσ = 2 is chosen from the condition that in the interval (ThIh_min,
ThIh_max) the values of the histogram hNF are close to the normal distribution hNG (since Gaussian
noise on the X-ray curve is analyzed). With a narrower interval (ThIh_min, ThIh_max), part of the
noise values will not be taken into account, and with a wider interval, the values of the useful signal
in IhNC will be taken into account.</p>
      <p>
        The obtained value of the noise level σN is used to calculate the SD σBI of the bilateral filter kernel
in the intensity domain according to formula (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ).
      </p>
      <p>The value SD σBS of the bilateral filter kernel in the spatial (angular) domain is determined based
on the given value of the coefficient kN of the noise level reduction as a result of filtering. The
coefficient kN = σNC/ σN is calculated as the ratio of the noise SD σNC after filtering to the SD σN of
  =   20 −   2 .
 ℎ ℎ
 ℎ ℎ
= −  ∙   ,</p>
      <p>=   ∙   ,
the noise before filtering. If the noise level on the signal Ih is equal to σN, then after smoothing the
signal with the kernel wG of the Gaussian filter with the SD σBS, the noise level σNC after filtering is
equal to [24]:
where Mw = (2[3∙σBS]+1) is the number of elements of the filter kernel.</p>
      <p>From formula (10), the value of the coefficient kN is equal to:</p>
      <p>=  
  =</p>
      <p>−1
 =0</p>
      <p>2( ),</p>
      <p>−1
 =0</p>
      <p>2( ) .</p>
      <p>According to formula (11), for SD σBS = 3 (the number of elements is used as the unit of
measurement) there is the value kN = 0.307094; for σBS = 5 there is the value kN = 0.237978. The value
of σBS is chosen so that the coefficient kN does not exceed the threshold value (according to the
filtering conditions of a certain type of signal).</p>
    </sec>
    <sec id="sec-4">
      <title>4. Software implementation of bilateral filtering</title>
      <p>The software for bilateral filtering of X-ray curves is implemented in Python [25] based on the
developed mathematical model (section 2). Bilateral filtering of X-ray curves Ih(ω) involves the
following stages:</p>
      <p>Reading the initial curve Ih(ω) from a text file.</p>
      <p>
        Calculating the high-frequency component of the signal IhNC by convolving the initial curve
Ih with the Laplace filter kernel wL (
        <xref ref-type="bibr" rid="ref5">5</xref>
        ).
function of the numpy library.
      </p>
      <p>Calculating the histogram hN for the high-frequency component IhNC using the «histogram»
Calculating the smoothed histogram hNF by convolving the initial histogram hN with the
Gaussian filter kernel (with SD σHG) using the «gaussian_filter1d» function of the scipy
(10)
(11)</p>
      <p>Using the developed program, bilateral filtering of 20 X-ray curves of the training dataset is
performed. During the processing of such curves, processing parameters are determined that provide
the required reduction in the noise level (according to the value of the coefficient kN from the formula
(11)) while maintaining the clarity of the peaks. As a result, the following values of the program
parameters are set:</p>
      <p>library.</p>
      <p>
        (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ).
5. Selection of the central peak of the histogram based on the threshold Th_hNF (
        <xref ref-type="bibr" rid="ref6">6</xref>
        ), calculation
of its left Ih_nbL and right Ih_nbR boundaries, calculation of the SD σH of the histogram peak
Calculation of the noise level σN based on the values of the high-frequency component IhNC,
which are in the permissible interval (ThIh_min, ThIh_max) (
        <xref ref-type="bibr" rid="ref8 ref9">8, 9</xref>
        ).
      </p>
      <p>
        Calculation of the SD σBI of the kernel in the intensity domain through the SD of the noise
σN according to the formula (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ).
      </p>
      <p>Determination of the SD σBS of the kernel in the spatial (angular) domain, provided that the
permissible value of the noise level reduction coefficient kN (11).</p>
      <p>
        Calculation for each point of the X-ray curve (with number i) of the bilateral filter kernel wB
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        ), performing bilateral filtering by convolution of the intensities of the curve points Ih(ω)
and the kernel wB according to the formula (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ).
10. Visualization of the calculated curve IhB(ω) after bilateral filtering using the matplotlib library
and saving the curve to a file.
•
•
•
      </p>
      <p>SD σHG = 1 (SD of the Gaussian filter kernel, which is used to smooth the histogram hN).
kTh = 0.25 (threshold coefficient for histogram peak extraction, which is determined by the
minimum of the mean square difference between the histogram hNF and the Gaussian
distribution hNG in the interval from Ih_nbL to Ih_nbR).</p>
      <p>SD σBS = 5 (SD σBS of the bilateral filter kernel in the spatial (angular) domain).</p>
    </sec>
    <sec id="sec-5">
      <title>5. Results of bilateral filtering of X-ray curves by the developed software</title>
      <sec id="sec-5-1">
        <title>5.1. Results of bilateral filtering of experimental X-ray curve # 1</title>
        <p>Let us consider an example of bilateral filtering of experimental X-ray curve Ih(ω) # 1 (Figure 2),
which belongs to the training dataset of curves. The intensity of the curve is given in Q points. When
visualizing such curves, it is especially effective to use a logarithmic scale for the intensity of the
curve, since in this case not only peaks are well visualized, but also signal values for low intensities
(the so-called 'tails' of the curves) (Figure 2a), which contain important information about the objects
under study.</p>
        <p>Next, based on the initial X-ray curve Ih(ω), the value of the high-frequency component IhNC(ω) is
calculated (Figure 3). In order to improve the visualization of noise (to which small values of IhNC
correspond), the graph shows only the values of IhNC that are within the permissible range (for
example, from -100 to 100 in conventional units).</p>
        <p>Based on the high-frequency component of the signal IhNC, its histogram hN is calculated, and by
convolving the initial histogram hN with the kernel of the Gaussian filter (with SD σHG), a smoothed
histogram hNF is calculated (Figure 4).</p>
        <p>Taking into account the threshold Th_hNF, the left Ih_nbL and right Ih_nbR boundaries for the
central peak of the histogram are calculated, and the SD σH of the histogram peak is also calculated.
The resulting normal distribution hNG (with SD σH) quite accurately describes the peak of the
histogram, which corresponds to Gaussian noise.</p>
        <p>Taking into account the SD σH of the histogram peak, the values of the permissible interval
(ThIh_min, ThIh_max) for the values of the high-frequency component IhNC are calculated (Figure 5).
The noise level σN is calculated based on the values of the high-frequency component IhNC, which are
in the permissible interval.</p>
        <p>Taking into account the calculated noise SD σN, the SD σBI of the bilateral filter kernel in the
intensity domain was calculated and value of the SD σBS = 5 was determined for the kernel in the
spatial (angular) domain. The SD σBS of the bilateral filter kernel is chosen so that the noise level in
areas with a smooth change in intensity (without peaks) is reduced by kN=0.24 times. After this,
bilateral filtering of the initial curve Ih(ω) is performed. On the obtained curve IhB(ω) after bilateral
filtering, a significant reduction in the noise level is observed while maintaining the clarity of all
peaks (Figure 6). The reduction in the noise level on the IhB(ω) curve compared to the initial curve is
particularly noticeable (Figure 7).</p>
        <p>The filtered curve IhB(ω) contains mainly the useful signal, which simplifies and increases the
accuracy of its subsequent analysis. For example, the angular intensity distribution is visually better
perceived on the filtered curve IhB(ω) compared to the initial Ih(ω). Software processing of the curves
IhB(ω) allows to accurately determine the coordinates of the peaks, their half-widths (width at half
height), the slopes of the angular intensity distributions for local areas and other parameters that
carry important diagnostic information about the structural perfection of the studied materials.
a)
b)</p>
      </sec>
      <sec id="sec-5-2">
        <title>5.2. Results of bilateral filtering of experimental X-ray curve # 2</title>
        <p>An example of bilateral filtering of the experimental X-ray curve Ih(ω) # 2 (Figure 8), which belongs
to the test dataset of curves, shall be considered. Based on the initial X-ray curve Ih(ω), the value of
the high-frequency component IhNC(ω) and its histogram hN are calculated. By convolving the initial
histogram hN with the Gaussian filter kernel (with SD σHG), the smoothed histogram hNF is calculated
(Figure 9). The left Ih_nbL and right Ih_nbR boundaries for the central peak of the histogram are
calculated, and the SD σH of the histogram peak is also calculated. The obtained normal distribution
hNG (with SD σH) describes the peak of the histogram quite accurately, which confirms the
correctness of the selected values of SD σHG and the threshold coefficient kTh (established based on
the analysis of the X-ray curves of the training sample).</p>
        <p>Using the SD σH of the histogram peak, the values of the permissible interval (ThIh_min,
ThIh_max) for the values of the high-frequency component IhNC are calculated (Figure 10). As can be
seen in Figure 10, the IhNC values in the left and right parts are limited by the interval (ThIh_min,
ThIh_max). This means that the interval (ThIh_min, ThIh_max) correctly limits the noise value on
the IhNC graph, since it is in the left and right parts of the curve that the noise level is significant
compared to the level of the useful signal. The noise level σN is calculated based on the IhNC values
that are in the permissible interval.</p>
        <p>Based on the obtained noise SD σN, the SD σBI of the bilateral filter kernel in the intensity domain
was calculated, and value of the SD σBS =5 was determined for the kernel in the spatial (angular)
domain. Bilateral filtering of the initial curve Ih(ω) is performed. On the obtained curve IhB(ω) after
bilateral filtering, a significant smoothing of noise is observed while maintaining the clarity of the
peaks, which is especially noticeable in comparison with the initial curve (Figure 11). The curve IhB(ω)
after bilateral filtering contains mainly a useful signal, which allows for a more accurate analysis of
its shape and the detection of patterns in the angular intensity distribution. In particular, on the
filtered curve IhB(ω) a local maximum for the angle ω = 9.42° is clearly observed, which is barely
noticeable on the initial curve. Accurate determination of angular coordinates for the peaks of X-ray
curves allows, in particular, to determine with high accuracy lattice deformations and changes in
interplanar distances for the crystals under study.</p>
        <p>Bilateral filtering of 10 experimental X-ray curves of the test dataset is performed, and in all cases
similar results are obtained: a significant reduction in their noise level while preserving the shape of
the useful signal.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusion</title>
      <p>Software has been developed for noise removal on digital X-ray curves Ih(ω) using a bilateral filter
whose parameters are determined automatically. The digital bilateral filter has been constructed as
a combination of two Gaussian filters that perform signal processing in the intensity domain and in
the spatial (angular) domain. A mathematical model has been developed for calculating the noise
level σN on the initial X-ray curve and the parameters of the bilateral filter. The following filter
parameters were used: the standard deviation σBI of the filter kernel in the intensity domain and
standard deviation σBS in the angular domain. The high-frequency component IhNC of the X-ray curve
has been extracted by a Laplace filter. The histogram hNF of the high-frequency component has been
calculated, and permissible interval (ThIh_min, ThIh_max) for noise values on the high-frequency
component has been set. The noise level σN has been calculated based on the high-frequency
component IhNC, taking into account the established permissible interval.</p>
      <p>The software for automatic bilateral filtering of X-ray curves has been developed in the Python
language. The parameters of bilateral filtering have been set taking into account the results of
processing 20 experimental X-ray curves of the training dataset. The value σHG =1 has been set for
the SD of the Gaussian filter kernel, which is used to smooth the initial histogram. The value kTh =
0.25 has been set for the threshold coefficient of the histogram peak selection. The SD σBS of the
bilateral filter kernel has been chosen so that the noise level in areas with a smooth change in
intensity (without peaks) is reduced by kN=0.24 times.</p>
      <p>Bilateral filtering of 10 experimental X-ray curves of the test dataset has been performed. It has
been shown that bilateral filtering of X-ray curves allows not only to significantly reduce their noise
level, but also to preserve the shape of the useful signal.</p>
    </sec>
    <sec id="sec-7">
      <title>Declaration on Generative AI</title>
      <p>
        The author(s) have not employed any Generative AI tools.
[10] J. Isabona, A.L. Imoize, S. Ojo, Image Denoising based on Enhanced Wavelet Global
Thresholding Using Intelligent Signal Processing Algorithm, International Journal of Image,
Graphics and Signal Processing (IJIGSP) 15 (
        <xref ref-type="bibr" rid="ref5">5</xref>
        ) (2023) 1-16. doi: 10.5815/ijigsp.2023.05.01.
[11] S.E. Olukanni, J. Isabona, I. Odesanya, Enhancing Lte Rss for a Robust Path Loss Analysis with
Noise Removal, International Journal of Image, Graphics and Signal Processing (IJIGSP) 15 (
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
(2023) 60-68. doi: 10.5815/ijigsp.2023.03.05.
[12] Y. Zhang, Adaptive block level bilateral filtering algorithm, Applied and Computational
      </p>
      <p>
        Engineering 17 (2023) 77-85. doi: 10.54254/2755-2721/17/20230917.
[13] F. Spagnolo, P. Corsonello, F. Frustaci, S. Perrim, Approximate bilateral filters for real-time and
low-energy imaging applications on FPGAs, The Journal of Supercomputing 80 (2024) 15894–
15916. doi: 10.1007/s11227-024-06084-y.
[14] S. Balovsyak, M. Borcha, M. Gregus ml., Kh. Odaiska, N. Serpak, Automatic Processing of
Digital X-ray Medical Images by Bilateral Filtration Method, in: Proceedings of the 2nd
International Workshop on Intelligent Information Technologies and Systems of Information
Security (IntelITSIS 2021), March 24-26, 2021, ceur-ws.org, Khmelnytskyi, Ukraine, 2021, pp.
280-294.
[15] I.M. Fodchuk, A.R. Kuzmin, I.I. Hutsuliak, M.D. Borcha, V.O. Kotsyubynsky, Defect structure of
high-resistance CdTe:Cl single crystals and MoOx/CdTe:Cl/MoOx heterostructures according
to the data of high-resolution X-ray diffractometry, Semiconductor Physics, Quantum
Electronics and Optoelectronics 26(
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) (2023) 415-423. doi: 10.15407/spqeo26.04.415.
[16] G. Yang, G. Park, Deformation of single crystals, polycrystalline materials, and thin films: A
review, Materials 12 (12) (2019). doi: 10.3390/ma12122003.
[17] V. Anoop, P. R. Bipin, Medical Image Enhancement by a Bilateral Filter Using Optimization
      </p>
      <p>
        Technique, Journal of Medical Systems 43/ 240 (2019) 1-12. doi: 10.1007/s10916-019-1370-x.
[18] Y. Sumiya, N. Fukushima, K. Sugimoto, S.-i. Kamata, Extending Compressive Bilateral Filtering
For Arbitrary Range Kernel, in: IEEE International Conference on Image Processing (ICIP), Abu
Dhabi, United Arab Emirates, 2020, pp. 1018-1022, doi: 10.1109/ICIP40778.2020.9191123.
[19] X.-Y. Jia, C.-L. DongYe, Seismic section image detail enhancement method based on bilateral
texture filtering and adaptive enhancement of texture details, Nonlin. Processes Geophys. 27
(2020) 253–260. doi: 10.5194/npg-27-253-2020.
[20] G. Liu, The Novel Bilateral Quadratic Interpolation Image Super-resolution Algorithm,
International Journal of Image, Graphics and Signal Processing (IJIGSP) 13 (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) (2021) 55-61. doi:
10.5815/ijigsp.2021.03.05.
[21] H. Ferdous, S. Jahan, F. Tabassum, Md.I. Islam, The Performance Analysis of Digital Filters and
ANN in De-noising of Speech and Biomedical Signal, International Journal of Image, Graphics
and Signal Processing (IJIGSP) 15 (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) (2023) 63-78. doi: 10.5815/ijigsp.2023.01.06.
[22] F. Franco. Signal Noise Removal Autoencoder with Keras, 2024. URL:
https://medium.com/codex/signal-noise-removal-autoencoder-with-keras-3dda589f8b24.
[23] T. Hovorushchenko, V. Alekseiko, V. Shvaiko, J. Ilchyshyna, A. Kuzmin, Information system for
earth’s surface temperature forecasting using machine learning technologies, Computer
Systems and Information Technologies 4 (2024) 51–58. doi: 10.31891/csit-2024-4-7.
[24] S.V. Balovsyak, Kh. S. Odaiska, Automatic Determination of the Gaussian Noise Level on Digital
Images by High-Pass Filtering for Regions of Interest, Cybernetics and Systems Analysis 54 (
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
(2018) 662-670. doi: 10.1007/s10559-018-0067-3.
[25] G. Guillen, Digital Image Processing with Python and OpenCV, in: Sensor Projects with
Raspberry Pi. Maker Innovations Series, Apress, Berkeley, CA, 2024, pp.105–147. doi:
10.1007/979-8-8688-0464-9_5.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>K.G.V.</given-names>
            <surname>Siva</surname>
          </string-name>
          <string-name>
            <surname>Kumar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Oruganti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Chatterjee</surname>
          </string-name>
          ,
          <article-title>X-Ray Rocking Curve Measurements of Dislocation Density and Creep Strain Evolution in Gamma Prime-Strengthened Ni-Base Superalloys, Metall Mater</article-title>
          .
          <source>Trans. A</source>
          <volume>50</volume>
          (
          <year>2019</year>
          )
          <fpage>191</fpage>
          -
          <lpage>198</lpage>
          . doi:
          <volume>10</volume>
          .1007/s11661-018-4971-y.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>SmartLab</given-names>
            <surname>SE. Multipurpose</surname>
          </string-name>
          X
          <article-title>-ray Diffraction System with Built-In Intelligent Guidance</article-title>
          ,
          <year>2024</year>
          . URL: https://rigaku.com/products/x-ray
          <article-title>-diffraction-and-scattering/xrd/smartlab-se</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>S.</given-names>
            <surname>Palani</surname>
          </string-name>
          ,
          <source>Principles of Digital Signal Processing</source>
          , Springer Cham.,
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>L.</given-names>
            <surname>Chyrun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Vysotska</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Tchynetskyi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Ushenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Uhryn</surname>
          </string-name>
          ,
          <article-title>Information Technology for Sound Analysis and Recognition in the Metropolis based on Machine Learning Methods</article-title>
          ,
          <source>International Journal of Intelligent Systems and Applications (IJISA) 16 (6)</source>
          (
          <year>2024</year>
          )
          <fpage>40</fpage>
          -
          <lpage>72</lpage>
          . doi:
          <volume>10</volume>
          .5815/ijisa.
          <year>2024</year>
          .
          <volume>06</volume>
          .03.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>R.A.</given-names>
            <surname>Abtan</surname>
          </string-name>
          ,
          <article-title>Image Enhancement using Adaptive Median Filter</article-title>
          ,
          <source>International Journal of Scientific Research in Science, Engineering and Technology (IJSRSET) 10 (4)</source>
          (
          <year>2023</year>
          )
          <fpage>236</fpage>
          -
          <lpage>243</lpage>
          . doi:
          <volume>10</volume>
          .32628/IJSRSET23102118.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>P.G.</given-names>
            <surname>Malghan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.K.</given-names>
            <surname>Hota</surname>
          </string-name>
          ,
          <article-title>50Hz Power Line Interference Removal from an Electrocardiogram Signal Using a VME-DWT-Based Frequency Extraction</article-title>
          and
          <string-name>
            <given-names>Filtering</given-names>
            <surname>Approach</surname>
          </string-name>
          ,
          <source>International Journal of Image, Graphics and Signal Processing (IJIGSP) 16 (4)</source>
          (
          <year>2024</year>
          )
          <fpage>56</fpage>
          -
          <lpage>73</lpage>
          . doi:
          <volume>10</volume>
          .5815/ijigsp.
          <year>2024</year>
          .
          <volume>04</volume>
          .05.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.K.</given-names>
            <surname>Bansal</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          <article-title>Study on the Fast Fourier Transform Applications</article-title>
          ,
          <source>Asian Journal of Basic Science &amp; Research</source>
          <volume>5</volume>
          (
          <issue>2</issue>
          ) 2023
          <fpage>29</fpage>
          -
          <lpage>39</lpage>
          . doi:
          <volume>10</volume>
          .38177/AJBSR.
          <year>2023</year>
          .
          <volume>5203</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>B.</given-names>
            <surname>Tang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Ding</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Peng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Cao</surname>
          </string-name>
          ,
          <article-title>Target localization algorithm based on improved short-time Fourier transform</article-title>
          ,
          <source>Digital Signal Processing</source>
          <volume>155</volume>
          (
          <year>2024</year>
          )
          <article-title>104734</article-title>
          . doi:
          <volume>10</volume>
          .1016/j.dsp.
          <year>2024</year>
          .
          <volume>104734</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>E.</given-names>
            <surname>Rajaby</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.M.</given-names>
            <surname>Sayedi</surname>
          </string-name>
          ,
          <article-title>A structured review of sparse fast Fourier transform algorithms</article-title>
          ,
          <source>Digital Signal Processing</source>
          <volume>123</volume>
          (
          <year>2022</year>
          )
          <article-title>103403</article-title>
          . doi:
          <volume>10</volume>
          .1016/j.dsp.
          <year>2022</year>
          .
          <volume>103403</volume>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>