Engee documentation

Upsample

Increases the sampling rate of the input signal by adding intermediate values.

blockType: Upsample

Path in the library:

/Signal Operations/Signal Operations/Upsample

Description

Block Upsample increases the sampling rate of each input channel (size Mi by N) in once by inserting zeros between adjacent values of the input signal, where — parameter value Upsample factor, L.

Ports

Input

# IN_1 — Input signal
scalar | vector | matrix

Details

The input signal is in the form of a scalar, vector or matrix.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Complex numbers support

Yes

Output

# OUT_1 — Output signal
scalar | vector | matrix

Details

The output signal has the same type and complexity as the input signal. The dimension of the output signal depends on the value of the parameter Upsample factor, L and parameter values Rate options.

If for the parameter Upsample factor, L the value is set , and for Rate options the value is set:

  • Enforce single-rate processing, then the unit maintains the input sampling rate and increases the size of the output frame in once.

  • Allow multirate processing, then the unit increases the sampling rate of the signal in such a way that the output sampling rate was in times more than the input sampling rate. The size of the output frame is the same as that of the input signal.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Complex numbers support

Yes

Parameters

Parameters

# Upsample factor, L — the increase in sampling rate
Real or complex number

Details

The increase in sampling rate , by which you need to increase the input sampling rate, set as a positive integer.

Default value

3

Program usage name

UpsampleFactor

Tunable

No

Evaluatable

Yes

# Sample offset, [0, L-1] — offset of counts
Real or complex number

Details

Set the offset of the counts as an integer in the range `[0, L−1]'.

Use the parameter Sample offset, [0, L-1] to delay the output counts by a set number of periods. This allows you to select any of the possible output phases.

Default value

0

Program usage name

SampleOffset

Tunable

No

Evaluatable

Yes

# Input processing — input signal processing method
Columns as channels (frame based) | Elements as channels (sample based)

Details

Specify the input processing method:

  • Columns as channels (frame based) — the block processes each input column as a separate channel. In this mode, the unit can perform single-speed or multi-speed processing.

  • Elements as channels (sample based) — the block processes each input element as a separate channel. In this mode, the block always performs multi-speed processing.

For more information, see Signal processing by frames and counts.

Values

Columns as channels (frame based) | Elements as channels (sample based)

Default value

Elements as channels (sample based)

Program usage name

InputProcessing

Tunable

No

Evaluatable

No

# Rate options — the method by which the block increases the sampling rate of the input
Enforce single-rate processing | Allow multirate processing

Details

Specify the method by which the block increases the sampling rate of the input. You can choose one of the following options:

  • Enforce single-rate processing — the unit supports the input sampling rate, increasing the size of the output frame in once.

  • Allow multirate processing — the unit increases the sampling frequency of the signal in such a way that the output sampling frequency in times more than the input sampling rate.

Dependencies

To use this parameter, set for the parameter Input processing meaning Columns as channels (frame based).

Values

Enforce single-rate processing | Allow multirate processing

Default value

Allow multirate processing

Program usage name

RateOptions

Tunable

No

Evaluatable

No

# Initial condition — initial value
Scalar / array of real and/or complex numbers

Details

The value of the output signal at the beginning of the simulation. If this parameter is set as a vector or matrix, its size must be the same as that of the input signal. This parameter is used if you configure the block to perform multi-speed processing.

Dependencies

To use this parameter, set for the parameter Rate options meaning Allow multirate processing.

Default value

0

Program usage name

InitialCondition

Tunable

No

Evaluatable

Yes

More detailed

Frame-based processing

Details

When you set for the parameter Input processing meaning Columns as channels (frame based) the block increases the sampling rate of each column of input data over time. In this mode, the unit can perform both single-speed and multi-speed processing. Parameter Rate options allows you to specify how the block increases the sampling rate of the input data.

  • When you set for the parameter Rate options meaning Enforce single-rate processing, the input and output data of the block will have the same sampling rate. In this mode, the unit outputs a signal with a proportionally larger frame size than the input one. When the sampling rate is increased by a factor of the size of the output frame in times the size of the input ( ), but the input and output frame rates are equal.

  • When you set for the parameter Rate options meaning Allow multirate processing, the block processes an input matrix of size on how independent channels. The block increases the sampling of each input column over time, keeping the frame size constant ( ) and making the period of the output frame ( ) in times shorter than the period of the input frame ( ).

Sample-based processing

Details

When you set for the parameter Input processing meaning Elements as channels (sample based), the block processes the input matrix on how independent channels and increases the sampling rate of each channel over time. In this mode, the block always performs multi-speed processing. The output sampling rate in Times higher than the input ( ), and the sizes of the input and output signals are identical.

Zero delay

Details

Block Upsample It has zero latency for single-speed processing. The unit is in single-speed mode if the sampling boost factor is 1, or if for the parameter Input processing the value is set Columns as channels (frame based), and for the parameter Rate options — value Enforce single-rate processing.

Zero delay means that the block transmits the first input signal (received at the time ) immediately after consecutive zeros, where — parameter value Sample offset, [0, L-1].

Non-zero delay

Details

Block Upsample it has a delay for multi-speed processing:

  • In the multi-rate sample-based processing mode, the initial condition for each channel is displayed as an output sample. , followed by inserted zeros. The first channel input is displayed as an output count . Parameter Initial condition it can be a matrix of size on containing one value for each channel, or a scalar value that the block applies to all channels of the signal.

  • In frame-based multi-speed processing mode, the first row of the initial conditions matrix is displayed as an output count. , followed by the inserted zeros, the second row of the initial conditions matrix, and so on. The first row of the first input matrix is displayed as a count in the output . Parameter Initial condition it can be a matrix of size on or a scalar value that the block repeats for all elements of the input matrix.