
global ModulationIndex

OutputPort1         = InputPort1;	        % create an output structure

ModulationIndex     = Parameter0;

SampledNumber       = length(InputPort1.Sampled);
ParameterizedNumber = length(InputPort1.Parameterized);
NoiseNumber         = length(InputPort1.Noise);
   
if( SampledNumber > 0 )   % if there is sampled signal do
  
     for i=1:SampledNumber
         
        OutputPort1.Sampled(i).Signal(1,:) = AmplitudeModulatorSampled(InputPort1.Sampled(i).Signal(1,:), real(InputPort2.Sampled.Signal))
        
        PolarizationNumber                 = size(InputPort1.Sampled(i).Signal,1);
        
        if( PolarizationNumber == 2)
            
           OutputPort1.Sampled(i).Signal(2,:) = AmplitudeModulatorSampled(InputPort1.Sampled(i).Signal(2,:), real(InputPort2.Sampled.Signal));
           
        end;
     end
end;
  
if( ParameterizedNumber > 0 ) %if there is parameterized signal do
   
     for i=1:ParameterizedNumber
         
        OutputPort1.Parameterized.Power = AmplitudeModulatorParameterized(InputPort1.Parameterized.Power, real(InputPort2.Sampled.Signal));
        
     end
end;

if( NoiseNumber > 0 )           %if there noise signal do
   
     for i=1:NoiseNumber
         
        OutputPort1.Noise.Power = AmplitudeModulatorNoise(InputPort1.Noise.Power, real(InputPort2.Sampled.Signal));
        
     end 
end;