%Creating Output Similar to Input
OutputPort1 = InputPort1;
OutputPort2 = InputPort2;
%Input Parameters
sc=subcarriers;
fn=fftpoints;
%OFDM Algorithm
if strcmp(InputPort1.TypeSignal, 'Binary')
    c = length(InputPort1.Sequence);
    if( c > 0 )
        b=0;
        p=1;
        while b==0  %when b=1, all elements of input vector have been modulated.
            %Merging Real and Imaginary Parts into One Vector
            cm=0;
            In=zeros(1,sc);
            for j=p:1:p+(sc-1)
                cm=cm+1;
                In(1,cm)=InputPort1.Sequence(1,j)+InputPort2.Sequence(1,j);
            end
            %IFFT
            ortho=ifft(In,fn);
            out1=real(ortho);
            out2=imag(ortho);
            %Adding Cyclix Prefix
            %Digital to Analog Converter
            %Output
            OutputPort1.Sampled.Signal=out1;
            OutputPort2.Sampled.Signal=out2;
            p=p+sc;
            if p>c
                b=1;
            end
        end
    end
end