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

📄 program_03_02.m

📁 matlab在仿真实现实验的过程中很有用
💻 M
字号:
% Program 3_2
% Illustration of DFT Computation
%
% Read in the length N of sequence and the desired
% length M of the DFT

colordef black;
N = input('Type in the length of the sequence = ');
M = input('Type in the length of the DFT = ');
%  Generate the length-N time-domain sequence
u = [ones(1,N)];
% Compute its M-point DFT
U = fft(u,M);
% Plot the time-domain sequence and its DFT
t = 0:1:N-1;
stem(t,u,'g')
title('Original time-domain sequence')
xlabel('Time index n'); ylabel('Amplitude')
pause
subplot(2,1,1)
k = 0:1:M-1;
stem(k,abs(U))
title('Magnitude of the DFT samples')
xlabel('Frequency index k'); ylabel('Magnitude')
subplot(2,1,2)
stem(k,angle(U),'g')
title('Phase of the DFT samples')
xlabel('Frequency index k'); ylabel('Phase')

⌨️ 快捷键说明

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