code: def hilbert2(x, N=None):
      """
      Compute the '2-D' analytic signal of `x`
  
      Parameters
      ----------
      x : array_like
          2-D signal data.
      N : int or tuple of two ints, optional
          Number of Fourier components. Default is ``x.shape``
  
      Returns
      -------
      xa : ndarray
          Analytic signal of `x` taken along axes (0,1).
  
      References
      ----------
      .. [1] Wikipedia, "Analytic signal",
          https://en.wikipedia.org/wiki/Analytic_signal
  
      """
      x = cp.atleast_2d(x)
      if x.ndim > 2:
          raise ValueError("x must be 2-D.")
      if cp.iscomplexobj(x):
          raise ValueError("x must be real.")
      if N is None:
          N = x.shape
      elif isinstance(N, int):
          if N <= 0:
              raise ValueError("N must be positive.")
          N = (N, N)
      elif len(N) != 2 or cp.any(cp.asarray(N) <= 0):
          raise ValueError(
              "When given as a tuple, N must hold exactly two positive integers"
          )
  
      Xf = cp.fft.fft2(x, N, axes=(0, 1))
  
      elements_dtype = cp.result_type(x[0].dtype, x[1].dtype)
      h1 = cp.empty((N[1],), dtype=elements_dtype)
      h2 = cp.empty((N[1],), dtype=elements_dtype)
      _hilbert2_kernel(h1, h2)
  
      h = h1[:, cp.newaxis] * h2[cp.newaxis, :]
      k = x.ndim
      while k > 2:
          h = h[:, cp.newaxis]
          k -= 1
      x = cp.fft.ifft2(Xf * h, axes=(0, 1))
      return x
  
imports: import cupy
  import numpy
  from cupyx.scipy import linalg
  from ..convolution.correlate import correlate
  from ..filter_design.filter_design_utils import _validate_sos
  from ..utils.arraytools import _axis_reverse, _axis_slice, _const_ext, _even_ext, _odd_ext
  from ..utils.helper_tools import _get_max_smem, _get_max_tpb
  from ._channelizer_cuda import _channelizer
  from ._sosfilt_cuda import _sosfilt
label_desc: Use image node_id 11 for calling a global function with example usage: hilbert2(x, N) and returns: x