fvtool
Builtin index · Signal processing
fvtool(filt, [n=512])
Input: filt, n · Output: no output
What it is
filt: a Model (kind "filter"); n (optional number, default 512). MATLAB's Filter Visualization Tool: a 2x2 figure (magnitude response in dB, phase, group delay, impulse response) built from freqz/group_delay/sosfilt. Callable as filt.fvtool().
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
fvtool(filt, [n=512]) | filt Modelfilt: a Model (kind "filter").n number, optional (default 512)n (optional number, default 512). | no output | MATLAB's Filter Visualization Tool: a 2x2 figure (magnitude response in dB, phase, group delay, impulse response) built from freqz/group_delay/sosfilt. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
fs = 1000
ep = ellip(4, 1, 40, "low", 100, fs)
c1 = cheby1(4, 1, "low", 100, fs)
c2 = cheby2(4, 40, "low", 100, fs)
print("ellip stable: {is_stable(ep)}, cheby1 stable: {is_stable(c1)}, cheby2 stable: {is_stable(c2)}")
fir = fir1(6, 100, kind="low", window="hamming", fs=fs)
b = fir.b
a = [1]
n = 0:1:255
t = n / fs
x = sin(2*pi*40*t) + sin(2*pi*300*t)
y = filter_ba(b, a, x)
y2 = lfilter(b, a, x) # lfilter is the same builtin under another name
print("filter_ba/lfilter agree: {max(abs(y - y2)) < 1e-12}")
lsq = firls(20, [0, 0.2, 0.3, 1.0], [1, 1, 0, 0]) # low-pass band edges/response
print("firls taps: {length(lsq.b)}")
gd = group_delay(fir, 256)
print("FIR group delay (should be ~order/2=3): {gd[10]}")
print("ellip filter has {length(poles(ep))} poles")
ep.fvtool() # 2x2 magnitude/phase/group-delay/impulse-response figure
pzplot(ep) # pole-zero plot with the unit circle and stability verdict
ellip stable: true, cheby1 stable: true, cheby2 stable: true filter_ba/lfilter agree: true firls taps: 21 FIR group delay (should be ~order/2=3): 3 ellip filter has 4 poles
from signal-processing
How it works
fvtool(filt, [n=512]) — MATLAB's own name (Filter Visualization Tool): a 2x2 diagnostic figure (magnitude/"gain" response in dB, phase, group delay, impulse response) built entirely from freqz/group_delay/sosfilt plus the existing panel(rows, cols, index) grid layout — no new rendering primitives needed. Callable as filt.fvtool() via the ordinary recv.method(args) sugar, same as any other function taking a model as its first argument.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.