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

📄 ex020100.m

📁 DSP2 using matlab v4
💻 M
字号:
% Chapter 02: Example 02.01: Signal Synthesis%figure(1); clf% a) x(n) = 2*delta(n+2) - delta(n-4), -5<=n<=5n = [-5:5];x = 2*impseq(-2,-5,5)-impseq(4,-5,5);subplot(2,2,1); stem(n,x); title('Sequence in Example 2.1a')xlabel('n'); ylabel('x(n)'); axis([-5,5,-2,3])%% b) x(n) = n[u(n)-u(n-10)]+10*exp(-0.3(n-10))(u(n-10)-u(n-20)); 0<=n<=20n = [0:20];x1 = n.*(stepseq(0,0,20)-stepseq(10,0,20));x2 = 10*exp(-0.3*(n-10)).*(stepseq(10,0,20)-stepseq(20,0,20));x = x1+x2;subplot(2,2,2);stem(n,x);title('Sequence in Example 2.1b')xlabel('n');ylabel('x(n)');axis([0,20,-1,11])%% c) x(n) = cos(0.04*pi*n) + 0.2*w(n); 0<=n<=50, w(n): Gaussian (0,1)n = [0:50];x = cos(0.04*pi*n)+0.2*randn(size(n));subplot(2,2,3);stem(n,x);title('Sequence in Example 2.1c')xlabel('n');ylabel('x(n)');axis([0,50,-1.4,1.4])%% d) x(n) = {...,5,4,3,2,1,5,4,3,2,1,...}; -10<=n<=9n=[-10:9];x=[5,4,3,2,1];xtilde=x' * ones(1,4);xtilde=(xtilde(:))';subplot(2,2,4);stem(n,xtilde);title('Sequence in Example 2.1d')xlabel('n');ylabel('xtilde(n)');axis([-10,9,-1,6])

⌨️ 快捷键说明

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