blockSampleWithADeffects
Sample with (simulated) Analog-Digital converter effects including noise
Extends from Clocked.RealSignals.Interfaces.PartialSISOSampler (Basic block used for sampling of Real signals).
Information
This block is similar to the Sample block. The only difference is that after the sampling of the input signal, simulated real-world effects are applied on the sampled signal. In particular:
- The output is limited, if parameter limited = true.
- The output is value discretized in the form of an Analog-Digital converter with a definable number of bits, if parameters limited = true, and quantized = true.
- Noise is added to the output if parameter noisy = true. A pseudo random number generator is used to generate uniformly distributed random numbers in a given band.
Example
The following example samples a sine signal with a periodic clock of 20 ms period, and adds the following effects:
- Limits the output to +/- 0.8.
- Discretizes the output with an 8 bit AD converter.
- Adds large uniform noise with a band of +/- 0.2.
![]() |
![]() |
|
| model | simulation result |
The output y is quite far away from the continuous-time input signal,
due to the strong discretization and large noise applied to the
sampled input.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Sampling and noise | |||
| Boolean | noisy | false | = true, if output should be superimposed with noise |
| Limiting and quantization | |||
| Boolean | limited | false | = true, if output is limited |
| Boolean | quantized | false | = true, if output quantization effects included |
| Real | yMax | 1 | Upper limit of output (if limited = true) |
| Real | yMin | -yMax | Lower limit of output (if limited = true) |
| Integer | bits | 8 | Number of bits of quantization (if quantized = true) |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput | u (from PartialSISOSampler) | Connector of continuous-time, Real input signal | |
| Modelica.Blocks.Interfaces.RealOutput | y (from PartialSISOSampler) | Connector of clocked, Real output signal |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Sample | sample1 | ||
| Clocked.RealSignals.Sampler.Utilities.Internal.UniformNoise | noise | ||
| Clocked.RealSignals.Sampler.Utilities.Internal.Limiter | limiter | ||
| Clocked.RealSignals.Sampler.Utilities.Internal.Quantization | quantization |

