  We suggest and demonstrate a scheme to compensate spatial and spectral
decoherence effects in the generation of polarization entangled states by
type-I parametric downconversion. In our device a programmable spatial light
modulator imposes a polarization dependent phase-shift on different spatial
sections of the overall downconversion output and this effect is exploited to
realize an effective purification technique for polarization entanglement.
