RunMat
GitHub

freqz — Evaluate digital filter frequency response.

freqz(b, a, n) evaluates the complex frequency response of a digital filter at n points between 0 and Nyquist. With fs, returned frequencies are in Hz instead of radians/sample.

Syntax

freqz(b, a, n)

How freqz works

  • Default response length is 512 samples.
  • [H, w] = freqz(...) returns complex response H and frequency vector w as column vectors.
  • Without fs, w is in radians/sample over [0, pi).
  • With fs, w is in Hz over [0, fs/2).

Does RunMat run freqz on the GPU?

Host-side analysis only.

GPU coefficient inputs are gathered before evaluation.

Examples

Evaluate a simple FIR response

[H, w] = freqz([1 1], 1, 4);
fprintf('%.1f %.1f %.4f\n', real(H(1)), imag(H(3)), w(3));

Expected output:

2.0 -1.0 1.5708

Evaluate a response in Hz

b = fir1(20, 0.25);
[H, f] = freqz(b, 1, 8, 1000);
fprintf('%.1f %.1f\n', f(1), f(end));

Expected output:

0.0 437.5

Using freqz with coding agents

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

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

FAQ

Does freqz include the Nyquist point?

The supported numeric n form samples n points over [0, pi), matching the common one-sided response grid used by MATLAB's freqz(b,a,n) form.

Can freqz analyze IIR filters?

Yes. Pass numerator b and denominator a; freqz evaluates the transfer function directly on the unit circle.

Elementwise

abs · angle · complex · conj · double · exp · expm1 · factorial · gamma · heaviside · hypot · imag · ldivide · log · log10 · log1p · log2 · minus · nextpow2 · plus · pow2 · power · rdivide · real · sign · single · sqrt · times

Trigonometry

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

Reduction

all · any · cummax · cummin · cumprod · cumsum · cumtrapz · diff · gradient · max · mean · median · min · nnz · prod · std · sum · trapz · var

Rounding

ceil · fix · floor · mod · rem · round

Factor

chol · eig · lu · qr · svd

Solve

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

Fft

fft · fft2 · fftshift · ifft · ifft2 · ifftshift

Interpolation

interp1 · interp2 · pchip · ppval · spline

Symbolic

limit · sym · syms

Ode

ode15s · ode23 · ode45

Open-source implementation

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

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.