Main Content

bocmod

Binary offset carrier modulation

    Description

    example

    y= bocmod(x,m,n)performs binary offset carrier (BOC) modulation on the input bitsxby using a square wave and returns the modulated symbolsy.mis the square wave frequency indicator.nis the input bit rate indicator.

    By default, the phasing of the square wave is set to the phase of the sine curve.

    y= bocmod(x,m,n,halfcyclesps)specifies the number of samples per half cycle of the square wave.

    example

    y= bocmod(x,m,n,halfcyclesps,phasing)specifies the phase of the square wave.

    Examples

    全部折叠

    Generate a random stream of input data bits to modulate.

    numBits = 5; bits = randi([0,1],numBits,1);

    Set the values ofmandnfor the subcarrier square wave.

    m = 2;%方波频率是m * 1.023 e6赫兹n = 2;% Square wave input bit rate is n*1.023e6 Hz

    Modulate the input bits with the square wave using the BOC modulation technique.

    sym = bocmod(bits,m,n)%违约定相的正弦曲线
    sym =20×1-1 -1 1 1 -1 -1 1 1 1 1 ⋮

    Generate a random stream of input data bits to modulate.

    numBits = 10; bits = randi([0,1],numBits,1);

    Set the values ofmandnfor the subcarrier square wave. Also specify the number of samples per square wave half cycle,spshc.

    m = 5; n = 2; spshc = 4;

    Modulate the input bits with the square wave using the BOC modulation technique.

    sym = bocmod(bits,m,n,spshc,"cos");

    可使ut Arguments

    全部折叠

    可使ut bits, specified as a column vector of binary values.

    The function maps an input bit value of0to+1and an input bit value of1to-1. It then multiplies the mapped symbols with a square wave by using the BOC modulation technique.

    Data Types:double|int8|logical

    Square wave frequency indicator, specified as a positive scalar.

    The frequency of square wave ism*1.023e6Hz.

    Note

    The value of2*m/nmust always be an integer. This value represents the number of square wave half cycles per input bit,x.

    Data Types:double

    可使ut bit rate indicator, specified as a positive scalar.

    The input bit rate isn*1.023e6Hz.

    Data Types:double

    Number of samples per half cycle of the square wave, specified as an integer greater than or equal to 2.

    Data Types:double|uint8

    Phase of the square wave, specified as"sin"or"cos".

    • "sin"— Set the phase of the square wave to the phase of a sine curve.

    • "cos"— Set the phase of the square wave to the phase of a cosine curve.

    Data Types:char|string

    Output Arguments

    全部折叠

    BOC modulated symbols, returned as a column vector. The length of the vector is equal tolength(x)*halfcyclesps*2*m/n. If you do not specifyhalfcyclesps, the value ofyis 2 by default.

    The data type of the returned modulated symbols is same as that of the input bits,x.

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2022a

    See Also

    |