光的折射和高通滤波器的幅频、相频特性matlab实验报告.doc_第1页
光的折射和高通滤波器的幅频、相频特性matlab实验报告.doc_第2页
光的折射和高通滤波器的幅频、相频特性matlab实验报告.doc_第3页
光的折射和高通滤波器的幅频、相频特性matlab实验报告.doc_第4页
光的折射和高通滤波器的幅频、相频特性matlab实验报告.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

实验报告课程名称: MATLAB与机电系统仿真 实验项目: Refraction&High-Pass Filter 专业班级: 姓 名: 学 号: 实验室号: 实验组号: 实验时间: 批阅时间: 指导教师: 成 绩: 沈阳工业大学实验报告(适用计算机程序设计类)专业班级: 学号: 姓名: 实验名称:Refraction & High-Pass Filter1. 实验目的:(1)、熟悉分支结构与循环结构的程序编写;(2)、练习使用分支结构与循环结构解决实际问题。2.实验内容:(1)、编写MATLAB程序,计算光路从一种介质入射到另一种介质当中时的折射角;并描绘出光路图;(2)、编写MATLAB程序,绘制出高通滤波器的幅频特性和相频特性。3. 实验方案(程序设计说明)【见附件A】4. 实验步骤或程序(经调试后正确的源程序)【主要步骤与程序代码等。见附件A】5程序运行结果 正确计算出折射角度(rad);较准确地绘制出高通滤波器的幅频、相频特性。6出现的问题及解决方法 在角度计算时,应注意将入射角折算成rad。附件A 沈阳工业大学实验报告(适用计算机程序设计类)专业班级: 学号: 姓名: 实验步骤或程序:(一)、Refraction(1)、创建一个新.m文件;(2)、编写MATLAB程序如下:%Script file:refraction.m%Purpose:% This program calculates the angle of incidence%Record of revisions:% Date Programmer Description of change% = = =% 12/04/10 xxxxxxxx Original code% Define variables:% a1 -the angle of incidence(in degerees) of the light in Region 1% a2 -the angle of incidence(in degerees) of the light in Region 2% n1 -the refractive index of Region 1% n2 -the refractive index of Region 2% conv -Degrees to radians conv factor% constantconv=pi/180;%Prompt the user for the values n1 and n2 and a1n1 = input (Enter the refraction n1:);n2 = input (Enter the refraction n2:);a1 = input (Enter the angle a1(in degrees):);if n1*sin(a1*conv)/n21 disp (No Solutions.); else a2 = asin(n1*sin(a1*conv)/n2)/conv; disp (the angle of incidence of the light in Region 2 is(in degrees):); fprintf (a2=%6.2fn,a2);endx1=-5:0.5:0;y1=-x1/tan(a1*conv);x2=0:0.5:5;y2=-x2/tan(a2*conv);plot(x1,y1,r,x2,y2,b);title(the plot of refraction);xlabel(法线方向)ylabel(介质分界面)axis(-5,5,-5,5)grid on;(3)、运行测试程序:输入第一组测试数据:1.0、1.7、45,结果及光路图如下: 输入第二组测试数据:1.7、1.0、45,结果如下:(二)、High-Pass Filter(1)、创建新.m 文件(2)、编写相应的MATLAB程序如下:% Script file:high-pass-hilter.m% Purpose:% This program calculates and plots the amplitude and phase responses % of this filter as a function of frequency.% Record of revisions:% Date Programmer Descrition of change% = = =% 11/30/10 wensheng Original code% Define variables:% amp -Amplitude response% C _Capacitance (farads)% f _Frequency of input signal(Hz)% phase _Phase response% R _Resistance (ohms)% res _Vo/Vi% Initialize R&CR=16000;C=1.0E-6;%Create array of input frequenciesf=1:2:1000%Caculate the responseres=(j*2*pi*f*R*C)./(1+j*2*pi*f*R*C)%Caculate the amplitude responseamp=abs(res)%Caculate the phase responsephase=angle(res)%Create plotssubplot(2,1,1);loglog(f,amp);title(Amplitude response);xlabel(Frequency (Hz);ylabel(Output/Input Ratio);grid on;subplot(2,1,2);semilogx(f,phase);title(Phase Response);xlabel(Frequency (Hz);ylabel(Output/Input Phase(rad);grid on;(2)、运行测试程

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论