Downsampling and Upsampling Using FFTW
When you downsample a signal you must make sure that the Nyquist condition remains satisfied.

For example, say that signal $x$ has frequencies between $0-25$ Hz, and that the sampling frequency of $x$ is $100$ Hz. The Nyquist frequency is $100/2 = 50$ Hz, thus you could downsample $x$ by a factor of two with no problems.

Now, say that you would like to downsample $x$ by a factor of $4$ instead of $2$. This would mean that the new sampling frequency would be $25$ Hz. Since the new sampling frequency is $25$ Hz, it must not contain frequencies above $25/2=12.5$ Hz. However, $x$ had frequencies between $0-25$ so there would be aliasing. In order to avoid that, you must low-pass filter $x$ first between $0-12.5$ Hz.

The process of low-pass filtering + downsampling is called decimation. You can find more information about it on Wikipedia.

Upsampling would be basicly interpolation, so I would avoid that where possible. I did not look at the URLs you provided, please phrase your problem in full here.