1 / 10

实验一 熟悉 MATLAB 环境

实验一 熟悉 MATLAB 环境. 常用离散时间信号的仿真. [ 实验内容 ]. 1 .用 MATLAB 实现函数 impseq(n0,n1,n2) ,使函数实现 δ (n-n0) 。 该函数的格式为: Function [x,n]=impseq(n0,n1,n2) % Generate x(n)=delta(n-n0);n1<=n<=n2 % [x,n]=impseq(n0,n1,n2) 2 .用 MATLAB 实现函数 stepseq(n0,n1,n2) ,使函数实现 u(n-n0) , 。 该函数的格式为:

Download Presentation

实验一 熟悉 MATLAB 环境

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 实验一 熟悉MATLAB环境 • 常用离散时间信号的仿真

  2. [实验内容] • 1.用MATLAB实现函数impseq(n0,n1,n2),使函数实现 δ(n-n0)。 • 该函数的格式为: • Function [x,n]=impseq(n0,n1,n2) • % Generate x(n)=delta(n-n0);n1<=n<=n2 • % [x,n]=impseq(n0,n1,n2) • 2.用MATLAB实现函数stepseq(n0,n1,n2),使函数实现u(n-n0), 。 • 该函数的格式为: • function [x,n]=stepseq(n0,n1,n2) • %Generate x(n)=u(n-n0);n1<=n<=n2 • %[x,n]=stepseq(n0,n1,n2) • 3. 用MATLAB实现常见的离散时间序列。

  3. 1.单位脉冲序列 • Unit sample sequence • Representation in MATLAB

  4. Function [x,n]=impseq(n0,n1,n2) • A: n=[n1:n2]; • x = zeros(1,n2-n1+1); x(n0-n1+1)=1; • B: n=[n1:n2]; x = [(n-n0)==0]; stem(n,x,’ro’);

  5. 2. 单位阶跃序列 Unit step sequence A: n=[n1:n2]; x=zeros(1,n2-n1+1); x(n0-n1+1:end)=1; B: n=[n1:n2]; x=[(n-n0)>=0];

  6. 3. 实指数序列 For Example: n=[0:10]; x=(0.9).^n; stem(n,x,’ro’)

  7. 4. 复指数序列 Attenuation: 衰减因子 frequency in radians: For Example: n=[0:10]; x=exp((2+3j)*n);

  8. 5. 正弦序列 Phase in radians For Example: n=[0:10]; x=3*cos(0.1*pi*n+pi/3)+2*sin(0.5*pi*n)

  9. 6. 随机序列 • Rand(1,N) • Generate a length N random sequence whose elements are uniformly distributed between [0,1] • Randn(1,N) • Generate a length N Gaussian random sequence with mean 0 and variance 1. en [0,1]

  10. 7. 周期序列 • A sequence x(n) is periodic if x(n)=x(n+N) • The smallest integer N is called the fundamental period • For example • A: xtilde=[x,x,x,…x] • B: xtilde=x’*ones(1,P); xtilde=xtilde(:); xtilde=xtilde’; transposition

More Related