RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • fft
    • fft2
    • fftn
    • fftshift
    • ifft
    • ifft2
    • ifftn
    • ifftshift

ifft — Compute inverse discrete Fourier transforms in MATLAB and RunMat.

ifft(X) computes the inverse discrete Fourier transform of X. By default it operates along the first non-singleton dimension, with optional length, dimension, and symmetry forms following MATLAB semantics. Documented integer data through 32 bits produces double output. Host int64 and uint64 data and wide typed controls are exactness-checked RunMat extensions.

Syntax

Y = ifft(X)
Y = ifft(X, N)
Y = ifft(X, symflag)
Y = ifft(X, N, DIM)
Y = ifft(X, N, symflag)
Y = ifft(X, N, DIM, symflag)

Inputs

NameTypeRequiredDefaultDescription
XAnyYes—Input spectrum or signal.
NNumericScalarNo[]Transform length along selected dimension.
symflagStringScalarNo"nonsymmetric"Symmetry flag: "symmetric" or "nonsymmetric".
DIMNumericScalarNofirst non-singleton dimensionDimension to transform along.

Returns

NameTypeDescription
YNumericArrayInverse FFT result.

Errors

IdentifierWhenMessage
RunMat:ifft:ArgCountMore than four input arguments are supplied.ifft: invalid argument count
RunMat:ifft:InvalidLengthLength argument N is invalid.ifft: invalid length argument
RunMat:ifft:InvalidDimensionDimension argument DIM is invalid.ifft: invalid dimension argument
RunMat:ifft:InvalidSymflagSymmetry flag is invalid or appears in an invalid position.ifft: invalid symmetry flag usage
RunMat:ifft:InvalidInputInput cannot be converted to supported numeric/complex domain.ifft: invalid input
RunMat:ifft:InternalIFFT execution or tensor shaping fails.ifft: internal error
RunMat:ifft:ProviderIntegrityThe provider returns ownership, shape, or physical metadata inconsistent with the request.ifft: provider integrity error

How ifft works

  • ifft(X) transforms along the first dimension whose size is greater than 1.
  • ifft(X, N) zero-pads or truncates X to length N before applying the transform.
  • ifft(X, N, DIM) applies the transform along dimension DIM.
  • ifft(X, [], DIM) keeps the existing length and transforms along dimension DIM.
  • ifft(..., 'symmetric') forces the output to be real-valued, mirroring MATLAB's handling of conjugate-symmetric spectra.
  • ifft(..., 'nonsymmetric') keeps the default complex result; it is equivalent to omitting the symmetry flag but is accepted for MATLAB compatibility.
  • Documented integer data (int8 through int32 and uint8 through uint32) crosses once into the double transform domain and returns double numeric class; the symmetry flag changes complexity, not numeric class.
  • Host int64 and uint64 data is available only in RunMat extension mode and must be exactly representable as double. Resident wide-integer data rejects before gather because no exact provider transform is available.
  • Typed int64 and uint64 length or dimension controls are independently gated RunMat extensions and are parsed from exact integer storage.
  • Empty inputs and dimensions larger than the rank of X mirror MATLAB behaviour.

Does RunMat run ifft on the GPU?

For floating input, RunMat asks the input owner for ifft_dim and accepts only a fresh, nonaliased output with the expected device, shape, complex storage, precision, and ownership. Provider execution or contract failures are terminal; only the exact unsupported-hook response selects host fallback.

The symmetric form safely downloads the validated inverse-FFT result, extracts the real component in its native class, and restores a fresh real handle when the owner preserves that class. This avoids relying on provider-specific physical complex-buffer shapes.

Zero-length, logical, and documented resident integer inputs use the exact host transform path. F32 floating inputs preserve single precision; integer and logical inputs produce double output and stay on the host when an F32-only provider cannot represent that class.

GPU memory and residency

RunMat resolves execution and fallback through the provider that owns the input handle. Internal downloads do not change the source handle's class metadata. Host fallback results return to the owner only when its physical precision preserves the required output class; documented integer and logical inputs therefore remain double host results on an F32-only owner.

Examples

Reconstructing a time-domain signal from FFT bins

Y = [10  -2+2i  -2  -2-2i];
x = ifft(Y)

Expected output:

x =
  Columns 1 through 4
       1     2     3     4

Computing ifft along a specific dimension

F = [10  14  18;
     -3+3i  -3+3i  -3+3i];
X = ifft(F, [], 1)

Zero-padding the inverse transform

F = [4 0 0 0];
x = ifft(F, 8)

Enforcing a real result with 'symmetric'

F = fft([1 2 3 4]);
x = ifft(F, 'symmetric')

Running ifft on gpuArray inputs

