% Function to perform one-bit quantization

function x = sgn(y)
x_re = sign(real(y));
x_im = sign(imag(y));
for i = 1:length(y)
    if(x_re(i) >= 0)
        x_re(i) = 1;
    end
    if(x_im(i) >= 0)
        x_im(i) = 1;
    end
end
    
x = x_re + (1i)*x_im;