已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
MATLAB机考样题:(1)Generate and plot sequence , with.n1=-20:20;x1=2*cos(pi/8*n1);n2=n1-4;x2=2*cos(pi/8*n2);subplot(2,1,1);plot(n1,x1);subplot(212);plot(n2,x2);(2)Write a MATLAB program to compute and plot the impulse response of a causal finite-dimensional discrete-time system characterized by a difference equation of the following form: N=input(请输入你要求的点数N=);num=1.8 0.34 -1.32 -0.86;den=1 0.3 0.5 -0.72;x=1 zeros(1,N-1);(单位冲击)y=filter(num,den,x);plot(0:N-1,y);(3)Write a MATLAB program to compute and display the poles and zeros, to compute and display the second-order factored form, and to generate the pole-zero plot of a z-transform that is a ratio of two polynomials in z-1. Using this program to analyze the following G(z):num=8.1 6.93 -23.82 10.5;den=1 1.52 0.18 -0.1768;sos=tf2sos(num,den) %tf2sos表示为1/z的升幂zplane(num,den)(4)Try to give a program to evaluate the following DTFT in the range :%由于用freqz计算频点至少是2个,所以至少输入两个频点w1=input(请输入你要计算的频点w1=);w2=input(请输入你要计算的频点w2=);w=w1 w2;num=2 5 9 5 3;den=5 45 2 1 1;h=freqz(num,den,w)(6)Write a MATLAB program to compute and plot the magnitude response of a causal LTI discrete-time system with a transfer function given bynum=0.15*1 0 -1;den=1 -0.5 0.7;h,w=freqz(num,den,512);plot(w/pi,abs(h);(7)Consider the following FIR transfer function:Using MATLAB to determine its zero locations and plot its magnitude and phase response.h=1 0.6 .49 -0.48 -0.14 -0.12 0.09;figure(1)zplane(h,1);H,w=freqz(h,1,512);figure(2)plot(w/pi,abs(H);figure(3)plot(w/pi,angle(H);(8)Given a signal , when using a sampling frequency fT= 20KHz, plot the magnitude and phase spectrum of the sampled sequence(given length-64).fs=2e4;n=0:63;x=4*n/fs+cos(0.1*pi*n/fs);h=fft(x,1024);figure(1);plot(0:2/1023:2,abs(h);figure(2);plot(0:2/1023:2,angle(h);(9)design an IIR butterworth digital lowpass filter with the following specifications: sampling rate of 40kHz, passband edge frequency of 4kHz, stopband edge frequency of 8kHz, passband ripple of 0.5dB, and a minimum stopband attenuation of 40dB,plot frequency-magnitude and check if your design fits the specification.fs=40;wp=4*2/fs; %wp1,没有乘piws=8*2/fs; %ws1,没有乘piap=0.5;as=40;n,wn=buttord(wp,ws,ap,as);num,den=butter(n,wn);h,w=freqz(num,den,512);figure(1);plot(w/pi,20*log10(abs(h);axis(0 1 -50 0);figure(2);subplot(2,1,1);plot(w/pi,20*log10(abs(h)axis(0 wp -0.5 0);title(通带纹波);subplot(2,1,2);plot(w/pi,20*log10(abs(h);axis(ws 1 -50 -30);title(阻带纹波); (10)Design a Hanning FIR lowpass filter meeting the following specifications: passband edge frequency=2kHz, stopband edge frequency=2.5kHz, passband ripple p=0.005, stopband ripples=0.005, and sampling rate of 10kHz.Plot its gain and phase responses and check if it meets the specifications?ft=10;fp=2;fs=2.5;wp=2*pi*fp/ft;ws=2*pi*fs/ft;ds=0.005;ap=20*log10(1-ds)as=20*log10(ds)wc=(wp+ws)/2;dw=ws-wp;M=ceil(3.11*pi/dw);N=2*M;b=fir1(N,wc/pi,hann(N+1);h,w=freqz(b,1,512);figure(1);plot(w/pi,20*log10(abs(h);axis(0 1 -50 0);title(magitude response);figure(2);plot(w/pi,unwrap(angle(h);title(phase response);figure(3);subplot(211);plot(w/pi,20*log10(abs(h);axis(0 wp/pi ap 0);title(通带纹波)subplot(212);plot(w/pi,20*log10(abs(h);axis(ws/pi 1 as 0);title(阻带纹波);%从图中可以看出,通带和阻带中纹波都不满足要求,所以不满足指标%as= -46.020643.9 所以不能用hanning窗设计%应当用hamming或blackman窗设计(11)Writing a MATLAB program to compute 128-point DFT of the following sequence, you must firstly use DFT definition (directly computing DFT) to compute and use MATLAB function to test the result. Plot the two results in one figure.n=0:31;k=1:128;x=sin(pi*n/4);Xk1=zeros(1,128); for t=1:128 for m=1:32 Xk1(t)=Xk1(t)+x(m)*exp(-1i*2*pi*(t-1).*(m-1)/128); endendsubplot(2,1,1);plot(k,Xk1);Xk2=fft(x,128);subplot(2,1,2);plot(k,Xk2);(12) Using the function fir1 and window of Kaiser, design a linear-phase FIR lowpass filter meeting the following specifications: passband edge frequency=2kHz, stopband edge frequency=2.5kHz, passband ripple p=0.005, stopband ripples=0.005, and sampling rate of 10kHz.Plot its gain and phase responses and check if it meets the specifications?Design a Type 1 Chebyshev IIR lowpass filter meeting the specifications as below: sampling rate of 12kHz, passband edge frequency of 2.1kHz, stopband edge frequency of 2.7kHz, passband ripple of 0.6dB, and a minimum stopband attenuation of 45dB. Write down the exact expression for the transfer function generated. Does your design meet the specifications? Fp=2100;Fs=2700;Ft=12000;Rp=0.6;Rs=45;Wp=2*Fp/Ft;Ws=2*Fs/Ft;N,Wn=cheb1ord(Wp,Ws,Rp,Rs)B,A=cheby1(N,Rp,Wn)h,w=freqz(B,A,512);figure(1);plot(w/pi,20*log10(abs(h);axis(0 1 -50 0);figure(2);subplot(2,1,1);plot(w/pi,20*log10(abs(h)axis(0 Wp -0.6 0);title(通带纹波);subplot(2,1,2);plot(w/pi,20*log10(abs(h);axis(Ws 1 -50 -30);title(阻带纹波);(13)Using the function fir1 and window of Kaiser, design a linear-phase FIR lowpass filter meeting the following specifications: passband edge frequency=2kHz, stopband edge frequency=2.5kHz, passband ripple p=0.005, stopband ripples=0.005, and sampling rate of 10kHz.Plot its gain and phase responses and check if it meets the specifications?n,wn,beta,typ=kaiserord(2000 2500,1 0,0.005 0.005,10000);b=fir1(n,wn,kaiser(n+1,beta),noscale);h,omega=freqz(b,1,256);subplot(2,1,1);plot(omega/pi,20*log10(abs(h);xlabel(omega/pi); ylabel(Gain, dB);subplot(2,1,2)plot(omega/pi,angle(h);gridtitle(Phase Spectrum);xlabel(omega/pi); ylabel(Phase, radians);(14)Given a signal when using a sampling frequency fT= 20KHz, plot the magnitude and phase spectrum of the sampled sequence(given length-64). ft=20000;n=1:64;x=sin(0.1*pi*n/ft)+2*cos(0.3*pi*5*n/ft)+3*sin(0.5*pi*n/ft);subplot(2,1,1);h,w=freqz(x,1,256);plot(w/pi,abs(h);title(Magnitude spectrum of the sampled samples);xlabel(omega/pi); ylabel(Magnitude);subplot(2,1,2);plot(w/pi,angle(h);title(Phase spectrum of the sampled samples);xlabel(omega/pi); ylabel(Phase);(15) Write a MATLAB program to compute the first L samples of the inverse of rational z-transforms where the value of L is provided by the user through the command input. Using this program to compute and plot the first 50 samples of the inverse of following G(z). Use the command stem for plotting the sequence gener
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 液化气使用安全培训试题库手册
- Unit 1 Happy Holiday (Period 5)Section B (2a-Reflecting)同步练25025-2026学年人教版八年级上册英语
- 2025-2026学年上海虹口区八年级下学期期末数学试卷及答案
- 放疗期间放化疗期间舒适护理
- 2026北京协和医院药剂科合同制药剂员(调剂岗)招聘参考题库【能力提升】附答案详解
- 护理质量控制:促进护理服务标准化建设
- 淹溺的紧急处理与护理
- 甘肃省白银市2026-2027学年八上数学期末经典模拟试题含解析
- 浙江省舟山市2026年物理八年级第一学期期末检测试题含解析
- 固原市重点中学2026-2027学年物理八年级第一学期期末学业质量监测试题含解析
- 材料的磁性能2
- 《威尼斯的小艇》的教案设计5篇
- 模拟电子技术(第11版英文版)PPT完整全套教学课件
- 人教版小学数学五年级下册练习题
- 2023年火电电力职业技能鉴定考试-装卸机械电器修理工考试题库(含答案)
- GB/T 5563-2013橡胶和塑料软管及软管组合件静液压试验方法
- GB/T 3836.34-2021爆炸性环境第34部分:成套设备
- GB/T 16895.6-2014低压电气装置第5-52部分:电气设备的选择和安装布线系统
- GB 12476.1-2013可燃性粉尘环境用电气设备第1部分:通用要求
- 第五章岩石爆破理论详解课件
- 综合金融视角下寿险公司高净值客户开发与经营模式课件
评论
0/150
提交评论