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

📄 ex031200.m

📁 数字信号处理的程序集合之二
💻 M
字号:
n = -5:10; x = sin(pi*n/2);k = -100:100; w = (pi/100)*k;        % frequency between -pi and +piX = x * (exp(-j*pi/100)).^(n'*k);    % DTFT of x% signal decomposition[xe,xo,m] = evenodd(x,n);            % even and odd partsXE = xe * (exp(-j*pi/100)).^(m'*k);  % DTFT of xeXO = xo * (exp(-j*pi/100)).^(m'*k);  % DTFT of xo% verificationXR = real(X);                        % real part of Xerror1 = max(abs(XE-XR))             % DifferenceXI = imag(X);                        % imag part of Xerror2 = max(abs(XO-j*XI))           % Difference% graphical verificationsubplot(1,1,1)subplot(2,2,1); plot(w/pi,XR); grid; axis([-1,1,-2,2])xlabel('frequency in pi units'); ylabel('Re(X)');title('Real part of X')subplot(2,2,2); plot(w/pi,XI); grid; axis([-1,1,-10,10])xlabel('frequency in pi units'); ylabel('Im(X)');title('Imaginary part of X')subplot(2,2,3); plot(w/pi,real(XE)); grid; axis([-1,1,-2,2])xlabel('frequency in pi units'); ylabel('XE');title('Transform of even part')subplot(2,2,4); plot(w/pi,imag(XO)); grid; axis([-1,1,-10,10])xlabel('frequency in pi units'); ylabel('XO');title('Transform of odd part')

⌨️ 快捷键说明

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