MAINT: Refactor downsampling_convolution_periodization
MAINT: Refactor downsampling_convolution_periodization

downsampling_convolution_periodization was not very clear in the previous
implementation, with many nested conditions. The new structure is limited two
levels of loop.

However, there is still some questions for behaviour:
- Should `N%2` be replaced with `N%step`?
- Should padding, i.e. inputs whose lengths are not a multiple of `step` be
  allowed? The input is not really periodic if it is padded, and doing so would
  reduce the whole function to two nested loops.

rgommers/pywt,ThomasA/pywt,aaren/pywt,rgommers/pywt,kwohlfahrt/pywt,eriol/pywt,ThomasA/pywt,kwohlfahrt/pywt,aaren/pywt,michelp/pywt,rgommers/pywt,PyWavelets/pywt,ThomasA/pywt,aaren/pywt,eriol/pywt,kwohlfahrt/pywt,michelp/pywt,PyWavelets/pywt,eriol/pywt,grlee77/pywt,grlee77/pywt,michelp/pywt,rgommers/pywt