scaleFilterSections - Scale cascaded transfer functions with scale values - MATLAB (original) (raw)

Scale cascaded transfer functions with scale values

Since R2023b

Syntax

Description

[Bg](#mw%5F6fb30b33-7740-412a-8ac6-d4c78493c702) = scaleFilterSections([B](#mw%5Fcb482135-57d0-45ae-9305-18af420209fc),[g](#mw%5F4f4d110d-3653-47d0-bcd3-bbd5c48f99ea)) scales the sections of the numerator filter coefficients B represented with Cascaded Transfer Functions (CTF) by applying the scale values specified in g.

example

Examples

collapse all

Design a 14th-order elliptic bandpass digital filter with a lower passband frequency of π/5 rad/sample and a higher passband frequency of 3π/5 rad/sample. Specify 10 dB of passband ripple and 40 dB of stopband attenuation. Represent the filter using cascaded transfer functions.

N = 14; [B,A] = ellip(N/2,10,40,[0.2 0.6],"ctf")

B = 4×5

0.4184    0.0000   -0.4184         0         0
0.4184   -0.3351    0.1684   -0.3351    0.4184
0.4184   -0.4070    0.3842   -0.4070    0.4184
0.4184   -0.4158    0.4107   -0.4158    0.4184

A = 4×5

1.0000   -0.7094    0.8572         0         0
1.0000   -1.1435    1.4172   -1.0733    0.9081
1.0000   -1.0196    1.0568   -1.0091    0.9862
1.0000   -1.0010    1.0029   -0.9998    0.9984

Define scale values as a vector with incremental gains (1, 2, ..., L) for each of the L sections, and append the overall system gain as 0.5L. This vector makes the numerator coefficients be scaled by 0.5, 1, ..., 0.5L.

numSections = size(B,1); g = [1:numSections 0.5^(numSections)];

Use scaleFilterSections to scale the filter numerator coefficients so that the gain is uniformly distributed across all sections.

Bg = scaleFilterSections(B,g)

Bg = 4×5

0.2092    0.0000   -0.2092         0         0
0.4184   -0.3351    0.1684   -0.3351    0.4184
0.6276   -0.6105    0.5764   -0.6105    0.6276
0.8367   -0.8317    0.8215   -0.8317    0.8367

Visualize the frequency response.

Figure contains 2 axes objects. Axes object 1 with title Phase, xlabel Normalized Frequency (\times\pi rad/sample), ylabel Phase (degrees) contains an object of type line. Axes object 2 with title Magnitude, xlabel Normalized Frequency (\times\pi rad/sample), ylabel Magnitude (dB) contains an object of type line.

Input Arguments

collapse all

Unscaled CTF numerator filter coefficients, specified as a matrix.

Data Types: single | double
Complex Number Support: Yes

Scale values, specified as a scalar or a vector with L + 1 elements, where L is the number of filter sections in the cascade.

Data Types: single | double

Output Arguments

collapse all

Scaled CTF numerator filter coefficients, returned as a matrix of the same size asB.

See Algorithms for more information.

More About

collapse all

Partitioning an IIR digital filter into cascaded sections improves its numerical stability and reduces its susceptibility to coefficient quantization errors. The cascaded form of a transfer function H(z) in terms of the L transfer functions_H_1(z),_H_2(z), …,H L(z) is

Algorithms

The scaleFilterSections function scales the matrix B with a scalar or vector g and returns Bg as one of these:

References

[1] Lyons, Richard G. Understanding Digital Signal Processing. Upper Saddle River, NJ: Prentice Hall, 2004.

Version History

Introduced in R2023b