⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setpara.m

📁 OFDM multipath fading channel model jakes
💻 M
字号:
% setPara.m
% Set initial parameters.

function [idata, qdata, nsamp, tstp, fs, fc, fm, NN, N1_arr, velocity, ...
    counter_arr, delay_time, attn, flat]=setPara(indoor, singlePulse)

%******************************  variables *******************************
% indoor        Indoor case if 1, Outdoor if 0.
% singlePulse   Single pulse to calculate impulse response and transfer 
%               functionif 1, multi-pulse to calculate others if 0.
% idata         Ich data
% qdata         Qch data
% nsamp         Number of samples to be simulated
% tstp          Minimum time resolution
% fs            Sampling frequency (Hz)
% fc            Carrier Frequency (Hz)
% fm            Maximum doppler frequency (Hz)
% NN            Number of paths
% N1_arr        Number of waves in order to generate fading
% velocity      Mobile speed in Km/h
% counter_arr   Fading counter
% delay_time    Delay for each fading path (ns)
% attn          Attenuation level for different fading paths (dB)
% flat          flat fading or not
% r             Envelope of fading channel complex impulse response
% iout          output Ich data
% qout          output Qch data
%************************************************************************

fc = 2e9;               % carrier frequency(Hz) 

if indoor==1
    NN = 4;                                 % path number
    N1_arr=[16,16,16,16];                   % 16 Oscillators
    counter_arr=[1000,2000,3000,4000];      % fading counter
    delay_time = [0, 110, 190, 410];
    attn = [0, 9.7, 19.2, 22.8];
    velocity = 3;                           % velocity in km/h
    v = velocity/3.6;                              % velocity in m/s
    c = 3e8;                                % speed of light
    fm = fc*v/c;                            % max doppler spead
    
    if singlePulse==1
        flat=1;
        nsamp = 100;                        % sampling number
        
        fs = 1e7;                           % sampling frequency
        tstp = 1/fs;                        % minimum time resolution

        idata = zeros(1,nsamp);
        idata(1,1) = 1;
        qdata = zeros(1,length(idata));
    else
        flat=0;
        nsamp = 5000;                       % sampling number
        
        fs = 10*fm;                         % sampling frequency
        tstp = 1/fs;                        % minimum time resolution

        idata = ones(1,nsamp);        
        qdata = zeros(1,length(idata));
    end
else
    NN = 6;                                         % path number
    N1_arr=[16,16,16,16,16,16];                     % 16 Oscillators
    counter_arr=[1000,2000,3000,4000,5000,6000];    % fading counter
    delay_time = [0, 310, 710, 1090, 1730, 2510];
    attn = [0, 1.0, 9.0, 10.0, 15.0, 20.0];
    velocity = 120;                                 % velocity in km/h
    v = velocity/3.6;                               % velocity in m/s
    c = 3e8;                                        % speed of light
    fm = fc*v/c;                                    % max doppler spead
    
    if singlePulse==1
        flat=1;
        nsamp = 100;                        % sampling number
        
        fs = 1e7;                           % sampling frequency
        tstp = 1/fs;                        % minimum time resolution

        idata = zeros(1,nsamp);
        idata(1,1) = 1;
        qdata = zeros(1,length(idata));
    else
        flat=0;
        nsamp = 5000;                       % sampling number
        
        fs = 10*fm;                         % sampling frequency
        tstp = 1/fs;                        % minimum time resolution

        idata = ones(1,nsamp);        
        qdata = zeros(1,length(idata));
    end
end
% %***************************** end of file ******************************

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -