%% Parallel Gold Sequence Generation
% This example shows how to use the LTE Gold Sequence Generator block to
% generate multiple sequences in parallel for use in channel estimation.
%
% Copyright 2017 The MathWorks, Inc.
%%
% The example model initializes the LTE Gold Sequence Generator block with a vector
% that represents the *init* values for each of four channels. The block returns 
% four independent Gold sequences.
%
% You can generate HDL from the HDL Gold Sequence Generator subsystem. 

modelname = 'ltehdlGoldVectorModel';
open_system(modelname);
set_param(modelname,'SampleTimeColors','on');
set_param(modelname,'SimulationCommand','Update');
set_param(modelname,'Open','on');
set(allchild(0),'Visible','off');
%%
% The LTE Gold Sequence Generator block has no block parameters. It is
% configured to match the polynomial and shift length required by LTE 
% standard TS 36.212. You must initialize the sequence with a 31-bit value 
% on the *init* port, and load the value into the block by setting the
% *load* signal to 1 for one cycle. This model has four *init* values, 
% representing four channels. 
% 
% The *enable* signal generates the Gold sequence values. The 
% output is a vector of four values. The output *valid* signal indicates when
% the output data is available. 
set_param(modelname,'SampleTimeColors','off');
set_param(modelname,'Open','off');
set_param([modelname '/HDL Gold Sequence Generator'],'Open','on');
%%
% You can add data logging on the signals and use the Logic Analyzer to view the
% waveforms. 
%
% <<../ltehdlGoldVector_waves.png>>

%% 
% To generate and check the HDL code referenced in this example, you must
% have an HDL Coder(TM) license.
%
% To generate the HDL code, use the following command:
%
%   makehdl('ltehdlGoldVectorModel/HDL Gold Sequence Generator')
%
% To generate a test bench, use the following command:
%
%   makehdltb('ltehdlGoldVectorModel/HDL Gold Sequence Generator')
%
set_param([modelname '/HDL Gold Sequence Generator'],'Open','off');
close_system(modelname,0);
close all;


%% 
