I am basing my question on this post here, because I would like additional details on it, as I have not had any success in re-creating it.
I would like to simply learn, in no uncertain terms, how to do upsampling via the FFT. There seem to be a lot of details regarding if the signal is even or odd, where exactly to zero-pad, how much exactly, etc, and I am not getting those correct numbers for some reason.
Question: So let us say I have an even or odd length signal, of length $N$. I would like to upsample it to, say, $2N$, using FFTs.
How is this done exactly?
What I tried:
I tried following the post and others on the web but there seems to be very little consistency. It basically amounts to "zero-padding the frequency domain and then IFFTing" but I do not get proper results. In my case, I have a signal of length $100$, and I would like to upsample it to length $200$. So I do the following command:
ifft(fftshift([zeros(1,50) fftshift(fft(signal, 100)) zeros(1,50)]));
This however gives me complex data back, and not a signal that is simply upsampled by a factor of $2$. I am not sure where the problem is.