dsp.SignalSink System object

Package: dsp

Log simulation data in buffer

Description

The SignalSink object logs MATLAB® simulation data. This object accepts any numeric data type.

To log MATLAB simulation data :

  1. Define and set up your signal sink. See Construction.

  2. Call step to log the simulation data according to the properties of dsp.SignalSink. The behavior of step is specific to each object in the toolbox.

Construction

H = dsp.SignalSink returns a signal sink, H, that logs 2-D input data in the object.

H = dsp.SignalSink('PropertyName',PropertyValue,...) returns a signal sink, H, with each specified property set to the specified value.

Properties

FrameBasedProcessing

Process input as frames or samples

To enable frame-based processing for 2-D inputs, set this property to true. When you set this property to false, the object performs sample-based processing on 2-D inputs. The signal sink object always performs sample-based processing for N-D inputs when N is greater than 2. The default is true.

BufferLength

Maximum number of input frames or samples to log

Specify the maximum number of frames to log when the object is performing frame-based processing, or the maximum number of samples to log when the object is performing sample-based processing. The object always preserves the most recent data in the buffer. When you specify a buffer length that is greater than the input length, the object pads the end of the logged data with zeros. To capture all input data without extra padding, set the BufferLength property to inf. The default is inf.

Decimation

Decimation factor

Setting this property to any positive integer d causes the signal sink to write data at every dth sample. The default is 1.

FrameHandlingMode

Output dimensionality for frame-based inputs

Set the dimension of the output array for frame-based inputs as 2-D array (concatenate) or 3-D array (separate). Concatenation occurs along the first dimension for 2-D array (concatenate). This property applies only when you set the FrameBasedProcessing property to true. The default is 2-D array (concatenate).

Buffer

Logged Data (read only)

The signal sink writes simulation data into a buffer. Specify the maximum length of the buffer with the BufferLength property.

Methods

cloneCreate signal logger object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
resetReset internal states of signal logger object
stepStore signal in buffer

Examples

Log input data.

hlog = dsp.SignalSink;
 for i=1:10
     y = sin(i);
     step(hlog,y);
 end
log = hlog.Buffer; % log = sin([1;2;3;4;5;6;7;8;9;10])

Algorithms

This object implements the algorithm, inputs, and outputs described on the To Workspace block reference page. The object properties correspond to the block properties, except:

The object always generates fixed-point output for fixed-point input.

Objects and blocks interpret frames differently. Objects process inputs as frames or as samples by setting the FrameBasedProcessing property. Blocks process inputs as frames or as samples by inheriting the frame information from the input ports. See Set the FrameBasedProcessing Property of a System object for more information.

Was this topic helpful?