Bragg confinement of carriers in a quantum barrier