# Relationship between input and output sequence in Hartley transformation

As you know that Discrete Hartley transformation is related to the discrete Fourier transformation, $$i.e$$, assuming we have a vector $$X = [x_0,x_1,\ldots,x_N]$$, its Hartley transformation is equal to $$H(X) = Real(FFT(X)) - Imag(FFT(X))$$. where $$H$$ denotes the Hartley transformation.

I wonder, if I want the output of the Hartley transformation equals to a vector of length $$N$$ whose all elements are $$1$$, it means $$H(X) = [1,1,\ldots,1]$$, what supposed to be the input $$X$$? I means I need to formulate the relationship between the inputs and outputs.

Wikipedia's entry for the discrete Hartley transform shows states that the $$\mathsf{DHT}$$ is, up to a scaling, its own inverse. If $$x$$ is a vector with $$N$$ entries and $$y$$ is its discrete Hartley transform, $$$$y = \mathsf{DHT}x,$$$$ then $$$$x = \frac{1}{N}\mathsf{DHT}y.$$$$

If $$x$$ is a vector with $$N$$ entries such that $$$$\mathsf{DHT}x = \underbrace{(1,1,\ldots,1)^{\mathsf{T}}}_{\textrm{N entries}},$$$$ then we recover $$x$$ with $$$$x = \frac{1}{N}\mathsf{DHT}\left(\begin{array}{c}1\\1\\\vdots\\1\end{array}\right).$$$$ This means that $$x$$ is $$$$\begin{split} x &=~ \frac{1}{N}\left(\mathsf{Re}\left[\mathsf{DFT}\left(\begin{array}{c}1\\1\\\vdots\\1\end{array}\right)\right] - \mathsf{Im}\left[\mathsf{DFT}\left(\begin{array}{c}1\\1\\\vdots\\1\end{array}\right)\right]\right), \end{split}$$$$ where $$\mathsf{DFT}$$ is the discrete Fourier transform, which we usually compute with a FFT algorithm. The $$\ell^{\textrm{th}}$$ entry of the $$\mathsf{DFT}$$ of the all-1 vector is $$$$\begin{split} \sum_{n=0}^{N-1}1\times e^{-2\pi j \ell n/N} &=~ 1 + e^{-2\pi j \ell/N} + \left(e^{-2\pi j \ell/N}\right)^2 + \cdots + \left(e^{-2\pi j \ell/N}\right)^{N-1}\\ &=~ \left\{\begin{array}{rl}N & \textrm{if}~\ell=0,\\0&\textrm{if}~\ell\neq 0.\end{array}\right.\\ &=~ N\delta_{\ell,0}, \end{split}$$$$ where $$\delta_{p,q}$$ is the Kronecker delta. One way to show this is to note that if $$\ell = 0$$, then each exponent is $$0$$, so each term in the sum is $$1$$. On the other hand, if $$\ell\neq 0$$, then $$\exp(-2\pi j\ell/N) \neq 1$$,and $$$$\begin{split} 1 + e^{-2\pi j \ell/N} + \left(e^{-2\pi j \ell/N}\right)^2 + \cdots + \left(e^{-2\pi j \ell/N}\right)^{N-1} &=~ \frac{1 - \left(e^{-2\pi j \ell/N}\right)^N}{1 - e^{-2\pi j \ell/N}}\\ &=~ \frac{1 - e^{-2N\pi j \ell/N}}{1 - e^{-2\pi j \ell/N}}\\ &=~ \frac{1 - 1}{1 - e^{-2\pi j \ell/N}} ~=~ 0. \end{split}$$$$

That shows that the $$\mathsf{DFT}$$ of the all-1 vector has no imaginary part, and its real part is $$(N,0,0,\ldots,0)^{\mathsf{T}}$$. Hence $$$$x ~=~ \frac{1}{N}\left(\begin{array}{c} N\\0\\0\\\vdots\\0 \end{array}\right) ~=~ \left(\begin{array}{c} 1\\0\\0\\\vdots\\0 \end{array}\right).$$$$

• Thank you so much .. that's really appreciated.
– Gze
May 20 '20 at 3:19
• Thanks again, that's really interesting. I am trying to understand it well, if I got a question, I will let you know.
– Gze
May 20 '20 at 6:36
– Gze
May 20 '20 at 11:46

The Hartley transform is an involution: it is (up to a scale factor) its own inverse. The classical discrete Hartley transform of order $$N$$ is such that $$H_N^{-1} = \frac{1}{N}H_N$$. Be careful with your notation, the vector $$x$$ has $$N+1$$ entries, so maybe you are after an $$N+1$$-order DHT!

If $$\mathbf{1}$$ denotes the all-ones vector, then in matrix-vector product $$H_Nx = \mathbf{1}$$ is equivalent to $$H_N^{-1}H_Nx = H_N^{-1}\mathbf{1}$$, and you get more directly the mysterious $$X$$:

$$x = \frac{1}{N}H_N\mathbf{1}$$

and you get the result given by Joe Mac by a direct computation. A little interpretation: the discrete "Dirac" signal at the origin yields a flat "Hartley" spectrum, just like for Fourier.

• Thank you for explaining it, I got it now. but I was wondering what's about if $H_Nx = y$ and only some values of, i.e., $y_{1:4:N} = 1$ and other values of $y$ are any random values. So, can we express the relationship between the $y_{1:4:N}$ and $x_{1:4:N}$ mathematically in similar way too?
– Gze
May 20 '20 at 11:44
• I should add something, .. So, can we express the relationship between the $y_{1:4:N}$ and $x_{1:4:N}$ OR between $y_{1:4:N}$ and $x$ mathematically in similar way too?
– Gze
May 20 '20 at 12:07
• I don't really understand this comment. This may require a different question. But you can indeed interleave transforms and downsampling operators, and solutions can be quite complicated May 20 '20 at 12:16
• OK .. I posted it as a new question here dsp.stackexchange.com/questions/67696/… .. thank you
– Gze
May 20 '20 at 14:49
• And you did well. I am not able to see a clear answer right now May 20 '20 at 22:13