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

📄 gwssus.m

📁 这是关于移动无线信道COS207模型的MATLAB源程序
💻 M
📖 第 1 页 / 共 3 页
字号:
    subplot(326);    [h_tmp,x_tmp]=hist(th, no_bins); bar(x_tmp,h_tmp);     % Histogramm der Phasenwinkel    axis([0 1 0 1.1*max(h_tmp)]);    title('Histogram of phase angles');   end  if verbose(3)==1                                         % #####  Plot power delay spectrum    ind_Ts = 1:tau_M:length(tau_out);                      % Symboltakt-Indices    PDS_Ts = PDS_out(ind_Ts);                              % Mittlere Leistung im Symboltakt    tau_fs = tau_out(ind_Ts);                              % Zeitachse im Symboltakt    xmin = min(tau_out);       xmax = max(tau_out);        % tau-Achse = Abszisse    zmin = -0.15*PDSmax*1.25;  zmax = 1.1*PDSmax;          % PDS-Achse = Ordinate    figure;                  plot([xmin xmax],[0 0], 'w-'); hold on;                % P(tau)=0 Achse zeichnen    plot([0 0],[zmin zmax], 'w-'); grid;                   % tau=0 Achse zeichnen    axis([xmin xmax zmin zmax]);    plot(tau_out, PDS_out);                                % kont. Verzoegerungs-Leistungsspektrum    plot(tau_fs, PDS_Ts, 'go');                            % Mittl. Leistungen auf Symboltaktraster    xLines = ones(2,1)*tauES_fs;                           % Striche fuer die Verzoegerungszeiten    yLines = [-0.02*PDSmax; zmin/1.25]*ones(size(tauES_fs));    plot(xLines,yLines);    title(sprintf('Power Delay Spectrum %s', ch_name));  ylabel('P(\tau)    [mean power]    \to');    xlabel(sprintf('\\tau / T  =  \\tau / %3.1f\\mus    \\to', Ts_MHz));%   marktext(0.75, PDSmax, 'go', 'P(iT)','sc');  end;  if verbose(4)==1                                         % #####  Plot magnitude impulse response    h_draw = abs(h_out);    hmax = max(max(h_draw));    if no_slices==1                                        % ## Only one slice of h(tau,t) => 2D plot      ind_Ts    = 1:tau_M:length(tau_out);                 % Symboltakt-Indices      h_draw_Ts = h_draw(ind_Ts,:);                        % Betrags-Impulsantwort im Symboltakt      tau_fs    = tau_out(ind_Ts);                         % Zeitachse im Symboltakt      xmin = min(tau_out);     xmax = max(tau_out);        % tau-Achse = Abszisse      zmin = -0.15*hmax*1.25;  zmax = 1.1*hmax;            % |h|-Achse = Ordinate      figure;      plot([xmin xmax],[0 0], 'w-'); hold on;              % |h(tau)|=0 Achse zeichnen      plot([0 0],[zmin zmax], 'w-'); grid;                 % tau=0 Achse zeichnen      axis([xmin xmax zmin zmax]);      plot(tau_out, h_draw);                               % kont. anfaengliche Gesamt-Impulsantwort      plot(tau_fs, h_draw_Ts, 'go');                       % Anfaengliche Symboltakt-Impulsantwort      xLines = ones(2,1)*tauES_fs;                         % Striche fuer die Verzoegerungszeiten      yLines = [-0.02*hmax; zmin/1.25]*ones(size(tauES_fs));      plot(xLines,yLines);      title(sprintf('Magn. impulse response slice %s', ch_name));      ylabel(sprintf('|h(\\tau,t_{0})|,  t_{0}=%3.1fT    \\to', t_fs(1)));      xlabel(sprintf('\\tau / T  =  \\tau / %3.1f\\mus    \\to', Ts_MHz));%     marktext(0.6,0.8*zmax, 'go', '|h(iT,t_{0})|','sc');    else                                                   % ## > one slice of h(tau,t) => 3D plot      xmin = min(tau_out);  xmax = max(tau_out);           % tau-Achse = Abszisse 1      ymin = min(t_fs);     ymax = max(t_fs);              % t-Achse   = Abszisse 2      zmin = 0;             zmax = 1.05*hmax;              % |h|-Achse = Ordinate      h_mean_t   = mean(h_draw.');                         % mean_t{|h(tau,t)|}      h_stddev_t = std(h_draw.');                          % stddev_t{|h(tau,t)|}      hmax_tau = max(h_draw).';   [dummy, tpos]   = max(hmax_tau);      hmax_t = max(h_draw.').';   [dummy, taupos] = max(hmax_t);      figure;      plot3([0 0],[ymin ymin+(ymax-ymin)/2],[0 0],'w-'); hold on; % tau=0 Linie zeichnen      plot3(tau_out, ymax*ones(size(tau_out)), h_mean_t(:), 'r-');   % Hinten mean_t{|h(.)|} zeichnen      plot3(tau_out, ymax*ones(size(tau_out)), h_mean_t(:)+h_stddev_t(:), 'y--'); % Hinten stddev_t{.}      plot3(tau_out, ymax*ones(size(tau_out)), hmax_t, 'w-');     % Hinten max_t{|h(.)|} zeichnen      plot3(xmin*ones(size(t_fs)), t_fs, hmax_tau, 'w-');         % Links max_tau{|h(.)|} zeichnen      plot3([xmin; tau_out(taupos)*ones(2,1)], [t_fs(tpos)*ones(2,1); ymax], hmax*ones(3,1), 'w--');      axis([xmin xmax ymin ymax zmin zmax]); grid;      view(20,30);      xLines = ones(2,1)*tauES_fs;                         % Echo-Laufzeit-Striche vorne unten%     yLines = [ymin*ones(size(tauES_fs)); ymin+0.15*(ymax-ymin)*cos(THETA.')];  % um tau-Achse %     zLines = [zmin*ones(size(tauES_fs)); zmin+0.15*(zmax-zmin)*sin(THETA.')];  % rotierende Striche      yLines = [ymin; ymin+0.15*(ymax-ymin)]*ones(size(tauES_fs));      zLines = zeros(size(xLines));      plot3(xLines, yLines, zLines);                                                           % |h(tau,t)| als "Gebirge" zeichnen      surf(tau_out, t_fs, h_draw.');                       % erstes Argument bezieht sich auf die                                                            % Zeilen(!) des dritten Arguments.      title(sprintf('Magn. impulse response %s at T_{D}>%d T', ch_name, TDmin_fs));      zlabel(sprintf('|h_{c}(\\tau, t)|    \\to'));  ylabel('t / T    \to');      xlabel(sprintf('\\tau / T  =  \\tau / %3.1f\\mus    \\to', Ts_MHz));    end;  end;  if verbose(5)==1                                         % #####  Plot magn. transfer function    H_draw = abs(H_out);                                   % Magnitude transfer functions    H_draw = 20*log10( H_draw./max(max(H_draw)) );         % normalize to unit maximum; convert to dB    Hmin = min(min(H_draw));  Hmax = max(max(H_draw));    if no_slices==1                                        % ## Only one slice of H(f,t) => 2D plot      xmin = -fmax_2Ts/2;    xmax = fmax_2Ts/2;            % f-Achse   = Abszisse 1      zmin = max(Hmin,-80);  zmax = 5;                     % |H|-Achse = Ordinate      figure;      plot([0 0], [zmin zmax], 'w-'); hold on; grid;       % f=0 Linie zeichnen      axis([xmin xmax zmin zmax]);       plot (f_Ts_out, H_draw);      title(sprintf('Magn. transfer function slice %s', ch_name));      ylabel(sprintf('|H(f, t_{0})|,  t_{0}=%3.1fT  in dB    \\to', t_fs(1)));      xlabel(sprintf('f*T  =  f*%3.1f\\mus    \\to', Ts_MHz));    else                                                   % ## > one slice of H(f,t) => 3D plot      xmin = -fmax_2Ts/2;      xmax = fmax_2Ts/2;          % f-Achse   = Abszisse 1      ymin = min(t_fs);        ymax = max(t_fs);           % t-Achse   = Abszisse 2      zmin = Hmin;             zmax = 5;                   % |H|-Achse = Ordinate      [dummy, f_ind_p05] = min(abs(f_Ts_out-0.5));         % Index von f_Ts_out, wo f_Ts \approx +0.5      [dummy, f_ind_m05] = min(abs(f_Ts_out+0.5));         % Index von f_Ts_out, wo f_Ts \approx -0.5      [dummy, f_ind_0]   = min(abs(f_Ts_out));             % Index von f_Ts_out, wo f_Ts \approx  0      H_fTp05 = H_draw(f_ind_p05,:).';                     % |H| for f = +0.5*T      H_fTm05 = H_draw(f_ind_m05,:).';                     % |H| for f = -0.5*T      H_fT0   = H_draw(f_ind_0,:).';                       % |H| for f =  0      f_Ts_p05 = f_Ts_out(f_ind_p05);                      % = \approx +0.5      f_Ts_m05 = f_Ts_out(f_ind_m05);                      % = \approx -0.5      f_Ts_0   = f_Ts_out(f_ind_0);                        % = \approx  0      [Hmax_fTp05, t_ind_p05max] = max(H_fTp05);      [Hmax_fTm05, t_ind_m05max] = max(H_fTm05);      [Hmax_fT0,   t_ind_0max]   = max(H_fT0);       figure;      plot3(f_Ts_0*ones(3,1), [ymax; ymin; ymin], [zmin; zmin; H_fT0(1)], 'w-'); hold on; % f=0 Linien zeichnen      plot3(f_Ts_p05*ones(2,1), ymin*ones(2,1), [zmin; H_fTp05(1)], 'y--');         % vert. Linie bei f=+1/2T vorne       plot3(f_Ts_m05*ones(2,1), ymin*ones(2,1), [zmin; H_fTm05(1)], 'g--');         % vert. Linie bei f=-1/2T vorne       plot3(f_Ts_0 * ones(size(t_fs)), t_fs, H_fT0+0.5,'w-');  % |H(0,t)| um 0.5dB erhoeht zeichnen (sonst unsichtbar)      plot3(f_Ts_p05*ones(size(t_fs)), t_fs, H_fTp05+1,'y-');  % |H(+1/2T,t)| um 1dB erhoeht zeichnen (sonst unsichtbar)      plot3(f_Ts_m05*ones(size(t_fs)), t_fs, H_fTm05+1,'g-');  % |H(-1/2T,t)| um 1dB erhoeht zeichnen (sonst unsichtbar)      plot3(xmin*ones(size(t_fs)), t_fs, H_fT0    ,'w-');      % |H(0,t)| an linke "Wand" zeichnen      plot3(xmin*ones(size(t_fs)), t_fs, H_fTp05  ,'y-');      % |H(+1/2T,t)| an linke "Wand" zeichnen      plot3(xmin*ones(size(t_fs)), t_fs, H_fTm05  ,'g-');      % |H(-1/2T,t)| an linke "Wand" zeichnen      plot3([xmax; xmin; xmin; f_Ts_0]  , t_fs(t_ind_0max)*ones(4,1)  , [zmin; zmin; Hmax_fT0;   Hmax_fT0+0.5], 'w-');      plot3([xmax; xmin; xmin; f_Ts_p05], t_fs(t_ind_p05max)*ones(4,1), [zmin; zmin; Hmax_fTp05; Hmax_fTp05+1], 'y--');      plot3([xmax; xmin; xmin; f_Ts_m05], t_fs(t_ind_m05max)*ones(4,1), [zmin; zmin; Hmax_fTm05; Hmax_fTm05+1], 'g--');      axis([xmin xmax ymin ymax zmin zmax]); grid;      view(20,30);      surf (f_Ts_out, t_fs, H_draw.');                     % |H(f,t)| als "Gebirge" zeichnen      title(sprintf('Magn. transfer function %s at T_{D}>%d T', ch_name, TDmin_fs));      zlabel(sprintf('|H(f, t)|  in dB    \\to'));      xlabel(sprintf('f*T  =  f*%3.1f\\mus    \\to', Ts_MHz));  ylabel('t / T    \to');    end;  end;if 0% if verbose(6)==1 & no_slices>10                          % #####  Plot scattering function    Sd  = sum(SF_out).'/tau_M;                             % Jakes pdf%   PDS = sum(SF_out.').'/no_slices;                       % power delay spectrum%    Jakes_pdf = 1./(pi*sqrt(1-fD_TDm_out(2:NFFT).^2));%    ind_Jak = find(Jakes_pdf<1);%    Jakes_pdf = Jakes_pdf(ind_Jak);%    fD_TDm_Jak = fD_TDm_out(ind_Jak+1);    xmin = min(tau_out);    xmax = max(tau_out);           % tau-Achse = Abszisse 1    ymin = -1;              ymax = 1;                      % fD-Achse  = Abszisse 2    zmin = 0;               zmax = 1.05*max(max(SF_out));  % SF-Achse = Ordinate    figure;    plot3([0 0], [ymin 0], [0 0], 'w-'); hold on;          % tau=0 Linie zeichnen%   plot3([xmin xmax], [0 0], [0 0], 'w-');                % fD =0 Linie zeichnen    axis([xmin xmax ymin ymax zmin zmax]); grid;    view(20,30);%   plot3(tau_out, zeros(size(tau_out)), PDS);             % plot PDS on t=tmax plane%   plot3(xmin*ones(size(fD_TDm_out)), fD_TDm_out, Sd);    % plot Jakes pdf on tau=tmin plane%    plot3(xmin*ones(size(fD_TDm_Jak)), fD_TDm_Jak, Jakes_pdf, 'r--'); % exakt Jakes pdf @ tau=tmin    xLines = ones(2,1)*tauES_fs;                           % Echo-Laufzeit-Striche vorne unten    yLines = [ymin; ymin+0.15*(ymax-ymin)]*ones(size(tauES_fs));    zLines = zeros(size(xLines));    plot3(xLines, yLines, zLines);    yLines = ones(2,1)*fDnorm.';    xLines = xmax*ones(size(yLines));                      % Norm. Doppler-Freq.-Linien in tau=0-Eb.    zLines = [zmin; zmin+0.15*(zmax-zmin)]*ones(size(ylines));    plot3(xLines, yLines, zLines);    surf (tau_out, fD_TDm_out, SF_out.');                  % SF(tau,fD) als "Gebirge" zeichnen    title(sprintf('Norm. scattering function %s at T_{D}>%d T', ch_name, TDmin_fs));    zlabel(sprintf('S_{c}(\\tau, f_{D}) = |F\\{h(tau,t)\\}|^2    \\to'));    ylabel('f_{D} / f_{D,max}    \to');    xlabel(sprintf('\\tau / T  =  \\tau / %3.1f\\mus    \\to', Ts_MHz));  end;  if any(verbose(2:5))==1    drawnow;  end;% EOF

⌨️ 快捷键说明

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