MATLAB Answers

How to set the number of samples per frame in a self-authored system object?

2 views (last 30 days)
Raptrick
Raptrick on 6 Sep 2019
Dear all,
I'm trying to make a proprietary signal generator (no inputs, one output) in simulink using a matlab.system block from which the output is processed in frames by consecutive blocks. In order to set the sample time of the signal generator I make use of the subclass matlab.system.mixin.SampleTime. But I dont know how to set the number of samples per frame in this self-authored system object in order to enable frame-based signal processing?
A workaround is to add an input to the self-authored system object which is connected to a signal source from the DSP system toolbox (eg colorednoise). In this block you can define the sampletime and the number of samples per frame (enabling framebased signal processing). By making use of the subclass matlab.system.mixin.Propagates the sample time and the number of samples per frame can be inherited from the input. It works but it is not that elegant...
Patrick

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!