An algorithm that initializes a quantum register to a state with a specified energy range is given, corresponding to a quantum implementation of the celebrated Feit-Fleck method. This is performed by introducing a nondeterministic quantum implementation of a standard spectral filtering procedure combined with an apodization technique, allowing for accurate state initialization. It is shown that the implementation requires only two ancilla qubits. A lower bound for the total probability of success of this algorithm is derived, showing that this scheme can be realized using a finite, relatively low number of trials. Assuming the time evolution can be performed efficiently and using a trial state polynomially close to the desired states, it is demonstrated that the number of operations required scales polynomially with the number of qubits. Tradeoffs between accuracy and performance are demonstrated in a simple example: the harmonic oscillator. This algorithm would be useful for the initialization phase of the simulation of quantum systems on digital quantum computers.