Implementation of halfband pass filter
The impulse response and frequency response of a length N zero-phase FIR lowpass filter can be designed using the Remez exchange algorithm. 

N = 11; % filter length - must be odd 

b = [0 0.1 0.2 0.5]*2; % band edges

M = [1 1 0 0 ]; % desired band values

h = remez(N-1,b,M); % Remez multiple exchange design

The impulse response h is returned in linear-phase form, so it must be left-shifted (N-1)/2 = 5 samples to make it zero-phase. 
Answer taken from https://www.researchgate.net/post/How_can_I_design_a_null_phase_FIR_filter.

I implemented this solution some time ago and still works very well in my code.