I'm implementing a very basic forward and inverse DWT, based on Mallat's book. Nothing fancy, simple inefficient matlab code (proof-of-concept more than runtime necessary, so I'm not focusing on optimisation). It almost works. I'm getting a distortion along the top and left edges. I'll
post link to (need 10 points to post) some pictures of lichtenstein to exhibit the behaviour.
* After 5 iterations.
* After some unpacking iterations, you can see the distortion along the top and left edges growing.
* Unpacked and distorted.
I'm using symmetric boundary conditions (I've implemented both whole and half, it doesn't make much of a difference) and Haar. Although using CDF has the same effect (the distortion is a little different, but same location along the entire edge). Since the rest of the picture is transformed and inverted perfectly, there is most likely nothing wrong with the implementation as a whole. It must be some kind of index offset. It is clear that the expansion of the distortion is dyadic - it doubles in size for every step of the inverse loop. Two days and lots of index changing has led to no breakthroughs.
I've pasted the code here (I realise it's unlikely people will want to preuse 100 lines of foreign code, but I'm a little desperate). It's pretty simple to run (although like I said it's slow - can take up to a minute to run):
Any code-based help or high-level diagnostic ideas would be appreciated.