📄 ip_07_01.m
字号:
% 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -