function _ndFft (arr) {
    const size = arraySize(arr)
    if (size.length === 1) return _fft(arr, size[0])
    // ndFft along dimension 1,...,N-1 then 1dFft along dimension 0
    return _1dFft(arr.map(slice => _ndFft(slice, size.slice(1))), 0)
  }
Perform an N-dimensional Fourier transform

@param {Array} arr      The array
@return {Array}         resulting array