Specify value for Input Processing signal property
mode as the value of the Input Processing
property for the signal at the specified block path and port. You can only specify the
Input Processing property for logged signals.
The Input Processing setting affects the format of the logged data and how the Simulation Data Inspector and dashboard blocks display the signal. You can configure a signal for frame-based or sample-based input processing.
Programmatically Specify Input Processing Setting to Log a Frame-Based Signal
Many signal processing applications process data using frames, rather than individual signal values. A frame consists of signal values for several sample times. To process signals as frame-based in your model, specify frame-based processing in the blocks. To log and visualize frame-based signals, set the Input Processing setting to
Columns as channels (frame based) in the Instrumentation Properties for the signal.
This example uses a model from the DSP System Toolbox™ to show how to programmatically specify the Input Processing setting for signals in a model using the
Simulink.sdi.setSignalInputProcessingMode function. The model uses frame-based signals and demonstrates single sideband (SSB) modulation.
Configure Signal Logging
Open or load the model
ssbdemo_frame. This example illustrates a scripting workflow and only loads the model.
The model includes visualization blocks and does not use signal logging. Mark the signals that represent the upper sideband and lower sideband for logging.
upperSB_block = 'ssbdemo_frame/Up'; lowerSB_block = 'ssbdemo_frame/Down'; Simulink.sdi.markSignalForStreaming(upperSB_block,1,'on') Simulink.sdi.markSignalForStreaming(lowerSB_block,1,'on')
If you simulate the model as-is, the signals would be logged as though they were sample-based, so each element in a sample would be treated as a separate channel. To log the signals as frame-based, specify the Input Processing setting for the signal as
frame using the
After configuring the upper and lower sideband signals for logging and as frame-based, the data logs to the workspace and the Simulation Data Inspector in a frame-based format, so each column in a sample is treated as a channel in the signal. You can view and analyze the data in the Simulation Data Inspector or using its programmatic interface.
blkPath — Block path for block that produces signal
string | character array
Block path for the block that produces the signal, specified as a string or character array.
port — Number of block output port connected to signal
Block output port number for the port that produces the signal, specified as a scalar.
mode — Signal input processing setting
"sample" (default) |
Input Processing property value for the signal, returned as
sample— Sample-based input processing, where each element in a sample is treated as a channel.
frame— Frame-based input processing, where each column in a sample is treated as a channel.
h — Signal line handle
Line handle for the signal. You can get the line handle for a signal using the
get_param function with the
'LineHandles' option. For example, to access the line handle for
the output of the
Mu block in the model
MuLineHandles = get_param('vdp/Mu','LineHandles'); MuOutputLineHandle = MuLineHandles.Outport;