信号处理仿真(MATLAB)实验系统仿真(MATLAB)实验2

合集下载

(完整版)数字信号处理实验二

(完整版)数字信号处理实验二
xlabel('时间序号n'); ylabel('振幅');
y = filter(num,den,x,ic);
yt = a*y1 + b*y2;
d = y - yt;
subplot(3,1,1)
stem(n,y);
ylabel('振幅');
title('加权输入: a \cdot x_{1}[n] + b \cdot x_{2}[n]的输出');
subplot(3,1,2)
%扫频信号通过2.1系统:
clf;
n = 0:100;
s1 = cos(2*pi*0.05*n);
s2 = cos(2*pi*0.47*n);
a = pi/2/100;
b = 0;
arg = a*n.*n + b*n;
x = cos(arg);
M = input('滤波器所需的长度=');
num = ones(1,M);
三、实验器材及软件
1.微型计算机1台
2. MATLAB 7.0软件
四、实验原理
1.三点平滑滤波器是一个线性时不变的有限冲激响应系统,将输出延时一个抽样周期,可得到三点平滑滤波器的因果表达式,生成的滤波器表示为
归纳上式可得
此式表示了一个因果M点平滑FIR滤波器。
2.对线性离散时间系统,若y1[n]和y2[n]分别是输入序列x1[n]和x2[n]的响应,则输入
plot(n, y);
axis([0, 100, -2, 2]);
xlabel('时间序号 n'); ylabel('振幅');

MATLAB实训报告_2

MATLAB实训报告_2

M AT L A B语言编程实训报告题目MATLAB在信号与系统中的应用年级2008 专业电子信息工程目录第一章绪论 (2)1.1 本设计课题目的及意义, 重点解决的问题 (2)1.1.1 MATLAB在信号与系统中应用的目的及意义 (2)1.1.2 重点解决的问题 (2)1.2 课题的社会和技术背景 (2)1.3 实现的具体功能 (3)第二章课题的基本概念和原理 (4)2.1 MATLAB的概念 (4)2.2 信号与系统的概念 (4)2.3 信号与系统分析的基本内容与方法 (5)2.4 离散系统的基本概念 (6)2.5连续系统模型及表示 (6)第三章系统设计和实现 (7)3.1采用的软件及开发平台 (7)3.1.1系统设计软件 (7)3.1.2开发平台和编程环境 (7)3.2系统的详细设计 (8)3.2.1建模 (8)3.2.2解决方法 (9)3.3系统设计的亮点 (9)第四章结束语 (10)参考文献 (10)第一章绪论1.1 本设计课题目的及意义, 重点解决的问题1.1.1 MATLAB在信号与系统中应用的目的及意义MATLAB在信号与系统中应用能够让学生熟悉MATLAB软件平台、工具箱、高效的数值计算及符号计算功能。

熟悉MATLAB软件的信号处理编程方法和结果的可视化。

了解数字信号处理的计算机仿真方法。

进一步加深对信号与系统的基本原理、方法及应用的理解。

MATLAB软件具有强大的数值分析和计算结果可视化的功能.运用MATLAB软件,通过一个应用实例,将信号与系统课程的理论与实践教学有机地结合,有效地解决了教学中的难点问题,说明了MATLAB软件在信号与系统课程的实践教学中具有重要的实际意义1.1.2 重点解决的问题matlab的基本使用方法, matlab的预定义函数, 如何用matlab绘图, 如何在matlab中编程, 基于matlab的矩阵运算、符号运算、数值分析等。

1.2 课题的社会和技术背景长期以来, “信号与系统”课程一直采用黑板式的单一的教学方式, 学生仅依靠做习题来巩固和理解教学内容, 对课程中大量的应用性较强的内容不能实际动手设计、调试、分析, 严重影响和制约了教学效果。

实验2 用MATLAB进行信号频谱分析 2

实验2   用MATLAB进行信号频谱分析 2

实验报告通信工程 1101学号:********* 姓名:李*实验2 用MATLAB 进行信号频谱分析一、实验目的㈠ 初步掌握MATLAB 产生常用离散时间信号的编程方法。

㈡ 学习编写简单的FFT 算法程序,对离散信号进行幅频谱分析。

