function _1dFft (arr, dim) {
    const size = arraySize(arr)
    if (dim !== 0) return new Array(size[0]).fill(0).map((_, i) => _1dFft(arr[i], dim - 1))
    if (size.length === 1) return _fft(arr)
    function _transpose (arr) { // Swap first 2 dimensions
      const size = arraySize(arr)
      return new Array(size[1]).fill(0).map((_, j) => new Array(size[0]).fill(0).map((_, i) => arr[i][j]))
    }
    return _transpose(_1dFft(_transpose(arr), 1))
  }
Perform an 1-dimensional Fourier transform

@param {Array} arr      The array
@param {number} dim     dimension of the array to perform on
@return {Array}         resulting array