Up/down sample an image/matrix/vector (can be of complex numbers) using the frequency domain.
The matrix/vector should be continuous of a high degree (has continuous derivatives) in order to obtain a reasonable up/down sampling
Speed-up can be achieved if the user up-samples to a near power of 2. no optimization is done inside this code for efficient fft usage.
Well, technically speaking the code is correct - in terms of what _exactly_ is it doing. The code claims to do downSAMPLING, which is just throwing away specified frequencies. Unlike the _decimation_, which uses the low-pass filtering to mitigate the downsampling effects (slower and more complicated).
The effect that you experiencing in this example is called ringing, and this exactly what happens in up/downsampling without filtering.