G = gpuArray(fft([1 0 0 0]));
X = ifft(G);
result = gather(X)

Using ifft with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how ifft changes the result.

Run a small ifft example, explain the result, then change one input and compare the output.

FAQ

Does ifft always return complex values?⌄

By default, yes. The 'symmetric' flag converts the result to a real array when the spectrum is conjugate-symmetric. You can also pass 'nonsymmetric' to state this default explicitly while keeping the complex result.

How does ifft scale the result?⌄

RunMat divides by the transform length so that ifft(fft(x)) reproduces x, matching MATLAB.

Can I omit the length but specify a dimension?⌄

Yes. Use an empty array for the length: ifft(X, [], DIM).

What happens if I request a zero length?⌄

You receive an empty array along the selected dimension, mirroring MATLAB behaviour.

Does 'symmetric' validate conjugate symmetry?⌄

No. Like MATLAB, RunMat assumes the spectrum is conjugate-symmetric and simply discards imaginary components.

Will RunMat run the inverse FFT on the GPU automatically?⌄

When the input owner exposes a compatible ifft_dim kernel, nonsymmetric results remain resident after provider metadata and ownership validation. Unsupported hooks fall back through an internal owner download. RunMat restores the result to that owner when its physical precision matches the required output class; otherwise it returns the correctly typed host result instead of relabeling lower-precision storage.

How do I perform multi-dimensional inverse transforms?⌄

Apply ifft sequentially along each dimension (e.g., ifft(ifft(X, [], 1), [], 2)).

Related Math functions

Fft

fft · fft2 · fftn · fftshift · ifft2 · ifftn · ifftshift

Elementwise

abs · angle · bsxfun · complex · conj · double · erf · erfcinv · exp · expm1 · factorial · flintmax · gamma · gammaln · heaviside · hypot · idivide · imag · intmax · intmin · ldivide · log · log10 · log1p · log2 · minus · nextpow2 · plus · pow2 · power · rdivide · real · realmax · realmin · realsqrt · rescale · sign · single · sqrt · swapbytes · times · typecast · uint16 · uint32 · uint8

Trigonometry

acos · acosh · asin · asinh · atan · atan2 · atanh · cos · cosd · cosh · cospi · deg2rad · pol2cart · rad2deg · sin · sind · sinh · sinpi · tan · tand · tanh

Reduction

all · any · bounds · cummax · cummin · cumprod · cumsum · cumtrapz · diff · gradient · max · maxk · mean · median · min · mink · movmax · movmean · movmedian · movmin · movprod · movstd · movsum · movvar · nnz · prod · rms · std · sum · trapz · var

Structure

bandwidth · isdiag · ishermitian · issymmetric · istril · istriu · symrcm

Signal

blackman · butter · buttord · cheb2ord · conv · conv2 · deconv · downsample · envelope · filter · filtfilt · fir1 · freqz · gauspuls · hamming · hann · hilbert · periodogram · pulstran · pwelch · rectpuls · resample · sawtooth · sinc · spectrogram · square · tripuls · unwrap · upsample · zplane

Rounding

ceil · fix · floor · mod · rem · round

Factor

chol · decomposition · eig · eigs · lu · qr · svd

Solve

cond · det · inv · linsolve · norm · null · pinv · rank · rcond · rref · vecnorm

Optim

coneprog · fminbnd · fminunc · fsolve · fzero · integral · linprog · lsqcurvefit · lsqnonlin · optimoptions · optimset · quad · secondordercone

Ops

cross · ctranspose · dot · mldivide · mpower · mrdivide · mtimes · pagemtimes · pagetranspose · trace · transpose

Symbolic

digits · int · limit · piecewise · sym · syms · vpa

Interpolation

griddedInterpolant · interp1 · interp1q · interp2 · pchip · ppval · spline

Discrete

lcm · primes

Ode

ode15s · ode23 · ode45

Poly

polyder · polyfit · polyint · polyval · roots

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how ifft is executed, line by line, in Rust.

  • View the source for ifft in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How ifft works
  • Does RunMat run ifft on the GPU?
  • GPU memory and residency
  • Examples
  • Reconstructing a time-domain signal from FFT bins
  • Computing ifft along a specific dimension
  • Zero-padding the inverse transform
  • Enforcing a real result with 'symmetric'
  • Running ifft on gpuArray inputs
  • Using ifft with coding agents
  • FAQ
  • Related Math functions
  • Fft
  • Elementwise
  • Trigonometry
  • Reduction
  • Structure
  • Signal
  • Rounding
  • Factor
  • Solve
  • Optim
  • Ops
  • Symbolic
  • Interpolation
  • Discrete
  • Ode
  • Poly
  • Open-source implementation
  • About RunMat