ex5_3.m
来自「离散控制系统设计的MATLAB 代码」· M 代码 · 共 33 行
M
33 行
%%%%%%%%%%%%%%%%%% Example 5.3 %%%%%%%%%%%%%%%%%%% Discrete-Time Control Problems using %% MATLAB and the Control System Toolbox %% by J.H. Chow, D.K. Frederick, & N.W. Chbat %% Brooks/Cole Publishing Company %% September 2002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ---- Frequency components in a sampled signal ----%cleardisp('Example 5.3')fs = 10; Ts = 1/fs; % sampling at 10 Hzt = [0:Ts:0.9]'; % time points from 0 to 0.9 sece_1 = sin(2*pi*t); % 1-Hz signalN = 10; % length of datafr = fft(e_1)/N; % sampled signal spectrumfr = imag(fr); % extract imaginary part fr_paste = [fr; fr; fr]; % continue the spectrumfreq = [0:1:29]'; % extended frequency scale figuredplot(freq,fr_paste);gridhold on, plot([0 30],[0 0]), hold offaxis([0 30 -0.6 0.6])xlabel('Frequency (Hz)')ylabel('Amplitude')text(2,0.58,'Imaginary Part of Spectral Coefficients')axis([0 30 -0.65 0.65])title('Frequency spectrum of the sample signal e_1^*(t) for Example 5.3')%%%%%%%%%%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?