# Clock Generator

Generate clock signal with one or more phases

• Library:
• Mixed-Signal Blockset / Utilities

## Description

The Clock Generator block generates clock signal with multiple output phases and detailed phase noise modeling. Each output is modeled using two ports: a saturated clock signal and a clock transition time. The block allows you to model any clock recovery loop that uses a voltage controlled oscillator (VCO). The block consistently provides clock times for which the noise floor is below -150 dBC/Hz. Using the block, you can also include phase noise that matches a physical model.

## Ports

### Input

expand all

Voltage to control the output frequency, specified as a scalar or vector.

Data Types: `double`

Reference frequency offset to be used, specified as a scalar. If ReferenceOffsetPort is selected, the ReferenceOffset port accepts the reference offset value from an external block.

Data Types: `double`

Duty cycle phase offset to be used, specified as a scalar. If PhaseOffsetPort is selected, the PhaseOffset port accepts the phase offset value from an external block.

Data Types: `double`

### Output

expand all

The saturated output clock signal, returned as a scalar. There is one clockN output port for each output phase. The label N indicates the clock phase and is a nonnegative scalar. The output is a square wave whose amplitude is defined by the Output amplitude parameter.

Data Types: `double`

The simulation time at which the last clock transition occurred, returned as a scalar. There is one clockTimeN output port for each output phase. The label N indicates the clock phase and is a nonnegative scalar.

Data Types: `double`

The most recent clock phase of the fundamental clock, returned as a scalar.

Data Types: `double`

Variable step discrete sampled clock, specified as a scalar. The edge sample times of the signal in the clockValid port exactly match the values in the clock time signal

Data Types: `double`

Absolute clock time of the most recent clock change in the clockValid port.

Data Types: `double`

## Parameters

expand all

Main

Define how the control sensitivity of the clock generator is specified:

• Select `Voltage sensitivity` to specify output frequency from the Voltage sensitivity (Hz/V) and Free running frequency (Hz) parameters.

• Select `Output frequency vs. control voltage` to interpolate output frequency from the Control voltage (V) vector versus Output frequency (Hz) vector.

• Select `Period offset` to adjust the cycle time by a fraction of an nominal clock period. The fraction is indicated by the Control voltage (V) parameter. The Voltage sensitivity (Hz/V) and theFree running frequency (Hz) are determined from Symbol time (s).

#### Programmatic Use

 Block parameter: `SpecifyUsing` Type: character vector Values: `Voltage sensitivity` | ```Output frequency vs. control voltage``` | `Period offset` Default: `Voltage sensitivity`

Measure of change in output frequency for input voltage change, specified as a positive real scalar with units in Hz/V.

#### Programmatic Use

 Block parameter: `Kvco` Type: character vector Values: positive real scalar Default: `100e6`

Data Types: `double`

Frequency of the clock generator without any control voltage input (`0` V) or the quiescent frequency, specified as a positive real scalar in hertz.

#### Programmatic Use

 Block parameter: `Fo` Type: character vector Values: positive real scalar Default: `10e9`

Data Types: `double`

Control voltage values of the clock generator, specified as a real valued vector in volts.

#### Programmatic Use

 Block parameter: `ControlVoltage` Type: character vector Values: real valued vector Default: `[-5 0 5]`

Data Types: `double`

Output frequency of the clock generator corresponding to the Control voltage (V) vector, specified in hertz.

#### Programmatic Use

 Block parameter: `OutputFrequency` Type: character vector Values: positive real valued vector Default: `[9.9e9 10e9 10.5e9]`

Data Types: `double`

Maximum amplitude of the clock generator output voltage, specified as a positive real scalar.

#### Programmatic Use

 Block parameter: `Amplitude` Type: character vector Values: positive real scalar Default: `1`

Data Types: `double`

The units of the output phase and duty cycle, specified as `Degrees` or ```Fraction of a clock cycle```.

#### Programmatic Use

 Block parameter: `PhaseUnits` Type: character vector Values: `Degrees` | ```Fraction of a clock cycle``` Default: `Degrees`

The phases of the output clock signals, specified as a scalar vector. If specified as a vector, each element defines one output.

#### Programmatic Use

 Block parameter: `OutputPhase` Type: character vector Values: nonnegative real scalar | nonnegative real valued vector Default: `[0]`

The duty cycles of the output clock signals, specified as a scalar or a vector. The clock output phase refers to the rising edge of the output clock.

If specified as a vector, each element defines one output. Missing or empty elements of the vector are given the default duty cycle. Extra elements are ignored.

The duty cycle must be greater than but less than , defined as a fraction of clock cycle.

#### Programmatic Use

 Block parameter: `OutputDutyCycle` Type: character vector Values: positive real scalar | positive real valued vector Default: `[180]`

Define the duty cycle phase offset through PhaseOffset input port from an external block. If you deselect the PhaseOffsetPort parameter, it is removed from the AMI files. This effectively hard-codes phase offset to the value defined by the .Phase offset (symbol time) parameter.

