%% Effect of Nonlinear Amplifier on 16-QAM Modulation
% This model shows the nonlinear effect of a RF Blockset(TM) Equivalent
% Baseband amplifier on a 16-QAM modulated signal.
%

% Copyright 2003-2016 The MathWorks, Inc.

%% Example Model
% Fig. 1 16-QAM modulation example model:
%

open('amp_qam16.slx')

%% Simulation Results
% When you compare the spectrums of transmitted and received signals
% (Fig. 2), you can see the spectrum regrowth at the received signal. This
% regrowth is  due to the nonlinearity of the amplifier.
%
% Fig. 2 Spectrums of transmitted and received signals:
%

open_system('amp_qam16/Output')
sim('amp_qam16',0.2e-2);

%%
% When you compare the constellations of transmitted and received signals
% (Figs. 3 and 4 respectively), you can see the signal distortion at the
% received signal. This distortion is due to the nonlinearity of the
% amplifier.
%
% Fig. 3 Constellation of transmitted signal:
%

close_system('amp_qam16/Output')
open_system('amp_qam16/Signal Source/Discrete-Time Scatter Plot Scope')
sim('amp_qam16',0.2e-2);

%%
% Fig. 4 Constellation of received signal:
%

close_system('amp_qam16/Signal Source/Discrete-Time Scatter Plot Scope')
open_system('amp_qam16/Signal Sink/Discrete-Time Scatter Plot Scope1')
sim('amp_qam16',0.2e-2);

%%
% To view the nonlinear effect, double-click the Slider Gain block and
% change the value of the gain while the model is running.

bdclose('amp_qam16')
