hlayumi的个人空间 https://blog.eetop.cn/hslogic [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

IEEEModle80216

已有 982 次阅读| 2019-11-26 01:51 |系统分类:硬件设计

S = RandStream('swb2712', 'Seed', 12345); % Set a local random number stream
M = 2;                      % Modulation order
hModem = modem.pskmod(M);   % 2-PSK modulator object

Rsym = 10e3;                % Input symbol rate
Rbit = Rsym * log2(M);      % Input bit rate
Nos = 4;                    % Oversampling factor
ts = (1/Rbit) / Nos;        % Input sample period
tau = [0 0.4 0.9]*1e-6;     % Path delays, in seconds
pdb = [0 -15 -20];          % Average path gains, in dB

dop = doppler.rounded;      % Doppler spectrum, with default parameters

fd = 0.5;                   % Maximum Doppler shift for all paths (identical)

Nt = 2;                     % Number of transmit antennas
Nr = 1;                     % Number of receive antennas

rho = 0.7;                  % Correlation coefficient = antenna correlation

h = mimochan(Nt, Nr, ts, fd, tau, pdb);     % MIMO channel object
h.KFactor = 4;                              % Rician K-factor on first path
h.DopplerSpectrum = dop;                    % Doppler spectrum of MIMO object
h.TxCorrelationMatrix = toeplitz([1 rho]);  % Transmit correlation matrix
% After each frame is processed, the channel is not reset: this is necessary
% to preserve continuity across frames.
h.ResetBeforeFiltering = 0;
% This setting is needed to store the path gains.
h.StorePathGains = 1;

Nsamp = 1.5e6;                    % Total number of channel samples
Nsamp_f = 1000;                 % Number of samples per frame
Nframes = Nsamp/Nsamp_f;        % Number of frames

out = zeros(Nsamp, Nr);
y1 = zeros(Nsamp, Nt);  y2 = zeros(Nsamp, Nt); y3 = zeros(Nsamp, Nt);
for iFrames = 1:Nframes
    inputSig = modulate(hModem, randi(S, [0 M-1], Nsamp_f, Nt));
    idx = (1:Nsamp_f)+(iFrames-1)*Nsamp_f;
    out(idx,:) = filter(h, inputSig);
    for it = 1:Nt
        % For each transmit antenna, store gains of all three paths
        y1(idx,it) = h.PathGains(:,1,it,1);
        y2(idx,it) = h.PathGains(:,2,it,1);
        y3(idx,it) = h.PathGains(:,3,it,1);
    end
end
Hs = spectrum.welch('Hamming', Nsamp/5, 50);
figure;
psd(Hs, y2(:,1), 'Fs', 1/ts, 'SpectrumType', 'twosided', 'Centerdc', true)
axis([-0.1/10 0.1/10 -80 10]);
legend('Simulation');
f = -fd: 0.01 :fd;
a = [1 -1.72 0.785];    % Parameters of the rounded Doppler spectrum
Sd = 1/(2*fd*(a(1)+a(2)/3+a(3)/5)) * ( a(1) + a(2)*(f/fd).^2 + a(3)*(f/fd).^4 );
Sd = Sd * 10^(-15/10);  % Scaling by average path power

hold on;
plot(f(Sd>0)/1e3, 10*log10(Sd(Sd>0)), 'k--');
legend('Simulation', 'Theory');
figure;
psd(Hs, y2(:,2), 'Fs', 1/ts, 'SpectrumType', 'twosided', 'Centerdc', true)
axis([-0.1/10 0.1/10 -80 10]);
legend('Simulation');
hold on;
plot(f(Sd>0)/1e3, 10*log10(Sd(Sd>0)), 'k--');
legend('Simulation', 'Theory');
figure;
semilogy(abs(y1(:,1)),'b');
hold on; grid on;
semilogy(abs(y1(:,2)),'r');
legend('First transmit link', 'Second transmit link');
title('Fading envelopes for two transmit links of Path 1');

figure;
semilogy(abs(y2(:,1)),'b');
hold on; grid on;
semilogy(abs(y2(:,2)),'r');
legend('First transmit link', 'Second transmit link');
title('Fading envelopes for two transmit links of Path 2');

figure;
semilogy(abs(y3(:,1)),'b');
hold on; grid on;
semilogy(abs(y3(:,2)),'r');
legend('First transmit link', 'Second transmit link');
title('Fading envelopes for two transmit links of Path 3');
TxCorrMatrixPath1 = corrcoef(y1(:,1),y1(:,2)).'
TxCorrMatrixPath2 = corrcoef(y2(:,1),y2(:,2)).'

TxCorrMatrixPath3 = corrcoef(y3(:,1),y3(:,2)).'


点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 5

    粉丝
  • 0

    好友
  • 1

    获赞
  • 16

    评论
  • 5260

    访问数
关闭

站长推荐 上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-25 04:26 , Processed in 0.016864 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部