Generate Barker code
BarkerCode object generates Barker codes
to perform synchronization. Barker codes are
subsets of PN sequences. They are short codes, with a length at most
13, which have low-correlation sidelobes. A correlation
sidelobe is the correlation of a codeword with a time-shifted
version of itself.
To synchronize using a Barker code:
Starting in R2016b, instead of using the
to perform the operation defined by the System
object™, you can
call the object with arguments, as if it were a function. For example,
= step(obj) and
y = obj() perform equivalent
H = comm.BarkerCode creates a Barker code
H, that generates
a Barker code of a specified length.
H = comm.BarkerCode( creates
a Barker code generator object,
H, with each specified
property set to the specified value. You can specify additional name-value
pair arguments in any order as (
Length of generated code
Specify the length of the Barker code as a numeric, integer
scalar in the set
Number of output samples per frame
Specify the number of Barker code samples that the
Data type of output
Specify the output data type as one of
|reset||Reset states of Barker code generator object|
|step||Generate Barker code|
Create a Barker code object having 10 samples per frame.
barker = comm.BarkerCode('SamplesPerFrame',10)
barker = comm.BarkerCode with properties: Length: 7 SamplesPerFrame: 10 OutputDataType: 'double'
Generate the Barker code sequence.
seq = barker()
seq = -1 -1 -1 1 1 -1 1 -1 -1 -1
This object implements the algorithm, inputs, and outputs described on the Barker Code Generator block reference page. The object properties correspond to the block parameters, except:
The block Sample time parameter does not have a corresponding property.
The object only implements frame based outputs.
Usage notes and limitations:
See System Objects in MATLAB Code Generation (MATLAB Coder).