Demultiplex a channel.
Dempultiplex ChannelNr from Src to Dst, if number of channels is ChannelCount. ChannelNr is zero based.
Example 1
Multiplex and demultiplex test.
uses MtxExpr, Math387, MtxVec, SignalUtils, MtxVecTee, MtxVecEdit;
procedure TForm1.Button1Click(Sender: TObject);
var b,h,c: Vector;
begin
h := Ramp(6,0,1); // h = [0 1 2 3 4 5]
Multiplex(h,b,3,2); // b = [0 0 0 0 0 1 0 0 2 0 0 3 0 0 4 0 0 5]
Demultiplex(b,c,3,2); // c = [0 1 2 3 4 5]
DrawIt(c);
end;
#include "MtxVecCPP.h" //MtxVecCPP.cpp must be included in the project
#include "MtxVecEdit.hpp"
#include "MtxVecTee.hpp"
#include "SignalUtils.hpp"
#include <string.h>
void __fastcall TForm41::BitBtn1Click(TObject *Sender)
{
Vector b,h,c;
h = Ramp(6,0,1); // h = [0 1 2 3 4 5]
Multiplex(h,b,3,2); // b = [0 0 0 0 0 1 0 0 2 0 0 3 0 0 4 0 0 5]
Demultiplex(b,c,3,2); // c = [0 1 2 3 4 5]
DrawIt(c);
}
using Dew.Math;
using Dew.Math.Editors;
using Dew.Math.Units;
using Dew.Signal;
using Dew.Signal.Units;
using Dew.Math.Tee;
using Dew.Signal.Tee;
private void button1_Click(object sender, EventArgs e)
{
Vector b = new Vector(0);
Vector c = new Vector(0);
Vector h = MtxExpr.Ramp(6,0,1); // h = [0 1 2 3 4 5]
SignalUtils.Multiplex(h,b,3,2); // b = [0 0 0 0 0 1 0 0 2 0 0 3 0 0 4 0 0 5]
SignalUtils.Demultiplex(b,c,3,2); // c = [0 1 2 3 4 5]
TeeChart.DrawIt(c,"",false);
}