

OutputPort1 = InputPort1;
if(InputPort1.TypeSignal == 'Electrical')
         %----------------Received Signal Processing Start--------------- 
         cs = length(InputPort1.Sampled.Signal);
         
end
        
received_signal = InputPort1.Sampled.Signal;

g=series2parallel(received_signal,2*effective_subcarrier + p); % serial to parallel converter

h=decyclicpad(g,p);                         % removing cyclic prefix


pty=fft(h);                                % performing Fast Furier Transform 





n=demirror(pty);                           %  removing complex conjugate by demirroring

n(1,:)=tx(1,:);                         %  When mirroring, the first row is made  zero that's why this is done.
                           
                           
new_n = n(1:effective_subcarrier,1:symbol); % removing zero padding
                         
 


hDemod = modem.qamdemod(hMod);             % QAM Demodulation
rx_demod = demodulate(hDemod,new_n);
l=parallel2series(rx_demod);                % received bit stream

[number,fraction]= biterr(x,l);



for nm2 = 1 : cs
              l2(1,nm2) = l(nm2,1);
end




OutputPort1.Sampled.Signal=l2;