㈢ 观察离散时间信号频谱的特点。

二、实验原理㈠ 常用的离散时间信号在 MATLAB 语言主要是研究离散信号的。

常用的离散信号有: 1.单位取样序列⎩⎨⎧≠==0001)(n n n δ2.单位阶跃序列⎩⎨⎧<≥=001)(n n n u3.实指数序列R a n a n x n∈∀=;)(4.复指数序列n e n x n j ∀=+)(0)(ωσ5.正(余)弦序列)cos()(0θω+=n n x n ∀ 6.周期序列n N n x n x ∀+=)()(㈡ 离散信号的产生离散信号的图形显示使用stem 指令。

在 MATLAB 中的信号处理工具箱中,主要提供的信号是离散信号。

由于MATLAB 对下标的约定为从1开始递增,例如x=[5,4,3,2,1,0],表示x(1)=5,x(2)=4,X(3)=3…因此要表示一个下标不由1开始的数组x(n),一般应采用两个矢量,如 n=[-3,-2,-1,0,l ,2,3,4,5];x=[1,-l ,3,2,0,4,5,2,1];这表示了一个含9个采样点的矢量:X(n)={x(-3),x(-2),x(-1),x(0),x(1),x(2),x(3),x(4),x(5)}。

1.单位取样序列⎩⎨⎧≠==δ0001)(n n n 这一函数实现的方法有二:方法一:可利用MATLAB 的zeros 函数。

x=zeros(1,N); %建立一个一行N 列的全零数组x(1)=1; %对X (1)赋1 方法二:可借助于关系操作符实现n=1:N;x=[n==1]; %n 等于1时逻辑关系式结果为真,x=1;n 不等于1时为假,x=0如要产生 ⎪⎩⎪⎨⎧≤<<=≤≤=-δ20210100)(10)(n n n n n n n n n n n n则可采用MATLAB 实现:n=n1:n2;x=[(n-n0)==0];%n=n0时逻辑关系式结果为真,x=1;n ≠n0时为假,x=0 2.单位阶跃序列⎩⎨⎧<≥=001)(n n n u这一函数可利用MATLAB 的ones 函数实现: x=ones(1,N);还可借助于关系操作符“>=”来实现。

仿真软件使用实验报告

仿真软件使用实验报告

实验名称:仿真软件应用实验实验日期:2023年X月X日实验地点:XX大学计算机实验室实验目的:1. 熟悉仿真软件的基本操作和功能。

2. 通过仿真实验,加深对理论知识的应用理解。

3. 培养分析问题、解决问题的能力。

一、实验环境1. 操作系统:Windows 102. 仿真软件:MATLAB R2022a3. 硬件环境:*****************************,16GB RAM二、实验内容本次实验以MATLAB仿真软件为平台,对以下内容进行仿真实验:1. 信号与系统2. 控制系统3. 通信系统三、实验步骤1. 信号与系统(1)建立仿真模型根据信号与系统的理论知识,设计一个简单的信号处理系统。

该系统包括输入信号、滤波器、输出信号等部分。

(2)编写仿真程序使用MATLAB编写程序,实现信号处理系统的仿真。

具体步骤如下:① 定义输入信号③ 信号处理④ 绘制输出信号(3)运行仿真程序运行仿真程序,观察输出信号的变化,分析滤波器的性能。

2. 控制系统(1)建立仿真模型根据控制系统的理论知识,设计一个简单的控制对象。

该对象包括控制器、被控对象、反馈环节等部分。

(2)编写仿真程序使用MATLAB编写程序,实现控制系统的仿真。

具体步骤如下:① 定义被控对象② 设计控制器③ 控制过程④ 绘制控制曲线(3)运行仿真程序运行仿真程序,观察控制曲线的变化,分析控制器的性能。

3. 通信系统(1)建立仿真模型根据通信系统的理论知识,设计一个简单的通信系统。

该系统包括信源、信道、信宿等部分。

(2)编写仿真程序使用MATLAB编写程序,实现通信系统的仿真。

具体步骤如下:① 定义信源③ 信号传输④ 信号接收⑤ 信号解调(3)运行仿真程序运行仿真程序,观察信号传输、接收和解调的过程,分析通信系统的性能。

四、实验结果与分析1. 信号与系统仿真结果显示,滤波器能够有效地对输入信号进行处理,输出信号满足设计要求。

滤波器的性能指标如下:- 通带波动:0.5dB- 阻带衰减:40dB- 截止频率:1kHz2. 控制系统仿真结果显示,控制器能够稳定地控制被控对象,控制曲线满足设计要求。

基于MATLAB的信号与系统仿真实验

基于MATLAB的信号与系统仿真实验
真 实验 , 明 了将 MA L B应 用于教 学 实践 中的重要作 用和意 义 说 TA 关键 词 :MA L B; 号与 系统 ; 真 TA 信 仿
中图分类 号 : 6 2 G 4
文献标 识码 : 文章 编号 : O 1 0 1 0 90 — 0 2 0 A 粤 一 1 1 ( 0 )4 0 5 — 4 2
时 域 和频域 的各种 计算 、 解 和 变换 , 相加 、 分 如 相 乘、 移位 、 折 、 立 叶变 换 、 氏变换 、 换 和 反 傅 拉 z变 频 谱分 析等 多种计 算 功能 。 下 面 以抽样 信号 的实 现 、 周期 方 波信 号 傅立 叶 级数 分解 、两个余 弦周期 信 号 的相 加 与相 乘 、 R C带 通 滤 波 器 的 频 谱 特 性 等 仿 真 实 例 说 明 L
第 1 6卷 第 4期
20 0 9年 l O月
广 东 白 云


学 报
V0 . 6 No4 11 .
0c. 0 t20 9
J u n l f u n d n ay n Un v ri o r a a g o gB iu ie st oG y
基于 MA L B的信号与系统仿真实验 TA

( ) 友好 的用 户界 面及 接近数 学表 达式 的 3
自然 化语 言 , 易于学 习和掌握 , 编程效 率极 高 ;
( 4) 开放性 好 ,能与 多种 平 台工具 软件兼
容;
( 功能 丰富 的应用 工具 箱 , 5) 具有 广泛解 决 各学科专 业领域 内复杂 问题的能 力 。㈩
《 信号与 系统 》 电气 信 息类专 业 的重要 专 是
业 基础课 , 理论 性 较 强, 其 概念 抽 象而 难 以理 解 , 公 式推 导 复 杂 、 算 繁 琐 , 统分 析 时 的时 域 图 计 系

数字信号处理(第2版)教学课件第8章 MATLAB仿真实验

数字信号处理(第2版)教学课件第8章 MATLAB仿真实验
系统的时域特性是指系统的线性移不变性质、因果性 和稳定性。重点分析实验系统的稳定性,包括观察系统的 暂态响应和稳定响应。
系统的稳定性是指对任意有界的输入信号,系统都能 得到有界的系统响应,或者系统的单位脉冲响应满足绝对 可和的条件。系统的稳定性由其差分方程的系数决定。
实际中检查系统是否稳定,不可能检查系统对所有有界 的输入信号、输出是否都是有界输出,或者检查系统的单位 脉冲响应满足绝对可和的条件。可行的方法是在系统的输入 端加入单位阶跃序列,如果系统的输出趋近一个常数(包括 零),就可以断定系统是稳定的。系统的稳态输出是指当n→ ∞时系统的输出。如果系统稳定,信号加入系统后,系统输出 的开始一段称为暂态效应,随着n的加大,幅度趋于稳定,达 到稳态输出。
(2)频域采样理论的验证。 给定长度为26的三角波序列x(n) 编写程序,分别对频谱函数 X (e j ) FT[x(n)] 在区间 [0, 2π] 上等间隔采样32点和16点,得到 X32 (k) 和 X16 (k) ,再分别对 X32 (k)
和 ①X16分(k)别进画行出32X点(ej和 )、16X点32 (IkF)F和T,X1得6 (k到) 的x幅32 (度n)谱和。x16 (n) 。要求:
4. 参考程序
(1)内容1参考程序,实验结果。 (2)内容2参考程序,实验结果。 (3)内容3参考程序,实验结果。
5.实验结果
图8-1 调用filter解差分方程仿真结果
5.实验结果
图8-2 稳定性分析方面的仿真结果
5.实验结果
图8-3 稳定性分析仿真结果
实验二 时域采样与频域采样
1. 实验目的
y(n) 0.5y(n 1) 0.25y(n 2) x(n) 2x(n 1) x(n 3)

信号与系统MATLAB实验

信号与系统MATLAB实验

2016-2017学年第一学期信号与系统实验报告班级:姓名: 学号: 成绩:指导教师:实验一 常见信号的MATLAB 表示及运算一.实验目的1.熟悉常见信号的意义、特性及波形2.学会使用MATLAB 表示信号的方法并绘制信号波形 3. 掌握使用MATLAB 进行信号基本运算的指令 4. 熟悉用MATLAB 实现卷积积分的方法二.实验原理信号一般是随时间而变化的某些物理量。

按照自变量的取值是否连续,信号分为连续时间信号和离散时间信号,一般用()f t 和()f k 来表示。

若对信号进行时域分析,就需要绘制其波形,如果信号比较复杂,则手工绘制波形就变得很困难,且难以精确。

MATLAB 强大的图形处理功能及符号运算功能,为实现信号的可视化及其时域分析提供了强有力的工具。

根据MATLAB 的数值计算功能和符号运算功能,在MATLAB 中,信号有两种表示方法,一种是用向量来表示,另一种则是用符号运算的方法。

在采用适当的MATLAB 语句表示出信号后,就可以利用MATLAB 中的绘图命令绘制出直观的信号波形了。

下面分别介绍连续时间信号和离散时间信号的MATLAB 表示及其波形绘制方法。

1.连续时间信号所谓连续时间信号,是指其自变量的取值是连续的,并且除了若干不连续的点外,对于一切自变量的取值,信号都有确定的值与之对应。

从严格意义上讲,MATLAB 并不能处理连续信号。

在MATLAB 中,是用连续信号在等时间间隔点上的样值来近似表示的,当取样时间间隔足够小时,这些离散的样值就能较好地近似出连续信号。

在MATLAB 中连续信号可用向量或符号运算功能来表示。

⑴ 向量表示法对于连续时间信号()f t ,可以用两个行向量f 和t 来表示,其中向量t 是用形如12::t t p t 的命令定义的时间范围向量,其中,1t 为信号起始时间,2t 为终止时间,p 为时间间隔。

向量f 为连续信号()f t 在向量t 所定义的时间点上的样值。

北邮数字信号处理MATLAB实验报告

北邮数字信号处理MATLAB实验报告

数字信号处理软件实验——MatLab仿真实验报告学院:电子工程学院班级:2013211202姓名:学号:实验一:数字信号的 FFT 分析1、实验内容及要求(1) 离散信号的频谱分析:设信号 此信号的0.3pi 和 0.302pi 两根谱线相距很近,谱线 0.45pi 的幅度很小,请选择合适的序列长度 N 和窗函数,用 DFT 分析其频谱,要求得到清楚的三根谱线。

(2) DTMF 信号频谱分析用计算机声卡采用一段通信系统中电话双音多频(DTMF )拨号数字 0~9的数据,采用快速傅立叶变换(FFT )分析这10个号码DTMF 拨号时的频谱。

2、实验目的通过本次实验,应该掌握:(a) 用傅立叶变换进行信号分析时基本参数的选择。

(b) 经过离散时间傅立叶变换(DTFT )和有限长度离散傅立叶变换(DFT ) 后信号频谱上的区别,前者 DTFT 时间域是离散信号,频率域还是连续的,而 DFT 在两个域中都是离散的。

(c) 离散傅立叶变换的基本原理、特性,以及经典的快速算法(基2时间抽选法),体会快速算法的效率。

(d) 获得一个高密度频谱和高分辨率频谱的概念和方法,建立频率分辨率和时间分辨率的概念,为将来进一步进行时频分析(例如小波)的学习和研究打下基础。

(e) 建立 DFT 从整体上可看成是由窄带相邻滤波器组成的滤波器组的概念,此概念的一个典型应用是数字音频压缩中的分析滤波器,例如 DVD AC3 和MPEG Audio 。

3.设计思路及实验步骤1)离散信号的频谱分析:该信号中要求能够清楚的观察到三根谱线。

