ip_07_01.m
来自「MATLAB通信系统仿真(程序库)」· M 代码 · 共 29 行
M
29 行
% MATLAB script for Illustrated Problem 1, Chapter 7. echo onT=1; delta_T=T/200; % sampling interval alpha=0.5; % roll-off factor fc=40/T; % carrier frequencyA_m=1; % amplitudet=-5*T+delta_T:delta_T:5*T; % time axisN=length(t);for i=1:N, if (abs(t(i))~=T/(2*alpha)), g_T(i) = sinc(t(i)/T)*(cos(pi*alpha*t(i)/T)/(1-4*alpha^2*t(i)^2/T^2)); else g_T(i) = 0; % the value of g_T is 0 at t=T/(2*alpha) end; % and, at t=-T/(2*alpha) echo off ;end;echo on;G_T=abs(fft(g_T)); % spectrum of g_Tu_m=A_m*g_T.*cos(2*pi*fc*t); % the modulated signalU_m=abs(fft(u_m)); % spectrum of the modulated signal% actual frequency scalef=-0.5/delta_T:1/(delta_T*(N-1)):0.5/delta_T;% plotting commands followfigure(1);plot(f,fftshift(G_T)); axis([-1/T 1/T 0 max(G_T)]);figure(2);plot(f,fftshift(U_m));
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?