Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.fft.irfft2

Contents

jax.numpy.fft.irfft2#

jax.numpy.fft.irfft2(a,s=None,axes=(-2,-1),norm=None)[source]#

Compute a real-valued two-dimensional inverse discrete Fourier transform.

JAX implementation ofnumpy.fft.irfft2().

Parameters:
  • a (ArrayLike) – input array. Must havea.ndim>=2.

  • s (Shape |None) – optional length-2 sequence of integers. Specifies the size of the outputin each specified axis. If not specified, the dimension of output alongaxisaxes[1] is2*(m-1),m is the size of input along axisaxes[1] and the dimension along other axes will be the same as that ofinput.

  • axes (Sequence[int]) – optional length-2 sequence of integers, default=(-2,-1). Specifies theaxes along which the transform is computed.

  • norm (str |None) – string, default=”backward”. The normalization mode. “backward”, “ortho”and “forward” are supported.

Returns:

A real-valued array containing the two-dimensional inverse discrete Fouriertransform ofa.

Return type:

Array

See also

Examples

jnp.fft.irfft2 computes the transform along the last two axes by default.

>>>x=jnp.array([[[1,3,5],...[2,4,6]],...[[7,9,11],...[8,10,12]]])>>>jnp.fft.irfft2(x)Array([[[ 3.5, -1. ,  0. , -1. ],        [-0.5,  0. ,  0. ,  0. ]],       [[ 9.5, -1. ,  0. , -1. ],        [-0.5,  0. ,  0. ,  0. ]]], dtype=float32)

Whens=[3,3], dimension of the transform alongaxes(-2,-1) will be(3,3) and dimension along other axes will be the same as that of input.

>>>withjnp.printoptions(precision=2,suppress=True):...jnp.fft.irfft2(x,s=[3,3])Array([[[ 1.89, -0.44, -0.44],        [ 0.22, -0.78,  0.56],        [ 0.22,  0.56, -0.78]],       [[ 5.89, -0.44, -0.44],        [ 1.22, -1.78,  1.56],        [ 1.22,  1.56, -1.78]]], dtype=float32)

Whens=[2,3] andaxes=(0,1), shape of the transform alongaxes(0,1) will be(2,3) and dimension along other axes will besame as that of input.

>>>withjnp.printoptions(precision=2,suppress=True):...jnp.fft.irfft2(x,s=[2,3],axes=(0,1))Array([[[ 4.67,  6.67,  8.67],        [-0.33, -0.33, -0.33],        [-0.33, -0.33, -0.33]],       [[-3.  , -3.  , -3.  ],        [ 0.  ,  0.  ,  0.  ],        [ 0.  ,  0.  ,  0.  ]]], dtype=float32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp