% plot_MSKIF - plot upconverted MSK signal

%% Parameters:
fsT      = 20;
L        = 10;
Alphabet = [1,-1];                          % 2-PAM
Priors   = ones( size( Alphabet) ) / length(Alphabet);
Ns       = 20;                              % number of symbols
Pulse    = RectPulse( fsT);                 % Rectangular pulse
A        = 1;                               % amplitude
h        = 0.5;                             % modulation index
fc       = 2;                               % carrier frequency 2/T

%% symbols and Signal using our functions
Symbols  = RandomSymbols(Ns, Alphabet, Priors);
Signal   = CPM(Symbols, A, h, Pulse,fsT);
tt       = (0 : length(Signal)-1 )/fsT;
IFSignal = real( exp( j*2*pi*fc*tt) .* Signal );

%% plot
plot(tt, IFSignal, tt(fsT/2:fsT:end),  Symbols(1:end), 'ro')
grid
xlabel('Time/T')
ylabel('Amplitude')
axis([5 15 -1.5 1.5] );

%% Store name of script for automated figure generation
ScriptName = mfilename;