%% script defining parameters of interferring system -> LTE

agParams.Type = agType; % 'LTE-downlink' or 'LTE-uplink'
agParams.BW = agBW;

% nachystat signal a pouze jej nacitat
if strcmp(agParams.Type,'LTE-downlink')
    agParams.Tsf = 1e-3;
    agParams.df = 15e3;
    switch agParams.BW
        case 1.4e6
            agParams.Fs = 1.96e6;
            agParams.Ncp1_samp = 10;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 9;
            agParams.Ncp2 = 6;
            agParams.Nfft = 128;
            agParams.Nsc = 72;
            y_tx = load('LTEsignal_DL_BW1_40.mat');
            agOut.y_tx = y_tx.y_tx;
        case 3e6
            agParams.Fs = 3.84e6;
            agParams.Ncp1_samp = 20;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 18;
            agParams.Ncp2 = 6;
            agParams.Nfft = 256;
            agParams.Nsc = 180;
            y_tx = load('LTEsignal_DL_BW3_00.mat');
            agOut.y_tx = y_tx.y_tx;
        case 5e6
            agParams.Fs = 7.68e6;
            agParams.Ncp1_samp = 40;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 36;
            agParams.Ncp2 = 6;
            agParams.Nfft = 512;
            agParams.Nsc = 300;
            y_tx = load('LTEsignal_DL_BW5_00.mat');
            agOut.y_tx = y_tx.y_tx;
        case 10e6
            agParams.Fs = 15.36e6;
            agParams.Ncp1_samp = 80;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 72;
            agParams.Ncp2 = 6;
            agParams.Nfft = 1024;
            agParams.Nsc = 600;
            y_tx = load('LTEsignal_DL_BW10_00.mat');
            agOut.y_tx = y_tx.y_tx;
        case 15e6
            agParams.Fs = 23.04e6;
            agParams.Ncp1_samp = 120;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 108;
            agParams.Ncp2 = 6;
            agParams.Nfft = 1536;
            agParams.Nsc = 900;
            y_tx = load('LTEsignal_DL_BW15_00.mat');
            agOut.y_tx = y_tx.y_tx;
        case 20e6
            agParams.Fs = 30.72e6;
            agParams.Ncp1_samp = 160;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 144;
            agParams.Ncp2 = 6;
            agParams.Nfft = 2048;
            agParams.Nsc = 1200;
            y_tx = load('LTEsignal_DL_BW20_00.mat');
            agOut.y_tx = y_tx.y_tx;
        otherwise
            error('Wrong system bandwidth of LTE-downlink')
    end
    
    
elseif strcmp(agParams.Type,'LTE-uplink')
    agParams.Tsf = 0.5e-3;
    agParams.df = 15e3;
    switch agParams.BW
        case 1.4e6
            agParams.Fs = 1.96e6;
            agParams.Ncp1_samp = 10;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 9;
            agParams.Ncp2 = 6;
            agParams.Nfft = 128;
            agParams.Nsc = 72;
        case 3e6
            agParams.Fs = 3.84e6;
            agParams.Ncp1_samp = 20;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 18;
            agParams.Ncp2 = 6;
            agParams.Nfft = 256;
            agParams.Nsc = 180;
        case 5e6
            agParams.Fs = 7.68e6;
            agParams.Ncp1_samp = 40;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 36;
            agParams.Ncp2 = 6;
            agParams.Nfft = 512;
            agParams.Nsc = 300;
        case 10e6
            agParams.Fs = 15.36e6;
            agParams.Ncp1_samp = 80;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 72;
            agParams.Ncp2 = 6;
            agParams.Nfft = 1024;
            agParams.Nsc = 600;
        case 15e6
            agParams.Fs = 23.04e6;
            agParams.Ncp1_samp = 120;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 108;
            agParams.Ncp2 = 6;
            agParams.Nfft = 1536;
            agParams.Nsc = 900;
        case 20e6
            agParams.Fs = 30.72e6;
            agParams.Ncp1_samp = 160;
            agParams.Ncp1 = 1;
            agParams.Ncp2_samp = 144;
            agParams.Ncp2 = 6;
            agParams.Nfft = 2048;
            agParams.Nsc = 1200;
        otherwise
            error('Wrong system bandwidth of LTE-uplink')
    end
    
else
    error('Wrong type of interferring system');
end

clear y_tx

