You are here: Symbol Reference > SignalUtils Namespace > Functions > SignalUtils.Demultiplex Function
DSP Master VCL
ContentsIndex
PreviousUpNext
SignalUtils.Demultiplex Function

Demultiplex a channel.

Pascal
procedure Demultiplex(const Src: TVec; const Dst: TVec; ChannelCount: integer; ChannelNr: integer); overload;

Dempultiplex ChannelNr from Src to Dst, if number of channels is ChannelCount. ChannelNr is zero based.

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,mvDouble,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 "MtxExpr.hpp"
    #include "MtxVecEdit.hpp"
    #include "MtxVecTee.hpp"
    #include "SignalUtils.hpp"
    #include <string.h>

    void __fastcall TForm41::BitBtn1Click(TObject *Sender)
    {
        sVector b,h,c;

        h = Ramp(6,mvDouble,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);
    }
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!