if exist('AGC_gain', 'var') && (size(AGC_gain.data,1)>1)

Hts1 = timescope(...
'Name', 'AGC Gain', ...
'YLabel', 'Gain', ...
'SampleRate',1/AGC_gain.TimeInfo.Increment,...
'TimeSpanSource','property',...
'TimeSpan',AGC_gain.TimeInfo.End);
step(Hts1,AGC_gain.data);
release(Hts1);

% Calculate 'K' where f_nco = K * stepSize_nco
K = qam_params.sampleRate/2^16;

Hts2 = timescope(...
'Name', 'Frequency Offset Estimate', ...
'YLabel', 'Frequency Offset [Hz]', ...
'SampleRate',1/CFR_freqEst.TimeInfo.Increment,...
'TimeSpanSource', 'property', ...
'TimeSpan',CFR_freqEst.TimeInfo.End);
step(Hts2,real(K*CFR_freqEst.Data), -qam_params.frequencyOffset*(ones(CFR_freqEst.TimeInfo.Length,1)));
release(Hts2);

Hts3 = timescope(...
'Name', 'Timing Recovery Position', ...
'YLabel', 'mu [samples]', ...
'SampleRate',1/TR_mu.TimeInfo.Increment,...
'TimeSpanSource', 'property', ...
'TimeSpan',TR_mu.TimeInfo.End);
step(Hts3,TR_mu.data);
release(Hts3);

% create sampled data from dataOut and validOut
sampledData = timeseries(...
TR_dataOut.Data(TR_validOut.Data),...
TR_dataOut.Time(TR_validOut.Data));

% plot real part of timing recovery output to show points converging
Hconst = comm.ConstellationDiagram( ...
'Name','Real Part of Timing Recovery Output', ...
'XLimits', [0 0.02], ...
'YLimits', [-1 1], ...
'Position', [680 390 560 420], ...
'XLabel', 'Time [Seconds]', ...
'YLabel', 'Amplitude', ...
'ReferenceConstellation', [], ...
'ColorFading',false);
step(Hconst, complex(sampledData.Time, real(sampledData.Data)));
release(Hconst);

% plot real part of symbol estimates
Hconst1 = comm.ConstellationDiagram( ...
'Name','Real Part of Symbol Estimates', ...
'XLimits', [0 0.02], ...
'YLimits', [-1 1], ...
'Position', [680 390 560 420], ...
'XLabel', 'Time [Seconds]', ...
'YLabel', 'Amplitude', ...
'ReferenceConstellation', [], ...
'ColorFading',false);
step(Hconst1, complex(symbolEstimates.Time, real(symbolEstimates.Data)));
release(Hconst1);

% plot constellation just before demapper
refConst = (0.25/2) .* qammod((0:63)', 64);

Hconst2 = comm.ConstellationDiagram( ...
'Name','Recovered Constellation', ...
'XLimits', [-1 1], ...
'YLimits', [-1 1], ...
'ReferenceConstellation', refConst, ...
'Position', [680 390 560 420], ...
'ColorFading',true);
step(Hconst2, symbolEstimates.Data);
release(Hconst2);

clear K freqEst y sampledData refConst h;
end