# Hilbert transform too large to store (out of core processing)

I have a signal (saved on disk) that I would like to take the Hilbert transform of, but it's too large to fit in memory (all at once). I would like to cut it into blocks and take the transform of each block. I'm not super familiar with the Hilbert transform and I was wondering if there was some sort of padding or windowing that needed to be done / take overlapping chunks.

I would use a linear phase FIR Hilbert transformer, and use block processing, such as the overlap-add method. That means that you partition the input signal into contiguous non-overlapping blocks and compute the convolution of each block with your filter impulse response. The results are then overlapped and added. Overlap occurs because the result of the convolution is longer than the input block. E.g., if the impulse response has length $N$ and the blocks have length $L$, the result of the convolution is $N+L-1$, and the last $N-1$ output samples must be added to the first $N-1$ samples of the next output block (assuming that $N<L$, i.e., the output block only overlaps with the next block).

In short:

$$y[n]=\sum_ky_k[n-kL],\qquad y_k[n]=(x_k\star h)[n]$$

where $h[n]$ is the impulse response, $x_k[n]$ is the $k^{th}$ input block, $y_k[n]$ is the convolution of $h[n]$ with $x_k[n]$, and, finally, $y[n]$ is the output signal.

• I didn't know this was what I was looking for, but that's exactly it. Thanks. Feb 28, 2017 at 18:03
• the convolution of h[n] with x_k[n], is that the same as taking the hilbert transform of x_k[n]?
– Mart
Jul 27, 2023 at 7:39
• @Mart: yes, $h[n]$ is the impulse response of a Hilbert transformer. Jul 27, 2023 at 7:58
• and n is each value for the kth input block right? I'm confused, because n-kL becomes negative at one point, negative indexing is not possible. Very arrogant question but could you provide a small matlab or python example? I cannot seem to figure out what's happening exactly and I would like to learn and visualize it. If I'm not asking for too much
– Mart
Jul 27, 2023 at 8:56
• @Mart: just look up "overlap-add"; that's the method I described in this answer. Jul 27, 2023 at 19:48

I am not aware of a block version for a direct implementation. One option could be to have a recursive implementation, from page 245 in Theory and implementation of the discrete Hilbert transform, B. Gold, 1969. It can give you an approximate version of the Hilbert transform, or via FIR approximations, as in On the behavior of minimax FIR digital Hilbert transformers. Related answers could be found on SE.DSP.