Home Forums EXCHANGE Ideal Binary Switch

Ideal Binary Switch

(joined March 2014)
Moderator

Attached is an ideal binary switch that works for single sampled optical signals, it uses a very simple comparison calculation to determine whether a signal should be at a top or bottom port. Try out the example OptiSystem project file.

Part 1: Explanation of Matlab Component

Part 2: Explanation of Matlab Code

Responses (3):

  • #26395
    Damian Marek
    Moderator

    Attached is an ideal binary switch that works for single sampled optical signals, it uses a very simple comparison calculation to determine whether a signal should be at a top or bottom port. Try out the example OptiSystem project file.

    Part 1: Explanation of Matlab Component

    Part 2: Explanation of Matlab Code

  • #26426
    Damian Marek
    Moderator

    Matlab code follows:

    OutputPort1=InputPort1;
    OutputPort2=InputPort1;

    %Find lengths of vectors

    sampledLength = length(InputPort1.Sampled(1).Signal);
    seqLength = length(InputPort2.Sequence);

    %Repeat elements of bit sequence so vectors match

    samplesPerBit = floor(sampledLength/seqLength);
    padding = mod(sampledLength,seqLength);
    seqMatched=repmat(InputPort2.Sequence’,1,samplesPerBit)’;
    seqMatched=seqMatched(:)’;
    seqMatched=[seqMatched zeros(1,padding);];

    %Find complement of sequence
    compseqMatched = ~seqMatched;

    %Multiply vectors to produce the outputs
    OutputPort1.Sampled(1).Signal = InputPort1.Sampled(1).Signal.*seqMatched;
    OutputPort2.Sampled(1).Signal = InputPort1.Sampled(1).Signal.*compseqMatched;

  • #30962

    Hi Damian Marek

    I am currently working on the Software Defined Optical Network and i need to design an OpenFlow switch in matlab which i have to interface with Optisystem later. Since I had a problem of even generating a stream of packets in optisystem so managed to find a model in simulink for packet communication as u can see in the attached file. From here i can get the syntex of packet headers which i have to compare with the flow entries in the OpenFlow switch yet to be designed in Matlab. I wanted u to check upon if the packet generation mentioned in model below is correct and please suggest how would i be able to analyse the packet headers which i need further. And can i add a Matlab component in simulink as well which would do the job OpenFlow switch of comparing packet headers and taking the required action.

    +1
  • #30975
    Profile Photo
    aasif bashir dar
    Participant

    really help ful videos

Login You must be logged in to reply to this topic.