Abstract
Short-time (sliding) transform based on discrete Hartley transform (DHT) is often used to estimate the power spectrum of a quasi-stationary process such as speech, audio, radar, communication, and biomedical signals. Sliding transform calculates the transform coefficients of the signal in a fixed-size moving window. In order to speed up the spectral analysis of signals with slowly changing spectra, the window can slide along the signal with a step of more than one. A fast algorithm for computing the discrete Hartley transform in windows that are equidistant from each other is proposed. The algorithm is based on a second-order recursive relation between subsequent equidistant local transform spectra. The performance of the proposed algorithm with respect to computational complexity is compared with the performance of known fast Hartley transform and sliding algorithms.
1. Introduction
In today’s world, the study of real-life phenomena begins with sensors that convert the description of phenomena into digital signals. Since real sensors are sensitive to internal thermal, electronic, and environmental noise, the sensors’ output must be intelligently processed for subsequent use in a computer system. Short-time signal processing [1] is an appropriate technique for such a system, since it is capable of adaptively filtering long-term stationary (in wide-sense) and quasi-stationary signals. An example of quasi-stationary signal is speech. Frequency components of this signal change over time when the position of tongue and mouth changes, but on a short period of time they might be considered stable because tongue cannot move very quickly. Short-time processing is used in a variety of applications such as radar emitter recognition [2], heart sound classification [3], sensor noise removal [4], gearbox fault diagnosis [5], speech processing and spectral analysis [6], and adaptive linear filtering [7].
Basically, short-time transform is a time series of windowed signal transforms that can be used to perform time-frequency analysis. Local signal processing in a moving window (special case of short-time processing) can be carried out as follows: at each position of the running window, the coefficients of an orthogonal transform of the signal are modified to estimate only the central window element [8]. For time-varying signals, it is preferred that the window length be small enough so that the windowed signal would be approximately stationary. On the other hand, the window size should be large enough to provide a reasonable frequency resolution of the local signal. Typically, with local sliding processing, the window moves with a step of one along the signal. However, if it is necessary to process the signal at a high speed and the signal spectrum changes slowly over time, the window can move with a step of more than one. This approach has recently been proposed to design preview tools for multiresolution signal and image restoration [9].
Discrete Hartley transform (DHT) [10] is used in various practical applications such as speech spectral analysis [11], feature extraction and sea surface modeling [12], data compression [13], and signal interpolation [14]. Four types of DHT are classified [15,16]. Discrete Hartley and Fourier transforms of real signals and their relations with discrete sinusoidal transformations are discussed in detail [17,18]. Note that for real signals, all DHT coefficients can be used in the design of transform domain scalar filters. Representation of a signal in the DHT sliding domain is especially suitable for processing of time-varying, quasi-stationary data. Since calculating the DHT at each position of a running window is an intensive task, recursive algorithms can be used. First-order shift properties were obtained [19]. Since this approach is not very efficient in terms of computational complexity, four types of the sliding DHT were derived based on second-order recursive equations [20].
In this work, a recursive algorithm is proposed for fast computation of the DHT in a window sliding along the signal more than one sample at a time. The main contributions of the work are as follows:
- Second-order recursive equation between three consecutive equidistant DHT spectra is obtained using the z-transform technique.
- Efficient sliding DHT algorithm is proposed using the properties of discrete sinusoidal functions and the recursive equation.
- Computational complexity and running time of the proposed sliding algorithm are compared with the known sliding and fast DHT algorithms.
The paper is organized as follows. In Section 2, a second-order recursive equation between three consecutive equidistant DHT spectra is derived. In Section 3, a fast forward algorithm for computing the sliding DHT is suggested. Section 3 also presents a fast inverse sliding DHT algorithm. The performance of the proposed and common DHT algorithms in terms of computational complexity and runtime is given and discussed in Section 4. Finally, our conclusions are presented in Section 5.
2. Second-Order Equation for Recursive Computation of Sliding DHT
We recall here the definition of DHT. The following notations are used: , , , , where the subscript N is the transform order, r is an integer, and For clarity, the normalization factor is disregarded until the inverse transform.
Sliding DHT with a step of p can be defined as follows:
where ; k =…, −N1, −N1 + 1,…, 0, 1,…, N2, N2 + 1….} is a signal to be processed; are the transform coefficients around time kp; N = N1 + N2 + 1 is the size of the moving window; N1 and N2 are arbitrary integer values.
A recursive relationship between three consecutive sliding spectra is given as [20]:
where .
This is a linear inhomogeneous difference equation defined on k. For fixed s, (2) can be considered as a linear difference equation with constant coefficients. Linear time-invariant systems defined by such equations can be analyzed using the unilateral z-transform [1]. Suppose that we deal with a causal linear system (region of convergence is outside a circle on the z-plane) and nonzero initial conditions and are given. Applying the unilateral z-transform to (2) and using its shift property, we get:
where and are the z-transforms of and , respectively.
We express as:
For , there are two different roots of the denominator; that is, and . For , the roots are equal to . Let us carry out the partial fraction expansion of the equation:
and obtain
The inverse z-transform can be computed as follows [1]:
where is the unit-step function defined as 1, for and 0, for .
Using (5), (4) can be represented as follows:
Using the shifting and convolution properties, the inverse transform is given as:
Substituting (7) into (9) and taking into account that for and , we arrive at:
with .
Given two initial values and , one can obtain from (10) as:
Substituting (11) into (10), for arbitrary k we obtain:
Finally, the DHT at the window position 2p is recursively computed using and as:
This equation gives relationship between three consecutive equidistant DHT spectra, computed at times and
3. Fast Sliding Algorithm for Computing DHT
3.1. Special Values of Discrete Sinusoidal Functions
Given below are special values of discrete sinusoidal functions used in the performance analysis of the proposed sliding algorithm. Let us consider the following functions: , , and with s = 0, 1,…, N − 1. The special values are shown in Table 1. Here, r, l, and N are arbitrary integer values, and the binary variable b takes the values {0, 1}. So, it is necessary to find such values of the variables l and b in order to obtain integer values of s in the range from 0 to N − 1.
Table 1.
Special values of the discrete sinusoidal functions.
The functions are used in the proposed algorithm in the operations of addition and multiplication; that is, when the functions are equal to 0, then the corresponding addition and multiplication operations can be discarded, and when they are equal to either −1 or 1, then the corresponding multiplication operations can be canceled. Therefore, the use of the special values can reduce the computational complexity of the algorithm.
3.2. Design of Forward Sliding Algorithm
Equation (13) for can be rewritten as:
where . At each window, the number of additions required for calculation of is , since the coefficients have already been computed and stored at the position p of the window.
Suppose that N is odd. Let , , be the greatest common factors of and r, r + 1, r − 1, respectively. The property of symmetry of the discrete function is given as follows: Let us compute For a fixed r, the quantities of 0 and of are equal to and respectively (see the second row of Table 1). So, the number of multiplications can be estimated as:
Let us denote . Using the symmetry property of the functions the number of additions can be estimated as:
Additional expenses are required for calculating initial p coefficients.
Suppose that N is even. Equation (14) can be represented as follows:
Let , be the greatest common factors of and r, r + 1, r − 1, respectively. In this case, the property of symmetry of the discrete function is given as follows: here is the integer quotient. Let us compute For a fixed r, the quantities of 0 and of are equal to and respectively (see second row of Table 1). The number of zeros of is equal to (see the first row of Table 1). If is integer (see the third row of Table 1), then the number of zeros of the function equals otherwise It means that the zeros of the function can cancel the operations of multiplication and addition in the first term of (17) (see the last line of the equation) at the corresponding frequencies s. The number of of the function is equal to . Finally, the number of multiplications can be estimated as follows:
Using the symmetry property of the functions the number of additions can be estimated as:
Additional expenses are needed for calculating initial p coefficients.
To more clearly show the design of the algorithm, we provide an example for computing the sliding DHT coefficients. Assume that N1 = 7, N2 = 8, N = 16, p = 2, the DHT is computed at the window position 2p . We borrow from the window position p two coefficients , and calculate the following auxiliary data:
.
DHT coefficients are computed as follows:
.
The computational complexity of the algorithm is 25 multiplications and 61 additions.
3.3. Design of Inverse Sliding Algorithm
The inverse sliding DHT computes only the element of the window. The inverse algorithm can be written as follows:
where .
If is the central window element, that is, , then one can simplify the inverse transform to:
Finally, for the inverse transform is given as:
The proposed algorithms require only one multiplication and N − 1 additions.
4. Results and Discussion
In this section, using computer simulation, we analyze the performance of the proposed algorithm with respect to the computational complexity and execution time and compare it with that of fast DHT and conventional recursive algorithms. Among fast DHT algorithms, the most popular are fast radix-2 [21,22]. The recursive sliding (with a step of one) DHT algorithms [19,20] are carried out p times for computing the DHT spectra at equidistant positions kp of the window. Table 2 and Table 3 show the computational complexity in terms of multiplications and additions, respectively, of the proposed, fast radix-2 DHT, and known sliding algorithms at a fixed window position for p = 2 when N varies.
Table 2.
Comparison of the tested algorithms with respect to multiplications for computing sliding DHT with p = 2.
Table 3.
Comparison of the tested algorithms with respect to additions for computing sliding DHT with p = 2.
It can be seen that the proposed algorithm for p > 2 outperforms the conventional sliding DHT algorithms. Note that the proposed algorithm is more efficient than the fast and conventional recursive algorithms when the window length increases.
In modern processors, the execution times of floating point multiplication and addition are comparable. So, further we will estimate the computational complexity with respect to flop counts (real additions and multiplications). Table 4 shows the computational complexity of the tested algorithms for N = 256 when p varies.
Table 4.
Comparison of the tested algorithms in terms of flops for computing sliding DHT, N = 256.
It can be seen that the proposed algorithm is more efficient than the fast DHT algorithm when the step This boundary value of the step, when the proposed algorithm is still better than the fast DHT algorithm, increases with increasing the window length.
Obviously, the execution time of any algorithm depends on the characteristics of a computer used in a particular implementation of the algorithm. Now, with the help of computer simulation, we want to illustrate how the theoretical computational complexity of the tested algorithms relates to the execution time of the implemented algorithms. Computer simulation was performed on a laptop with an Intel Core i7-2630QM processor with 8 GB of RAM using the MATLAB R2012b. Experiments were carried out 100 times to ensure statistically correct results. Average time results for each algorithm were calculated. Figure 1 shows the performance of the tested algorithms in terms of runtime: DHT is the discrete Hartley transform given by definition, Fast DHT is implemented in Matlab, SDHT is sliding DHT [20], ALG is the proposed algorithm.
Figure 1.
Performance of the tested algorithms in terms of runtime (milliseconds) per window when N = 256 and p varies from 2 to 10.
It can be seen that the obtained results are in good agreement with the results in Table 4. Only the performance of the fast algorithm implemented in the MATLAB is slightly lower than that of the algorithm [22].
There are four types of DHT [16] that are suitable for the time varying processing of different signal models. In this paper, the second order recursive equation and fast recursive algorithm have been proposed for only one type of discrete Hartley transform (DHT-I). In the future, the same approach can be used to derive recursive equations and design fast recursive algorithms for other types of DHT, which will allow the system to work effectively with various signal models.
5. Conclusions
A second-order recursive equation between three consecutive equidistant DHT spectra was obtained utilizing of the unilateral z-transform technique. Using the properties of discrete sinusoidal functions and the recursive equation, a fast sliding DHT algorithm was proposed. A fast inverse sliding DHT transform was also presented. The computational complexity of the proposed sliding algorithm was compared with the known running and fast DHT algorithms. The proposed algorithm was implemented on a laptop, and it was shown that the theoretical computational complexity and execution time of the implemented algorithm are in good agreement.
Funding
This research received no external funding.
Conflicts of Interest
The author declares no conflict of interest.
References
- Oppenheim, A.V.; Schafer, R.W. Discrete-Time Signal Processing, 3rd ed.; Prentice Hall Press: Upper Saddle River, NJ, USA, 2009. [Google Scholar]
- Wang, X.; Huang, G.; Zhou, Z.; Tian, W.; Yao, J.; Gao, J. Radar emitter recognition based on the energy cumulant of short time Fourier transform and reinforced deep belief network. Sensors 2018, 18, 3103. [Google Scholar] [CrossRef] [PubMed]
- Thalmayer, A.; Zeising, S.; Fischer, G.; Kirchner, J. A robust and real-time capable envelope-based algorithm for heart sound classification: Validation under different physiological conditions. Sensors 2020, 20, 972. [Google Scholar] [CrossRef] [PubMed]
- Maciusowicz, M.; Psuj, G. Use of time-dependent multispectral representation of magnetic Barkhausen noise signals for the needs of non-destructive evaluation of steel materials. Sensors 2019, 19, 1443. [Google Scholar] [CrossRef] [PubMed]
- Lv, Y.; Pan, B.; Yi, C.; Ma, Y. A novel fault feature recognition method for time-varying signals and its application to planetary gearbox fault diagnosis under variable speed conditions. Sensors 2019, 19, 3154. [Google Scholar] [CrossRef] [PubMed]
- Allen, J. Applications of the short time Fourier transform to speech processing and spectral analysis. In Proceedings of the Acoustics Speech and Signal IEEE International Conference on ICASSP, Paris, France, 3–5 May 1982; pp. 1012–1015. [Google Scholar] [CrossRef]
- Kober, V. Robust and efficient algorithm of image enhancement. IEEE Trans. Consum. Electron. 2006, 52, 655–659. [Google Scholar] [CrossRef]
- Jacobsen, E.; Lyons, R. The sliding DFT. IEEE Signal Process. Mag. 2003, 20, 74–80. [Google Scholar]
- Karnaukhov, V.; Kober, V. A fast preview restoration algorithm for space-variant degraded images. In Proceedings of the SPIE’s 61 Annual Meeting: Applications of Digital Image Processing XXXIX, San Diego, CA, USA, 29 August–1 September 2016. [Google Scholar] [CrossRef]
- Bracewell, R.N. The Hartley Transform; Oxford Univ. Press: New York, NY, USA, 1986. [Google Scholar]
- Agbinya, J.I.; McLean, D.J. Generalised short-time Hartley transforms for speech processing. In Proceedings of the IEEE Conf. ICCS, Singapore, 14–18 November 1994; pp. 893–896. [Google Scholar] [CrossRef]
- Varela, J.; Rodriguez, G.; Guedes Soares, C. Comparison study between the Fourier and the Hartley transforms for the real-time simulation of the sea surface elevation. Appl. Ocean Res. 2018, 74, 227–236. [Google Scholar] [CrossRef]
- Pattanaik, S.K.; Kamalakanta, M. DHT Based JPEG image compression using a novel energy quantization method. In Proceedings of the IEEE International Conference on Industrial Technology, Mumbai, India, 15–17 December 2006; pp. 2827–2832. [Google Scholar] [CrossRef]
- Maharana, G.; Meher, P.K. Algorithm for efficient interpolation of real-valued signals using discrete Hartley transform. Comput. Electr. Eng. 1997, 23, 129–134. [Google Scholar] [CrossRef]
- Wang, Z. Fast algorithms for the discrete W transform and for the discrete Fourier transform. IEEE Trans. Acoust. Speech Signal Process. 1984, 32, 803–816. [Google Scholar] [CrossRef]
- Hu, N.-C.; Chang, H.-I.; Ersoy, O.K. Generalized discrete Hartley transforms. IEEE Trans. Signal Process. 1992, 40, 2931–2940. [Google Scholar]
- Britanak, V.; Rao, K.R. The Fast generalized discrete Fourier transforms: A unified approach to the discrete sinusoidal transforms computation. Signal Process. 1999, 79, 135–150. [Google Scholar] [CrossRef]
- Kober, V. Fast algorithms for the computation of sliding discrete sinusoidal transforms. IEEE Trans. Signal Process. 2004, 52, 1704–1710. [Google Scholar] [CrossRef]
- Xi, J.; Chicharo, J.F. Computing running Hartley transform and running discrete W transforms based on the adaptive LMS algorithm. IEEE Trans. Syst. II 1997, 44, 257–260. [Google Scholar]
- Kober, V. Fast algorithms for the computation of sliding discrete Hartley transforms. IEEE Trans. Signal Process. 2007, 55, 2937–2944. [Google Scholar] [CrossRef]
- Bi, G.; Chen, Y.Q.; Zeng, Y. Fast generalized DFT and DHT algorithms. Signal Process. 1998, 65, 383–390. [Google Scholar] [CrossRef]
- Grigoryan, A.M. A novel algorithm for computing the 1-D discrete Hartley transform. IEEE Signal Process. Lett. 2004, 11, 156–159. [Google Scholar] [CrossRef]
© 2020 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
