Extracting positive frequencies of discrete-time signal Convolution in the time domain is the same as multiplication in the frequency domain.

My data is sampled at 200 Hz, which means that the Nyquist frequency is 100 Hz, and all frequency content is &lt;= 100 Hz. If I take a rectangle function in the time domain, with 1s everywhere below 100 Hz, FFT it, and convolve my data with that, it shouldn't make a difference. Indeed, the FFT of the rectangle function is sin(pi*x)/(pi*x), which is 0 at all integers except the origin.

When FFTing something like cos(2*pi*x/40), a sine wave at 5 Hz, you get two peaks. One at 5 Hz as expected, and one at -5 Hz. This can be thought of as two spirals e^(2*pi*i*x/40)/2 and e^(-2*pi*i*x/40)/2, one rotating counterclockwise, the other clockwise. When added, their complex parts cancel out, leaving only a real sine wave.

I want to extract only the part of my data with positive frequencies. For example, cos(2*pi*x/40) should become e^(2*pi*i*x/40)/2. This should reasonably make the data contain complex samples.

I thought to do this by creating a rectangle function with 1s where 0 &lt;= x &lt;= 100 Hz, FFTing that, and then convolving my data with the result. The resulting function (according to WolframAlpha) is 0.5 * e^(-pi*i*x) * sin(pi*x/2)/(pi*x/2) (graph, real part blue, imaginary part red). The problem is that the imaginary part is always zero at integers, which is weird. Since my data is real, and this function is always real at integers, the result of convolution must be entirely real, which contradicts the previous paragraph.

What is going on here? And how do I actually get what I want?
The mistake lies in the modulation of the low pass impulse response. The low pass response equals $1$ for $\omega\in(-\pi/2,\pi/2)$ and is zero otherwise, and you want a frequency response that is zero for $\omega\in(-\pi,0)$ and $1$ for $\omega\in(0,\pi)$. Consequently, you need to shift the spectrum by $\pi/2$, and not by $\pi$ as you did. The corresponding impulse response of the system becomes

$$h[n]=\begin{cases}\displaystyle\frac12,&amp;n=0\\\displaystyle\frac12 e^{jn\pi/2}\frac{\sin(n\pi/2)}{n\pi/2},&amp;n\neq 0\end{cases}\tag{1}$$

which can be rewritten as

$$h[n]=\begin{cases}\displaystyle\frac12,&amp;n=0\\\displaystyle0,&amp;n\textrm{ even},n\neq 0\\\displaystyle\frac{j}{n\pi},&amp;n\textrm{ odd}\end{cases}\tag{2}$$

So only the sample at $n=0$ is real-valued, all samples at even indices (other than zero) vanish, and all samples at odd indices are purely imaginary.

Consequently, the real part of the impulse response is just a scaled unit impulse, and its imaginary part is a scaled discrete-time Hilbert transformer:

$$h[n]=\frac12\big(\delta[n]+jg[n]\big)\tag{3}$$

with $g[n]$ the impulse response of an ideal discrete-time Hilbert transformer.