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

📄 autocorr_sim_1.m

📁 3gpp2信道模型,8个matlab源代码
💻 M
字号:
function autocorr_sim=autocorr_sim_1(K,N,num_trials)
%    AUTOCORR_SIM(M,K,N,NUM_TRAIL,FDTS)
%    usage: autocorr_sim(2e4,3e4,1e2)
%    AUTOCORR_SIM simulate the autocorrelation of the proposed fading channel model
%    M is the number of sum_of_sinusoids
%    K is the autocorrelation sequence length of interest 
%    N is the length of each channel realization
%    num_trials is the number of random channel realizations
%    fdTs is the normalized sampling period
%    updated by HYM on 08/23/2004
M=16
fdTs=900*30*1e9/3600/250e3/3e8;
autocorr_sim_matrix=zeros(num_trials,K);    % store the autocorrelation of all num_trials random channel realizations
for trial=1:num_trials
    psi=2*pi*(rand(1,M)-0.5);               % generate the independent and uniformly distributed parameters defined in the model
    theta=2*pi*(rand(1,1)-0.5);
    alpha=(2*pi.*[1:1:M]-pi+theta)./(4*M);
    phi=2*pi*(rand(1,1)-0.5);
    channel_realization=zeros(1,N);
    for n=1:N
        channel_realization(n)=2/sqrt(M).*complex(sum(cos(psi).*cos(2*pi*n*fdTs.*cos(alpha)+phi)),sum(sin(psi).*cos(2*pi*n*fdTs.*cos(alpha)+phi)));
    end
%     ch=mimo_channel(1, 1, 0, 900, 30, 250e3, N,1);
%     channel_realization=ch(:);
    temp=xcorr(real(channel_realization),'unbias');
    autocorr_sim_matrix(trial,:)=temp(N:N+K-1);    % need only K autocorrelation values  
end

autocorr_sim=mean(autocorr_sim_matrix);
plot(fdTs.*[0:1:K-1],autocorr_sim,'b-')

⌨️ 快捷键说明

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