MATLAB: How to interleave two signals to produce a signal that has twice the sampling rate of the original signals in Simulink 6.5 (R2006b)

decimationdownsamplinginterpolationsimulinkupsampling

I have two signals say Inp1 and Inp2 both sampled at the same rate R1.I would like to interleave these two signals in such a way that the output signal Out1 will contain data from both the input signals and have a sampling rate of 2*R1. Out1 will take its value from Inp1 at the first time instant and from Inp2 at the second time instant and so on.

Best Answer

This type of an upsampling algorithm can be implemented in Simulink using the Switch blocks and the Rate Transition block.
The attached example "interleaving_ex.mdl" illustrates how two signals with sampling time of 1sec can e interleaved to produce an output signal of sampling time 0.5 seconds using the Switch and the Rate Transition Blocks. The control input of the Switch block which controls which of the two data inputs are routed to the output of the Switch block at any time instant is provided by a Pulse Generator whose Period, Pulse Width and Sampling Time are set so that the control input switches between 1 and 0 every 0.5 seconds.
The documentation for the Switch block and the Rate Transition block provide further details about their proper usage and may be accessed at the following locations:
and