function symbols = bits_to_symbols_qpsk(bits)
    symbols = bits_to_symbols(bits, 2);
    symbols_num = length(symbols);

    phase = 0;
    for i = 1:symbols_num
        if symbols(i) == 0
            phase = phase + 90;
        else
            if symbols(i) == 1
                phase = phase + 0;
            else
                if symbols(i) == 2
                    phase = phase + 270;
                else
                    phase = phase + 180;
                end
            end
        end
        
        phase = mod(phase, 360);

        symbols(i) = phase_to_complex(phase);
    end
    
function c = phase_to_complex(phase)
    if phase == 0
        c = complex(1, 0);
    else
        if phase == 90
            c = complex(0, 1);
        else
            if phase == 180
                c = complex(-1, 0);
            else
                if phase == 270
                    c = complex(0, -1);
                else
                    c = 0;
                end
            end
        end
    end