Duty cycle phase offset, specified as a scalar in the range [-0.5, 0.5] in fraction of symbol time. Phase offset manually shifts clock probability distribution function (PDF) for better bit error rate (BER)..

#### Dependencies

To enable this parameter, deselect PhaseOffsetPort.

#### Programmatic Use

 Block parameter: `PhaseOffset` Type: character vector Values: scalar Default: `0`

Define the reference frequency offset through ReferenceOffset input port from an external block. If you deselect the ReferenceOffsetPort parameter, it is removed from the AMI files. This effectively hard-codes Reference offset to the value defined by the .Reference clock frequency offset (ppm) parameter.

The factor by which the nominal output frequency is to be offset from , specified as a scalar in the range of [-300,300] in unit of parts per million. It is the deviation between the transmitter oscillator frequency and the receiver oscillator frequency

#### Dependencies

To enable this parameter, deselect ReferenceOffsetPort.

#### Programmatic Use

 Block parameter: `ReferenceOffset` Type: character vector Values: scalar in the range of [-300,300] Default: `0`

Select the simulation mode. This choice affects the simulation performance.

Simulating the model using the `Code generation` method requires additional startup time, but the subsequent simulations run faster. Simulating the model using the `Interpreted execution` method may reduce the startup time, but the subsequent simulations run slower. For more information, see Simulation Modes.

#### Programmatic Use

 Block parameter: `SimulateUsing` Type: character vector Values: `Code generation`| ```Interpreted execution``` Default: `Code generation`
Phase Noise

Select to introduce phase noise as a function of frequency. By default, this option is selected.

The frequency offsets of the specified phase noise from the carrier frequency, specified as a positive real valued vector in hertz.

#### Dependencies

To enable this parameter, select Add phase noise in the Impairments tab.

#### Programmatic Use

 Block parameter: `Foffset` Type: character vector Values: positive real valued vector Default: `[30e3 100e3 1e6 3e6 10e6]`

Data Types: `double`

The specified phase noise power in a 1 Hz bandwidth centered at the phase noise frequency offsets relative to the carrier, specified as a negative real valued vector in dBc/Hz. The elements of Phase noise level correspond to relative elements in the Phase noise frequency offset (Hz) parameter.

#### Dependencies

To enable this parameter, select Add phase noise in the Impairments tab.

#### Programmatic Use

 Block parameter: `PhaseNoise` Type: character vector Values: negative real valued vector Default: `[-56 -106 -132 -143 -152]`

Data Types: `double`

Click to estimate the phase noise parameters from the phase noise measured phase noise data. This calculates the Period jitter (S) and Flicker corner frequency (Hz) parameters from the Phase noise frequency offset (Hz) and Phase noise level (dBc/Hz) parameters. As a result, the phase noise profile matches a physical model.

Standard deviation of the period jitter, specified as a positive real scalar in seconds. Period jitter is the deviation in cycle time of a clock signal with respect to the ideal period.

#### Programmatic Use

 Block parameter: `PeriodJitter` Type: character vector Values: positive real scalar Default: `1.7e-15`

Corner frequency of the flicker noise, specified as a scalar in hertz. Flicker corner frequency (Hz) is defined as the frequency at which the phase noise transitions from 1/f2 to 1/f3 due to flicker noise. At this frequency, the spectral densities of period jitter and flicker noise are equal.

#### Programmatic Use

 Block parameter: `CornerFrequency` Type: character vector Values: scalar Default: `0`

Select this parameter to customize the power spectral distribution of the flicker noise. Traditionally, flicker noise is defined as the 1/f noise, but it can vary as 1/fV, where 0.8<V<1.5.

Flicker noise power exponent, specified between `0.8` to `1.5`.

#### Programmatic Use

 Block parameter: `FlickerExponent` Type: character vector Values: `1.0` | `0.8` | `0.9` | `1.1` | `1.2` | `1.3` | `1.4` | `1.5` Default: `1.0`

Click to plot the fitted phase noise profile. This allows you how the fitted model matches the specified phase noise data.

Time of a single symbol duration, specified as a real positive scalar in seconds.

#### Programmatic Use

 Block parameter: `SymbolTime` Type: character vector Values: real positive scalar Default: `100e-12`

Data Types: `double`

Uniform time step of the waveform, specified as a real positive scalar in seconds.

#### Programmatic Use

 Block parameter: `SampleInterval` Type: character vector Values: real positive scalar Default: `6.25e-12`

Data Types: `double`

Number of logic levels in the modulation scheme:

• Select `2` if the modulation scheme is NRZ(non-return to zero).

• Select `3` if the modulation scheme PAM3 (pulse amplitude modulation level 3).

• Select `4` if the modulation scheme PAM4 (pulse amplitude modulation level 4).

#### Programmatic Use

 Block parameter: `Modulation` Type: character vector Values: `2`.| `3` | `4` Default: `2`

Data Types: `char`

Type of input waveform, either a sample by sample signal or an impulse response signal.

#### Programmatic Use

 Block parameter: `WaveType` Type: character vector Values: `Sample`.| `Impulse` Default: `Sample`