SQU Journal for Science, 2016, 21(1), 41-47 ©2016 Sultan Qaboos University 41 Two Dimensional Short Time Hartley Transforms Narasimman Sundararajan 1* , Alaeddin Ebrahimi 1 and Nannappa Vasudha 2 1 Department of Earth Science, College of Science, Sultan Qaboos University, P.O.Box: 36, PC 123, Al-khod, Muscat, Sultanate of Oman. 2 Department of Mathematics, Vasavi College of Engineering, Hyderabad, India.*Email: visvid12@squ.edu.om. ABSTRACT: The Hartley transform, as in the case of the Fourier transform, is not suitably applicable to non- stationary representations of signals whose statistical properties change as a function of time. Hence, different versions of 2-D short time Hartley transforms (STHT) are given in comparison with the short time Fourier transform (STFT). Although the two different versions of STHT defined here with their inverses are equally applicable, one of them is mathematically incorrect/incompatible due to the incorrect definition of the 2-D Hartley transform in literature. These definitions of STHTs can easily be extended to multi-dimensions. Computations of the STFT and the two versions of STHTs are illustrated based on 32 channels (traces) of synthetic seismic data consisting of 256 samples in each trace. Salient features of STHTs are incorporated. Keywords: Fourier transform; Hartley transform; Wavelet transform; Time; Frequency and Window. تحويالت هارتلي ثىائية األبعاد للزمه القصير وارسيمان ساوذراراجان و عالءالذيه ابراهيمي واواباراجا فاسودا كما ٌُ انحال بانىسبت نخحُیم فُریيً، ال یىطبق بشكم مىاسب نهخمثيم غيز انثابج نإلشاراث انخي خصائصٍا اإلحصائيت حخغيز ححُیم ٌارحهی ان :الملخص ( حقارن مع ححُیم فُریيً نهشمه انقصيز ) STHT) كذانت في سمه؛ بانخاني إصذاراث مخخهفت مه ححُیالث ٌارحهي نهشمه ثىائي األبعاد نهشمه انقصيز STFT بانزغم مه َجُد اصذاریه مخخهفيه مه .)STHT ي انخطبيق، فان احذٌما غيزصحيح/ مخُافقً ریاضيا انمعّزفً ٌىا مع معکُسٍا انذیه مخساَیان ف ح بسٍُنت إنى أبعاد مخعذدة؛ َقذ حم حُضي STHTsَمه انممکه حُسيع حعزیفاث .بسبب انخعزیف انغيز صحيح نخحُیم ٌارحهي نهبعذیه في انمىشُراث عيىت في كم أثز. کما حم دمج 352)أثز( مه انبياواث انسيشميت انمؤنفت حخأنف مه 23بااالسخىاد انی قىاة STHTsاإلصذاریه ل حعزیف َ STFTحسابان .STHTsانخصائص انبارسة ل .ححُیم فُریيً، ححُیم ٌارحهي،ححُیم انمُجاث، انشمه، فزیکُوسی َانىافذي: الكلمات المفتاحية 1. Introduction t is well known that the elegant mathematical tools, the Fourier transform (FT) and Hartley transform (HT), were invented in 1807 and 1942 respectively. Subsequently, the theory of spectral analysis began with the breakthrough of Tukey in 1949 [1]. However, the computational feasibility of the FT was a reality only when the great breakthrough occurred in the form of the fast Fourier transform (FFT) algorithm that was brought out in 1965 by Cooley and Tukey [2]. In general, the FT gives the spectral content of the signal, devoid of any information regarding the time at which those spectral components appear. Such a result is appreciable only for stationary signals [3], whose frequency content does not change with time. In most of the cases, a particular spectral component occurring at a specific time instant can be more useful and interesting, as in the case of seismological data which is non-stationary, and in which the frequency of the signal varies with time. Mathematicians and researchers are aware that the Fourier transform is best suited to process stationary signals; however, most of the information and data we come across in our day to day life are not stationary. To achieve time localization of frequency of a non-stationary signal while using the FT, it is necessary that the signal be subjected to narrow windows, narrow enough that the portion of the signal seen from these windows is indeed stationary. This approach is called the short time Fourier transform (STFT), which is a modified version of the FT. In the STFT, the given signal is divided into small segments, such that each segment of the signal can be assumed to be stationary. For this purpose, a window function is chosen, so that the width of the window is equal to the segment of the signal, in which its stationarity is valid. Thus, the one dimensional STFT can be defined as [4-6]:       2 w , w i t STFT f t g t e dt         (1) I NARASIMMAN SUNDARARAJAN ET AL. 42 where ‘g’ is the window function and ‘ ’ is the width of the window. In analogy with the STFT, the short time Hartley transform (STHT), is the real version of its complex Fourier counterpart. A time varying Hartley representation of signal for analyzing the time varying signal f(t) can be defined [5] in its one dimension as:        , w 2 wSTHT f t g t cas t dt       (2) where ‘g’is the window function and ‘ ’ is the width of the window. Further, the kernel in equation (2) represents a 45 degrees phase shifted sine wave and is given as: )w2(sin)w2(cos)w2( tttcas   It may be emphasized here that the HT is an attractive alternative and real replacement for the well-known complex FT in all its applications. It is identical in its 1-D representation with the FT wherein the amplitude is the same as that of Fourier amplitude. Further, the HT is fully equivalent to the FT with the same physical significance in that both FT and HT furnish a pair of numbers that represent the physical oscillations in amplitude and phase and hence may be termed as a mathematical twin [7]. The theory and applications of this now well-known tool are found in the literature [8- 13]. Although the conventional Fourier and Hartley transforms are more appropriate to represent periodic, transient and stationary random signals, direct applications of these elegant tools fail in case of signals whose properties vary markedly as a function of time. In such cases, the time varying Fourier and Hartley transforms which are referred to as the STFT and STHT are employed to overcome the drawbacks of the FT and HT [14]. The effects of windows may be realized by computing the STHT of a non-stationary signal with windows of two different lengths. For example, the Gaussian function may be used as a window function of the form:   2 2 w a t t e   (3) where ‘a’ determines the length of the window and ‘t’ is the time. Two different window functions can be generated for two different values of ‘a’. Generally, a narrower window function (a=0.01) may yield very good time resolution, but a relatively poor frequency resolution. On the other hand, a wider window function may result in a poor time resolution but does ensure better frequency resolution. A window function of infinite length yields the FT and ensures perfect frequency resolution, but no time resolution. Thus, the window length needs to be optimized in applications, according to the desired results. 2. Frequency and Time Resolutions Short time Hartley transforms (STHT), as in the case of the STFT, obey the ‘Heisenberg Uncertainty Principle’, which holds good for the time frequency information of a signal. According to this principle, one cannot know what spectral components exist at what specific times but one can know the time intervals at which certain bands of frequencies exist. This is known as time frequency resolution. In STFT, if a window function of infinite length is used, we get the FT, which gives perfect frequency resolution, but no time information. In order to obtain stationarity, the narrower the width of the window function, the better the time resolution but the poorer the frequency resolution. Therefore, choice of window function length becomes a trade- off between frequency resolution and time resolution. Resolution in time and frequency cannot arbitrarily be small, because their product is lower bounded, and hence time localization and frequency resolution cannot simultaneously be determined to an arbitrary precision. This can be stated in terms of a redefinition of the Heisenberg Uncertainty Principle as: 1. 4 t f     (4) where t and f are the uncertainties in time and frequency [13]. So, to analyze various types of behavior in a signal, the STHT would have to be taken several times, each time with a different size of window function. This is especially problematic when the location and/or duration of transient behavior are unknown, which is normally the case [15]. However, it ensures better resolution than the use of either the FT or HTs [16]. 2-D Fourier and Hartley Transforms The well-known complex 2-D Fourier transform of an image represented by a real function f(x, y) and its inverse are given [17, 12] as:      2 , , i ux vy F u v f x y dx dye           (5) TWO-DIMENSIONAL SHORT TIME HARTLEY TRANSFORMS 43 and      2 , , i ux vy f x y F u v du dve          (6) where u and v correspond to x and y and are referred to as wave numbers. On the other hand, two different versions of 2-D Hartley transforms exist [12], and are given here. The 2-D Hartley transform of an image represented by f(x,y) and its inverse are given [17,12] as:       , , 2H u v f x y cas ux vy dx dy        (7) and       , , 2f x y H u v cas ux vy du dv        (8) where cas(ux+ vy) = cos (ux+ vy) + sin (ux+ vy). Equations (7) and (8) (version I) are defined in many applications in analogy with the 2-D Fourier transform [8]. The other version (version II) of the 2-D HT can be written as [12]:        , , 2 2H u v f x y cas u x cas v y dx dy         (9)        , , 2 2f x y H u v cas u x cas v y du dv         (10) where,      xuxuxucas  2sin2cos2  and      yvyvyvcas  2sin2cos2  . Equation (9) is sometimes referred to as the cas-cas transform. Perkins [17] called it a ‘Hartley like’ transform. On the other hand, equation (7) is dubbed the ‘Fourier like’ 2-D HT. According to Sundararajan, equations (7) and (9) give rise to the same frequency information [12]. Furthermore, equation (9) is mathematically more appropriate than the conventional representation given by equation (8), which is mathematically incorrect since: exp[-(x u + y v)] ≠ cas(x u). cas(y v) The discrete counterpart of 2-D Hartley transforms (DHT) of an image f(x,y) of size M x N and their inverses given by equations (5), (8), (6) and (9) can be expressed as [12]:        1 , , 2H u v f x y cas ux vy MN   (11)       , , 2f x y H u v cas ux vy  (12)         1 , , 2 2H u v f x y cas u x cas v y MN    (13)        , , 2 2f x y H u v cas u x cas v y   (14) 2-D STFT and STHTs It may be noticed that the HT (STHT) and its inverse possess the same kernel, unlike its progenitor, the FT, or any other integral transform. This is an exclusive characteristic associated with the HT [18]. The concept of the STHT can easily be introduced to 2-D and multi-dimensions. Accordingly, the 2-D STFT and the 2-D STHT of both the versions NARASIMMAN SUNDARARAJAN ET AL. 44 (equation (7) and equation (9)) can be defined as:           dydxeyyxxgyxfvuyxSTFT y)vx(uπ2i ,,, (15)         , , 2, x y f x y g x x y y cas u x v y dx dySTHT x y u v        (16)          , , 2 2, yx f x y g x x y y cas u x cas v y dx dySTHT x y u v        (17) It is also to be noted that most of the signals we come across in our day to day life are real, and hence their spectral studies can better be realized using a real tool like a HT/STHT rather than a complex tool like the FT/STFT which is computationally more expensive, since one complex and one real mathematical operation have a CPU time ratio of 4:1. 2.1 Computational Examples The 2-D STFT and the two different versions of the STHTs are illustrated with the computation of a set of 32 synthetic seismic traces (Figure 1) consisting of 256 samples in each trace making a data size of 256 32 . Each trace (Figure 1) represents the variation of amplitude with respect to time and all the traces are separated by a fixed interval of distance. Thus, the set of 32 seismic traces make the space- time function f(x,t). The computations of the STFT and the two versions of STHTs that yield the spectral amplitude versus frequency/wavenumber over each window are based on equations (15, 16) and (17) and are shown in Figures (2, 3) and (4) respectively. The normalized spectral amplitudes are given in Figures (2-4). Figure 1. A set of 32 synthetic seismic traces represented by f(x, t). TWO-DIMENSIONAL SHORT TIME HARTLEY TRANSFORMS 45 Figure 2. Amplitude of short time Fourier transform (STFT) of f(x, t). Figure 3. Amplitude of short time Hartley transform (STFT) of f(x, t)-version-I. NARASIMMAN SUNDARARAJAN ET AL. 46 Figure 4. Amplitude of short time Hartley transform (STFT) of f(x, t)-version-II. 3. Discussion In general FT/STFTs can be replaced by their real versions called HT/STHT in all their applications without any loss of information, but with certain computational advantages. Although STHTs ensure better resolutions than their HTs, the optimization of window length for a desired result is again a cumbersome exercise. Therefore, what is needed is a mapping that uses one initial window function which varies its size automatically so that all frequency behavior can be analyzed with just one pass (narrow window function at high frequencies and wide window function at low frequencies). This is where the Wavelet transform comes in. The Wavelet transform may address some of the shortcomings of the STFT/STHTs. Instead of fixing the time and the frequency resolutions t and f , one can let both resolutions vary in time frequency plane in order to obtain a multi-resolution analysis. This variation can be carried out without violating the Heisenberg inequality given in the equation (4). In this case, the time resolution must increase as frequency resolution decreases, and the frequency resolution must increase as time resolution decreases. This can be obtained by fixing the ratio of f over f to be equal to a constant c as: c f f   (18) With this approach, the time resolution becomes arbitrarily good at high frequencies, while the frequency resolution becomes arbitrarily good at low frequencies. The Wavelet transform allows analysis of a signal that can locate energy in both time and frequency within the constraints of the uncertainty principle. Perhaps the Wavelet transform plays a significant role in signal analysis, overcoming the drawbacks encountered in the FT/STFT and HT/STHT, when carried out with appropriate mother wavelets [19]. Therefore, the Wavelet transform can be understood as being the natural extension of the Hartley transform. The Wavelet transform leads to automatic windowing instead of fixed windows as in STHTs. TWO-DIMENSIONAL SHORT TIME HARTLEY TRANSFORMS 47 4. Conclusion The appropriate choice between complex and real mathematical tools like the STFT and STHT, the STHT is ideal for studying non-stationary signals, and has the added advantage of computational efficacy. 5. Acknowledgment The authors record their sincere thanks to the reviewers for their useful suggestions to improve the manuscript as presented. References: 1. Tukey, J.W. The sampling theory of power spectrum estimates. Paper presented at the Symposium on applications of autocorrelation analysis to physical problems, 1949. 2. Cooley, J.W. and Tukey, J.W. An algorithm for the machine calculation of complex Fourier series. Mathematics of computation., 1965, 19(90), 297-301. 3. Brigham, E. The fast Fourier transform. Englewood Cliffs, 1974. 4. Gabor, D. Theory of communication. Part 1: The analysis of information. Journal of the Institution of Electrical Engineers - Part III: Radio and Communication Engineering, 1946, 93(26), 429-441. 5. Allen, J.B. and Rabiner, L. A unified approach to short-time Fourier analysis and synthesis. Proceedings of the IEEE., 1977, 65(11), 1558-1564. 6. Cohen, L. Time-frequency analysis. Prentice Hall PTR Englewood Cliffs, NJ., 1995, 1, 995,299. 7. Sundararajan, N. Fourier and Hartley transforms-a mathematical twin. Indian Journal of Pure and Applied Mathematics, 1997, 28, 1361-1366. 8. Bracewell, R.N. Discrete Hartley transform. JOSA., 1983,73(12), 1832-1835. 9. Bracewell, R.N. Aspects of the Hartley transform. Proceedings of the IEEE., 1994, 82(3), 381-387. 10. Villasenor, J. and Bracewell, R. Optical phase obtained by analogue Hartley transformation, Nature, 1987, 330(6150), 735-737. 11. Villasenor, J. and Bracewell, R. Lensless microwave imaging using the Hartley transform. 1988, 617-619. 12. Sundararajan, N. 2-D Hartley transforms. Geophysics, 1995, 60(1), 262-267. 13. Sundararajan, N. and Vijayachitra, S. Multidimensional Fourier and Hartley transforms-are they same?, IETE J RES, 2000, 46(3), 125-127. 14. Liu, J.C. and Lin, T. Short-time Hartley transform. Radar and Signal Processing, IEE Proceedings F, 1993, 140(3), 171-174. 15. Chui, C. K. An Introduction to Wavelets analysis and its applications. Academic, San Diego, 1992. 16. Zhao, Z., Xu, J. and Horiuchi, S. Differentiation operation in the wave equation for the pseudospectral method with a staggered mesh. Earth, planets and space, 2001, 53(5), 327-332. 17. Perkins, M. G. A separable Hartley-like transform in two or more dimensions. Proceedings of the IEEE., 1987, 75(8), 1127-1129. 18. Duhamel, P. and Vetterli, M. Improved Fourier and Hartley transform algorithms: Application to cyclic convolution of real data. IEEE Transactions on Acoustics, Speech and Signal Processing,1987, 35(6), 818-824. 19. Sundararajan, N. and Vasudha, N. Genesis of Wavelet transform types and applications. Wavelets and Fractals in Earth System Sciences, 2013, 93-116. Received 20 August 2014 Accepted 1 November 2015