qr decomposition for complex-凯发k8网页登录
qr decomposition for complex-valued matrices
since r2019b
libraries:
fixed-point designer hdl support /
matrices and linear algebra /
matrix factorizations
description
the complex burst qr decomposition block uses qr decomposition to compute r and c = q'b, where qr = a, and a and b are complex-valued matrices. the least-squares solution to ax = b is x = r\c. r is an upper triangular matrix and q is an orthogonal matrix. to compute c = q', set b to be the identity matrix.
when regularization parameter is nonzero, the
complex burst qr decomposition block transforms in-place to and in-place to where λ is the regularization parameter, qr is the
economy size qr decomposition of , a is an m-by-n
matrix, p is the number of columns in b,
in =
eye(n)
, and
0n,p =
zeros(n,p)
.
examples
ports
input
a(i,:) — rows of matrix a
vector
rows of matrix a, specified as a vector. a is an m-by-n matrix where m ≥ 2 and n ≥ 2. if b is single or double, a must be the same data type as b. if a is a fixed-point data type, a must be signed, use binary-point scaling, and have the same word length as b. slope-bias representation is not supported for fixed-point data types.
data types: single
| double
| fixed point
complex number support: yes
b(i,:) — rows of matrix b
vector
rows of matrix b, specified as a vector. b is an m-by-p matrix where m ≥ 2. if a is single or double, b must be the same data type as a. if b is a fixed-point data type, b must be signed, use binary-point scaling, and have the same word length as a. slope-bias representation is not supported for fixed-point data types.
data types: single
| double
| fixed point
complex number support: yes
validin — whether inputs are valid
boolean
scalar
whether inputs are valid, specified as a boolean scalar. this control signal
indicates when the data from the a(i,:)
and
b(i,:)
input ports are valid. when this value is 1
(true
) and the value at ready
is 1
(true
), the block captures the values on the
a(i,:)
and b(i,:)
input ports. when this
value is 0 (false
), the block ignores the input samples.
after sending a true
validin
signal, there may be some delay before
ready
is set to false
. to ensure all data is
processed, you must wait until ready
is set to
false
before sending another true
validin
signal.
data types: boolean
restart — whether to clear internal states
boolean
scalar
whether to clear internal states, specified as a boolean scalar. when this value
is 1 (true
), the block stops the current calculation and clears all
internal states. when this value is 0 (false
), and the
validin
value is 1 (true
), the block begins
a new subframe.
data types: boolean
output
r(i,:) — rows of matrix r
scalar | vector
rows of the economy size qr decomposition matrix r, returned as a scalar or vector. r is an upper triangular matrix. the size of the matrix r is min(m,n)-by-n. r has the same data type as a.
data types: single
| double
| fixed point
c(i,:) — rows of matrix c=q'b
scalar | vector
rows of the economy size qr decomposition matrix c=q'b, returned as a scalar or vector. c has the same number of rows as r. c has the same data type as b.
data types: single
| double
| fixed point
validout — whether output data is valid
boolean
scalar
whether the output data is valid, returned as a boolean scalar. this control
signal indicates when the data at output ports r(i,:)
and
c(i,:)
is valid. when this value is 1
(true
), the block has successfully computed the
r and c matrices. when this value is 0
(false
), the output data is not valid.
data types: boolean
ready — whether block is ready
boolean
scalar
whether the block is ready, returned as a boolean scalar. this control signal
indicates when the block is ready for new input data. when this value is 1
(true
), and the validin
value is 1
(true
), the block accepts input data in the next time step. when
this value is 0 (false
), the block ignores input data in the next
time step.
after sending a true
validin
signal, there may be some delay before
ready
is set to false
. to ensure all data is
processed, you must wait until ready
is set to
false
before sending another true
validin
signal.
data types: boolean
parameters
number of rows in matrices a and b — number of rows in matrices a and b
4
(default) | positive integer-valued scalar
the number of rows in matrices a and b, specified as a positive integer-valued scalar.
programmatic use
block parameter:
m |
type: character vector |
values: positive integer-valued scalar |
default:
4 |
number of columns in matrix a — number of columns in matrix a
4
(default) | positive integer-valued scalar
the number of columns in input matrix a, specified as a positive integer-valued scalar.
programmatic use
block parameter:
n |
type: character vector |
values: positive integer-valued scalar |
default:
4 |
number of columns in matrix b — number of columns in matrix b
1
(default) | positive integer-valued scalar
the number of columns in input matrix b, specified as a positive integer-valued scalar.
programmatic use
block parameter:
p |
type: character vector |
values: positive integer-valued scalar |
default:
1 |
regularization parameter — regularization parameter
0 (default) | real nonnegative scalar
regularization parameter, specified as a nonnegative scalar. small, positive values of the regularization parameter can improve the conditioning of the problem and reduce the variance of the estimates. while biased, the reduced variance of the estimate often results in a smaller mean squared error when compared to least-squares estimates.
programmatic use
block parameter:
regularizationparameter |
type: character vector |
values: real nonnegative scalar |
default:
0 |
tips
use fixed.getqrdecompositionmodel(a,b)
to generate a template model
containing a complex burst qr decomposition block for complex-valued input
matrices a
and b
.
algorithms
choosing the implementation method
partial-systolic implementations prioritize speed of computations over space constraints, while burst implementations prioritize space constraints at the expense of speed of the operations. the following table illustrates the tradeoffs between the implementations available for matrix decompositions and solving systems of linear equations.
implementation | ready | latency | area |
---|---|---|---|
systolic | c | o(n) | o(mn2) |
partial-systolic | c | o(m) | o(n2) |
partial-systolic with forgetting factor | c | o(n) | o(n2) |
burst | o(n) | o(mn2) | o(n) |
where c is a constant proportional to the word length of the data, m is the number of rows in matrix a, and n is the number of columns in matrix a.
for additional considerations in selecting a block for your application, see .
amba axi handshake process
this block uses the amba axi handshake protocol [1]. the valid/ready
handshake process is used to transfer data and control information. this two-way control mechanism allows both the manager and subordinate to control the rate at which information moves between manager and subordinate. a valid
signal indicates when data is available. the ready
signal indicates that the block can accept the data. transfer of data occurs only when both the valid
and ready
signals are high.
block timing
the burst qr decomposition blocks accept and process a and b matrices row by row synchronously. after accepting m rows, the block outputs the r and c matrices row by row continuously. the matrices are output from the last row to the first row.
for example, assume that the input a and b matrices
are 3-by-3. additionally assume that validin
asserts before
ready
, meaning that the upstream data source is faster than the qr
decomposition.
in the figure,
a1r1
is the first row of the first a matrix,r1r3
is the third row of the first r matrix, and so on.validin
toready
— from a successful row input to the block being ready to accept the next row.last row
validin
tovalidout
— from the last row input to the block starting to output the solution.validout
toready
— from the block starting to output the solution to the block ready to accept the next matrix input.
the burst q-less qr decomposition blocks accept and process the matrix a row by row. after accepting m rows, the block outputs the matrix r row by row continuously. the matrix is output from the last row to the first row.
for example, assume that the input a matrix is 3-by-3. additionally
assume that validin
asserts before ready
, meaning that
the upstream data source is faster than the qr decomposition.
in the figure,
a1r1
is the first row of the first a matrix,r1r3
is the third row of the first r matrix, and so on.validin
toready
— from a successful row input to the block being ready to accept the next row.last row
validin
tovalidout
— from the last row input to the block starting to output the solution.validout
toready
— from the block starting to output the solution to the block ready to accept the next matrix input.
the following table provides details of the timing for the burst qr decomposition blocks.
block | validin to ready (cycles) | last row validin to validout
(cycles) | validout to ready (cycles) |
---|---|---|---|
(wl 5)*min(m,n) 2 | (wl 5)*min(m,n) 2 | min(m,n) 1 | |
complex burst qr decomposition | (wl*2 11)*min(m,n) 2 | (wl*2 11)*min(m,n) 2 | min(m,n) 1 |
(wl 5)*min(m,n) 2 | (wl 5)*min(m,n) 2 | min(m,n) 1 | |
(wl*2 11)*min(m,n) 2 | (wl*2 11)*min(m,n) 2 | min(m,n) 1 |
in the table, m represents the number of rows in matrix a, and n is the number of columns in matrix a. wl represents the word length of a.
if the data type of a is fixed point, then wl is the word length.
if the data type of a is double, then wl is 53.
if the data type of a is single, then wl is 24.
hardware resource utilization
this block supports hdl code generation using the simulink® hdl workflow advisor. for an example, see (hdl coder) and implement digital downconverter for fpga (dsp hdl toolbox).
this example data was generated by synthesizing the block on a xilinx® zynq® ultrascale™ rfsoc zcu111 evaluation board. the synthesis tool was vivado® v.2020.2 (win64).
the following parameters were used for synthesis.
block parameters:
m = 16
n = 16
p = 1
matrix a dimension: 16-by-16
matrix b dimension: 16-by-1
input data type:
sfix16_en14
target frequency: 300 mhz
the following tables show the post place-and-route resource utilization results and timing summary, respectively.
resource | usage | available | utilization (%) |
---|---|---|---|
clb luts | 22713 | 425280 | 5.34 |
clb registers | 22469 | 850560 | 2.64 |
dsps | 0 | 4272 | 0.00 |
block ram tile | 0 | 1080 | 0.00 |
uram | 0 | 80 | 0.00 |
value | |
---|---|
requirement | 3.3333 ns |
data path delay | 3.149 ns |
slack | 0.166 ns |
clock frequency | 315.72 mhz |
references
[1] "amba axi and ace protocol specification version e."
extended capabilities
c/c code generation
generate c and c code using simulink® coder™.
slope-bias representation is not supported for fixed-point data types.
hdl code generation
generate verilog and vhdl code for fpga and asic designs using hdl coder™.
hdl coder™ provides additional configuration options that affect hdl implementation and synthesized logic.
this block has one default hdl architecture.
general | |
---|---|
constrainedoutputpipeline | number of registers to place at
the outputs by moving existing delays within your design. distributed
pipelining does not redistribute these registers. the default is
|
inputpipeline | number of input pipeline stages
to insert in the generated code. distributed pipelining and constrained
output pipelining can move these registers. the default is
|
outputpipeline | number of output pipeline stages
to insert in the generated code. distributed pipelining and constrained
output pipelining can move these registers. the default is
|
supports fixed-point data types only.
version history
introduced in r2019br2022a: support for tikhonov regularization parameter
the complex burst qr decomposition block now supports the tikhonov regularization parameter.
r2021a: reduced hdl resource utilization
this block now has an improved algorithm to reduce resource utilization on hardware-constrained target platforms.
see also
blocks
- | |
functions
topics
matlab 命令
您点击的链接对应于以下 matlab 命令:
请在 matlab 命令行窗口中直接输入以执行命令。web 浏览器不支持 matlab 命令。
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
- (español)
- (english)
- (english)
europe
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
asia pacific
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)