I have a signal output from a Simulink model that I need to apply a "modulation" to. The modulation parameters are defined in a file, as a Nx2 array of time and factor values, which needs to be repeated for the length of the Simulink signal. I tried using the Repeating Sequence block, which is perfect except it interpolates values which I do not want. Is there a way to turn off interpolation for this block?
For example, I was given this modulation waveform:
modSig = [ 0.00 1;
5.50 1;
5.50 0;
15.0 0;
15.0 -1;
20.5 -1;
20.5 0;
30.0 0 ];
Meaning the signal should be 1 at 0 - 5.5 seconds, 0 at 5.5 - 15 seconds, -1 at 15 to 20.5 seconds, and zero at 20.5 to 30 seconds, and this pattern should repeat for the duration of the input Simulink signal.
Giving this to Repeating Sequence, I get a value of 0.5 at the transitions rather than the desired 1, 0, or -1 value.
I can also do this directly in the code for my application, if there's a simpler method to do it that way.
Available toolboxes: Simulink, Stateflow, Signal Processing, System Identification.