由于频率0.3pi 和0.302pi 间隔非常小,要清楚的显示,必须采取足够大小的N ,使得分辨率足够好,至少到0.001单位级,而频率0.45pi 的幅度很小,要清楚的观察到它的谱线,必须采取幅度够大的窗函数,使得它的频谱幅度变大一些。

同时还要注意频谱泄漏的问题,三个正弦函数的周期(2pi/w )分别为20,40,1000,所以为了避免产生频谱泄漏(k=w/w0为整数),采样点数N 必须为1000的整数倍。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

信号处理仿真(MATLAB)实验指导书青岛大学自动化工程学院2006年4月MATLAB实验一一、实验目的:1. Be familiar with MATLAB Environment2. Be familiar with array and matrix3. Be familiar with MATLAB operations and simple plot function二、实验内容:1. Be familiar with Matlab 6.5Startup Matlab 6.5, browse the major tools of the Matlab desktop The Command WindowsThe Command History WindowsLaunch PadThe Edit/Debug WindowFigure WindowsWorkspace Browser and Array EditerHelp BrowserCurrent Directory Browser2. Give the answer of the following questions for the array 1)What is the size of array1?2)What is the value of array1(4,1)?3)What is the size and value of array1(:,1:2)?4)What is the size and value of array1([1 3], end)?3. Give the answer of the following commad1) a=1:2:5; 2) b=[a’ a’ a’]; 3) c=b(1:2:3,1:2:3);4) d=a+b(2,:) 5) w=[zeros(1,3) ones(3,1)’ 3:5’]4. Give the answer of the sub-arrays1) array1(3,:); 2) array1(:,3); 3) array1(1:2:3,[3 3 4]) 4) array1([1 1],:)5. Give the answer of the following operations1) a+b 2) a*d 3) a.*d 4) a*c5) a.*c 6)a\b 7) a.\b 8)a.^b6.Solve the following system of simultaneous equations for x 7.Edit & Run the m-file% test step response functionwn=6; kosi=[0.1:0.1:1.0 2];figure(1); hold onfor kos=kosinum=wn^2; den=[1,2*kos*wn,wn.^2]; step(num,den)endhold off;8.Edit & Run the m-file% test plot functionx=0:pi/20:3*pi; y1=sin(x); y2=2*cos(2*x); plot(x,y1,'rv:',x,y2,'bo--');title('Plot the Line of y=sin(2x) and its derivative'); xlabel('X axis'); ylabel('Y axis');legend('f(x)','d/dx f(x)'); grid on;9. Edit & Run the m-file% test subplot and loglog functionx=0:0.1:10; y=x.^2-10.*x+26;subplot(2,2,1); plot(x,y); grid on;subplot(2,2,2); semilogx(x,y); grid on;subplot(2,2,3); semilogy(x,y); grid on;subplot(2,2,4); loglog(x,y); grid on;10.Edit & Run the m-file% test max and plot functionvolts=120; rs=50; rl=1:0.1:100;amps=volts./(rs+rl); pl=(amps.^2).*rl; [maxvol,index]=max(pl);plot(rl,pl,rl(index),pl(index),'rh'); grid on;MATLAB实验二一、实验目的:1. Learn to design branch and loop statements program2. Be familiar with relational and logical operators3. Practice 2D plotting二、实验内容:PART I: (选择练习,不需提交实验报告)1. Hold command exercisen x=-pi:pi/20:pi;n y1=sin(x); y2=cos(x); plot(x,y1, 'b-'); hold on;n plot(x,y2, 'k--'); hold off;n legend ('sinx', 'cosx')2. Figure command exercisefigure(1);subplot(2,1,1);x=-pi:pi/20:pi; y=sin(x); plot(x,y); grid on;title('Subplot 1 Title');subplot(2,1,2);x=-pi:pi/20:pi; y=cos(x); plot(x,y); grid on;title('Subplot 2 Title');3. Polar Plots exerciseg=0.5;theta=0:pi/20:2*pi;gain=2*g*(1+cos(theta));polar(theta,gain,'r-');title('\fontsize{20} \bfGain versus angle \theta');4. Compare the 3 approaches follows (Loops and Vectorization)%A. Perform calculation by For Loop with pre-initialize arraytic;n square=zeros(1,10000) %pre-initialize arrayn for ii=1:10000n square(ii)=ii^2;n square_root(ii)=ii^(1/2);n cube_root(ii)=ii^(1/3);n endn toc; t1=toc%B. Perform calculation by For Loop without pre-initialize arrayn tic;n for ii=1:10000n square(ii)=ii^2;n square_root(ii)=ii^(1/2);n cube_root(ii)=ii^(1/3);n endn toc; t2=toc%C. Perform calculation with vectorsn tic;ii=1:10000n square(ii)=ii.^2;square_root(ii)=ii.^(1/2);cube_root(ii)=ii.^(1/3);n endn toc; n t3=tocPART II: (需提交实验报告)1. Assume that a,b,c, and d are defined, and evaluate the following expression.a=20; b=-2; c=0; d=1;(1) a>b; (2) b>d; (3) a>b&c>d; (4) a==b; (5) a&b>c; 6) ~~b;a=2; b=[1 –2;-0 10]; c=[0 1;2 0]; d=[-2 1 2;0 1 0];(7) ~(a>b) (8) a>c&b>c (9) c<=da=2; b=3; c=10; d=0;(10) a*b^2>a*c (11) d|b>a (12) (d|b)>aa=20; b=-2; c=0; d=’Test’;(13) isinf(a/b) (14) isinf(a/c) (15) a>b&ischar(d) (16) isempty(c)2. Write a Matlab program to solve the function, where x is a number <1. Usean if structure to verify that the value passed to the program is legal. If the value of x is legal, caculate y(x). If not ,write a suitable error message and quit.3. Write out m. file and plot the figures with gridsAssume that the complex function f(t) is defined by the equationf(t)=(0.5-0.25i)t-1.0Plot the amplitude and phase of function for4. Write the Matlab statements required to calculate y(t) from the equationfor value of t between –9 and 9 in steps of 0.5. Use loops and branches to perform this calculation.5. Write an m.file to evalue the equation for all values of x between 0.1 and 3,in steps of 0.1. Do this twice, once with a for loop and once with vectors.Plot the resulting function using a 4.0 thick dashed blue line.MATLAB实验三一、实验目的:1. Learn to write MATLAB functions2. Be familiar with complex data and character data3. Practice 2D plotting二、实验内容:1. Write three Matlab functions to calculate the hyperbolic sine, cosine, andtangent functions:then plot the shapes of hyperbolic sine, cosine, and tangent functions on one figure, .2. Write a program use the function and plot the line,and search for the minimum and maximum in 200 steps over the range of , mark the minimum and maximum on the line figure.3. Write a function to calculate the distance between two points and , that the points should begiven by ‘input’ function.4. Write a function complex_to that accept a complex number var, andreturns two output arguments containing the magnitude mag and angle theta of the complex number. The output angle should be in degrees.Write another function polar_to_complex that accepts two input arguments containing the magnitude mag and angle theta of the complex number in degrees, and returns the complex number var.5. Write a program that accepts a series of strings from a user with the inputfunction, sorts the strings into ascending order, and prints them out.MATLAB实验四一、实验目的:1. Practice 2D plotting and 3D plotting2. Learn to use fplot function3. Be familiar with cell arrays and structure arrays二、实验内容:1. Give the 3D plot figure of use plot3 function, , and grid on, linewidth is3.0.2. Plot the function , , step 0.1. Create the following plot types: (a) stem plot;(b) stair plot; (c) bar plot; (d) compass plot.3. Plot the function over the range using function fplot, and grid on.4. Create a cell arrays:5. Create a structure arrays and to calculate the mean billing of threepatients:MATLAB实验五一、实验目的:Be familiar with Input/Output functions二、实验内容:1. Write a m-file. The m-file creates an array containing random values,sorts the array into ascending order, opens a user-specified file for writing only, then writes the array to disk in 32-bit floating-point format , and close the file. It then opens the file and read the data back into array.2. Edit a file as data4_4.txt that contains square matrix, then import thearray use uiimport function, and calculate the inverse of the square matrix .3. Write a program to read a set of integers from an input data file, andlocate the largest and smallest values within the data file. Print out the largest and smallest values, together with the lines on which they were found in one figure.。

相关文档
最新文档