Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

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

BufferLength

Maximum number of input frames to log

Specify the maximum number of frames to log. 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). 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

resetReset internal states of signal logger object
stepStore signal in buffer
Common to All System Objects
clone

Create System object with same property values

getNumInputs

Expected number of inputs to a System object

getNumOutputs

Expected number of outputs of a System object

isLocked

Check locked states of a System object (logical)

release

Allow System object property value changes

Examples

expand all

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

hlog = dsp.SignalSink;
 for i=1:10
     y = sin(i);
     hlog(y);
 end
log = hlog.Buffer;
display(log);
log =

    0.8415
    0.9093
    0.1411
   -0.7568
   -0.9589
   -0.2794
    0.6570
    0.9894
    0.4121
   -0.5440

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.

Introduced in R2012b

Was this topic helpful?