Q:

How can I obtain a zero-filled Fourier transform, as produced by MATLAB's fft?

The MATLAB FFT function, fft(X,n), can be used to return the n-point DFT. This effectively extends the original signal, X, to n points if n is larger than the dimension of X. But, with the Fourier function in Mathematica, the transform always has the same dimensions as X. So, how can I obtain the same behaviour in Mathematica as implemented in MATLAB?

A:

Based on the MATLAB documentation, it would appear that this is accomplished by simple zero-filling. As such, you can obtain the same result in Mathematica using
Fourier[PadRight[list, n, 0.], FourierParameters -> {1, -1}]

where list is your signal and n is the desired length. For a multidimensional FFT, replace n with {n1, n2, ...}, where n1, n2, &c., are the lengths at each level. FourierParameters -> {1, -1} is not necessary to obtain the zero-filled transform, but accounts for the different normalization factors used by each program, so that the result will now be identical to that given by MATLAB.
N.B.: specifying 0. as the padding specification (rather than the default of simply 0) ensures that a packed array is produced by PadRight when one is given in the input.

