Post · 4 min read· pp. 202–205

Data Type Adapter

The Data Type Adapter is the first processing block inside a Signal Conditioner when the latter is using a Signal_Conditioner implementation.

The role of a Data Type Adapter block is to perform a conversion of the data type in the sample stream.

This is the first processing block after the Signal Source, and each kind of source can deliver data in different formats.

  • If the Signal Source is delivering samples at a given intermediate frequency, the native data types can be:

    • Real samples: byte, short, float (8, 16, and 32 bits, respectively).
    • Interleaved (I&Q) samples: ibyte, ishort, gr_complex (8+8, 16+16, and 32+32 bits, respectively).
  • If the Signal Source is delivering samples at baseband, the native data types can be:

    • Interleaved (I&Q) samples: ibyte, ishort, gr_complex (8+8, 16+16, and 32+32 bits, respectively).
    • Complex samples: cbyte, cshort, gr_complex (8+8, 16+16, and 32+32 bits, respectively).

This block has several implementations of data type conversions. For more details about sample data types and their usage in GNSS-SDR, please check out our tutorial on data types.

Implementation: Byte_To_Short

This implementation takes samples of type byte (8 bits, real samples) at its input and writes samples of type short (16 bits, real samples) at its output.

It accepts the following parameters:

ParameterDescriptionRequired
implementationByte_To_ShortMandatory

Data Type Adapter implementation: Byte_To_Short.

Example:

ini
;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Byte_To_Short

Implementation: Ibyte_To_Cbyte

This implementation takes samples of type ibyte (interleaved I&Q samples, 8 bits each) at its input and writes samples of type cbyte (complex samples with real and imaginary components of 8 bits each) at its output. This reduces the sample rate by two.

It accepts the following parameters:

ParameterDescriptionRequired
implementationIbyte_To_CbyteMandatory
inverted_spectrum[true, false]: If set to true, it performs a spectrum inversion. It defaults to false.Optional

Data Type Adapter implementation: Ibyte_To_Cbyte.

Example:

ini
;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Ibyte_To_Cbyte

Implementation: Ibyte_To_Cshort

This implementation takes samples of type ibyte (interleaved I&Q samples, 8 bits each) at its input and writes samples of type cshort (complex samples with real and imaginary components of 16-bits integers each) at its output. This reduces the sample rate by two.

It accepts the following parameters:

ParameterDescriptionRequired
implementationIbyte_To_CshortMandatory
inverted_spectrum[true, false]: If set to true, it performs a spectrum inversion. It defaults to false.Optional

Data Type Adapter implementation: Ibyte_To_Cshort.

Example:

ini
;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Ibyte_To_Cshort

Implementation: Ibyte_To_Complex

This implementation takes samples of type ibyte (interleaved I&Q samples, 8 bits each) at its input and writes samples of type gr_complex (complex samples with real and imaginary components of 32 bits each) at its output. This reduces the sample rate by two.

It accepts the following parameters:

ParameterDescriptionRequired
implementationIbyte_To_ComplexMandatory
inverted_spectrum[true, false]: If set to true, it performs a spectrum inversion. It defaults to false.Optional

Data Type Adapter implementation: Ibyte_To_Complex.

Example:

ini
;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Ibyte_To_Complex

Implementation: Ishort_To_Cshort

This implementation takes samples of type ishort (interleaved I&Q samples, 16 bits each) at its input and writes samples of type cshort (complex samples with real and imaginary components of 16 bits each) at its output. This reduces the sample rate by two.

It accepts the following parameters:

ParameterDescriptionRequired
implementationIshort_To_CshortMandatory
inverted_spectrum[true, false]: If set to true, it performs a spectrum inversion. It defaults to false.Optional

Data Type Adapter implementation: Ishort_To_Cshort.

Example:

ini
;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Ishort_To_Cshort

Implementation: Ishort_To_Complex

This implementation takes samples of type ishort (interleaved I&Q samples, 16 bits each) at its input and writes samples of type gr_complex (complex samples with real and imaginary components of 32 bits each) at its output. This reduces the sample rate by two.

It accepts the following parameters:

ParameterDescriptionRequired
implementationIshort_To_ComplexMandatory
inverted_spectrum[true, false]: If set to true, it performs a spectrum inversion. It defaults to false.Optional

Data Type Adapter implementation: Ishort_To_Complex.

Example:

ini
;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Ishort_To_Complex

Implementation: Cshort_To_Gr_Complex

This implementation takes samples of type cshort (complex samples with real and imaginary components of 16-bits integers each) at its input and writes samples of type gr_complex (complex samples with real and imaginary components of 32 bits each) at its output.

It accepts the following parameters:

ParameterDescriptionRequired
implementationCshort_To_Gr_ComplexMandatory

Data Type Adapter implementation: Cshort_To_Gr_Complex.

Example:

ini
;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Cshort_To_Gr_Complex

Implementation: Pass_Through

This implementation copies samples from its input to its output.

It accepts the following parameters:

ParameterDescriptionRequired
implementationPass_ThroughMandatory
item_type[gr_complex, cshort, cbyte]: Format of data samples. It defaults to gr_complex.Optional

Data Type Adapter implementation: Pass_Through.

Examples:

ini
;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Pass_Through
ini
;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Pass_Through
DataTypeAdapter.item_type=cshort