How to make a signal conjugate symmetric?
Conjugate symmetric means

$$f(-x) = f^{\ast}(x)$$

i.e. the sign of the imaginary part is opposite when $x&lt;0$

The FFT of a real signal is conjugate symmetric. One half of the spectrum is the positive frequencies, and the other half is the negative. The negative coefficients are conjugate of the positive.

So if you do filtering, your envelope must do both the positive frequencies and their corresponding negative frequencies, so that the imaginary bits cancel out.

In your example, H does only one half. That is why the output has imaginary bits in it. What you want is

NFFT = 128;
x = randn(NFFT,1);
H = zeros(NFFT,1);
H(10:20) = 1;
H(end-20+2:end-10+2) = 1;    % Other half
y = ifft(H.*fft(x));