MATLAB: Zero padding in frequency domain causes noise in time domain

fft oversampling

Hello everybody,
I have a problem by zeropadding a signal in frequency domain to get a higher sampling rate in the time domain. The oversampled result in time domain gets additional noise (see figure).
Is there a way to oversample "my" signal without this additional noise?
Here is my code:
% B1: input signal with 128 samples
z = fft(B1);
% pad high frequency
zp = fftshift(z);
zp(1) = zp(1)/2;
zp(end+1) = zp(1);
zp = ifftshift([zeros(1,64),zp,zeros(1,63)]);
% resampling and renormalization
B2 = ifft(zp)*2;
Many thanks Chris

Best Answer

The FFT-upsampling that you are doing is equivalent to sinc-interpolation. What you seem to be interpreting as "additional noise" is really just the non-monotonic character of sinc interpolation. I.e., sinc interpolators don't necessarily connect adjacent data points with monotonic curves, so you can get additional peaks and valleys in the upsampled signal.
If you want monotonically connected data points, you can use interp1 to do linear or shape-preserving cubic interpolation.
Related Question