cell2sos
Convert second-order sections cell array to matrix
Description
Examples
Second-Order Sections from Cell Array Input
Generate a 3-by-1 cell array of 1-by-2 cell arrays of 1-by-3 row vectors. Convert it to a matrix of second-order sections.
cll = {{[3 6 7] [1 1 2]} {[1 4 5] [1 9 3]} {[2 7 1] [1 7 8]}}; sos = cell2sos(cll)
sos = 3×6
3 6 7 1 1 2
1 4 5 1 9 3
2 7 1 1 7 8
Input Arguments
cll
— Second-order section cell-array representation
cell
Second-order section cell-array representation, specified as a cell array.
For a filter system with L sections, specify
cll
using this structure:
Cell array with L elements — For unity-gain filter systems. Each element of the cell array corresponds to a second-order section. The kth cell array element of
cll
contains the coefficients from the kth second-order-section of the filter system H(z):cll{k} = {[b_0k b_1k b_2k] [1 a_1k a_2k]}
Cell array with L+1 elements — If the gain of the filter system is different from 1. The first element of
cll
contains the system gains at the numerator (gn) and at the denominator (gd). Then, the function appends each element of the cell array for the corresponding second-order section.The first and the k+1th cell array element of
cll
contain the system gain and the coefficients from the kth second-order section of the filter system H(z), respectively, such that:cll{1} = {g_n g_d} cll{k+1} = {[b_0k b_1k b_2k] [1 a_1k a_2k]}
Example: cll = {{[2 4 2] [6 0 2]} {[3 3 0] [6 0 0]}}
specifies the
second-order-section coefficients of a third-order Butterworth filter with normalized 3
dB frequency 0.5π rad/sample in the cell array format.
Example: cll = {{7 5} {[2 4 2] [6 0 2]} {[3 3 0] [6 0 0]}}
specifies the second-order-section coefficients of a third-order Butterworth filter with
normalized 3 dB frequency 0.5π rad/sample and scalar gain value of 7/5 = 1.4, represented in the cell array format.
Data Types: double
Complex Number Support: Yes
Output Arguments
sos
— Second-order section representation
L-by-6 matrix
Second-order section representation, returned as an L-by-6 matrix, where L is the number of second-order sections. The matrix
represents the second-order sections of H(z):
g
— Scale gain
1
(default) | scalar
Scale gain, returned as a scalar.
If you specify
cll
as a cell array with L elements for a filter system with L sections, thecell2sos
function returnsg
as1
.If you specify
cll
as a cell array with L+1 elements for a filter system with L sections, thecell2sos
function returnsg
asg = g_n/g_d
, whereg_n
andg_d
come from the first element ofcll
.
Tips
You can use
cll = sos2cell(sos)
to perform the reverse operation ofsos = cell2sos(cll)
.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)