




已阅读5页,还剩11页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
matlab 作业 姓名:唐建秋 学号:2902102017 指导老师:朱学勇m2.2(b) n=1:1:20; stem(n,sin(0.8*pi*n+0.8*pi);xlabel(n);ylabel(amplitude) (c) n=1:1:40; y= real(exp(i*pi*n/5)+ imag(exp(i*pi*n/10); stem(n,y);xlabel(n);ylabel(amplitude) (d) n=1:1:40; x = 5*cos(1.5*pi*n+0.75*pi)+4*cos(0.6*pi*n)-sin(0.5*pi*n); stem(n,x); xlabel(n);ylabel(amplitude) (e) n=1:1:80; x = 5*cos(1.5*pi*n+0.75*pi)+4*cos(0.6*pi*n)-sin(0.5*pi*n); stem(n,x); xlabel(n);ylabel(amplitude) m2.7alpha = input(alpha = ); y0 = -1; y1 = 0.5*(y0 + (alpha/y0); while abs(y1-y0)0.00001 y2 = 0.5*(y1+(alpha/y1); y0 = y1; y1 = y2; end disp(squre root of alpha is); disp(y1); alpha = 2squre root of alpha is -1.4142 m2.9 x n =4,5,1,2,3,0,2, -3=n=3; y n =6,3,1,0,8,7,2 ,-1=n=5 w n = 3,2,2,1,0,2,5, 2=n=8 ww = 4,5,1,2,3,0,2 c_ww,lags = xcorr(ww,10,coeff); stem(lags,c_ww) r xx n =8,10,14,11,23,11,59,11,23,11,14,10,8,-6=n=6 r yy n =12,48,29,31,30,27,163,27,30,31,29,48,12,-6=n=6 r ww n =15,4,6,12,6,2,47,2,6,12,6,10,15, -6=n=6 m3.1 k = input(number of frequency points = );num = input(numerator coefficients = );den = input(denominator coefficients = );w = 0:pi/(k-1):pi;h = freqz(num, den, w);subplot(2,2,1)plot(w/pi,real(h);gridtitle(real part)xlabel(omega/pi); ylabel(amplitude)subplot(2,2,2)plot(w/pi,imag(h);gridtitle(imaginary part)xlabel(omega/pi); ylabel(amplitude)subplot(2,2,3)plot(w/pi,abs(h);gridtitle(magnitude spectrum)xlabel(omega/pi); ylabel(magnitude)subplot(2,2,4)plot(w/pi,angle(h);gridtitle(phase spectrum)xlabel(omega/pi); ylabel(phase, radians) r=0.1; =0 r=0.5; =0 m3.7syms w;h_a=1+0.4*exp(-i*w);g_a=i*diff(h_a);grde_a=real(g_a/h_a)syms w;h_b=1/(1+0.6*exp(-i*w);g_b=i*diff(h_b);grde_b=real(g_b/h_b)grde_a =exp(i*conj(w)/(5*(2*exp(i*conj(w)/5 + 1) + 1/(5*exp(i*w)*(2/(5*exp(i*w) + 1)grde_b = - (3*exp(i*conj(w)/(10*(3*exp(i*conj(w)/5 + 1) - 3/(10*exp(i*w)*(3/(5*exp(i*w) + 1)m4.1z,p,k = buttap(4); pz, pp = zp2tf(z, p, k); omega = 0: 0.01: 5; h = freqs(pz,pp,omega); plot (omega,20*log10(abs(h);grid xlabel(normalized frequency); ylabel(gain, db);m4.7n,wn=cheb1ord(0.3157894,1,0.5,30,s);b,a=cheby1(n,0.5,wn,s);num,den=lp2bs(b,a,2*pi*sqrt(700)*106,2*pi*15e6);omega_1=0:0.01:10;h_1=freqs(b,a,omega_1);gain_1=20*log10(abs(h_1);plot(omega_1,gain_1);grid;axis(0 4 -70 5);xlabel(omega);ylabel(gain,db);title(analog lowpass filter);omega_2=0:10000:160e6*pi;h_2=freqs(b,a,omega_2);gain_2=20*log10(abs(h_2);plot(omega_2,gain_2);grid;axis(0 4 -70 5);xlabel(omega);ylabel(gain,db);title(analog bandpass filter);幅度图 m5.2g=input(第一个序列=);h=input(第二个序列=);n=input(n=);m=1:1:n;y=zeros(1,n);for k=1:n for m=1:n n=mod(1+k-m),n); if n=0 n=n; end s=s+g(m)*h(n); end y(k)=s; s=0;endy(a) 第一个序列=5 -2 2 0 4 3第二个序列=3 1 -2 2 -4 4y=-69-1620-445(b)第一个序列= 2 j -1 j*3 4-j*3 1+j*2 3+j*2;第二个序列= -3 2+j*4 -1+j*4 4+j*2 -3+j;y=columns 1 through 3 11.0000 +25.0000i -9.0000 +48.0000i 3.0000 +17.0000i columns 4 through 5 29.0000 + 0.0000i -10.0000 +12.0000i(c)第一个序列=1 cos(pi/5) cos(pi*0.4) cos(pi*0.6) cos(pi*0.8) ;第二个序列=1 3 9 27 81;y=-23.0000 -69.0000 35.0000 105.0000 73.0000m5.8x = 11 8-i*2 1-i*12 6+i*3 -3+i*2 2+i 15; k = 8:12; xf(k)=conj(x(mod(-k+2,12); xf = x xf(8:12); x = ifft(xf); n = 0:11; y = exp(i*2*pi*n/3).*x; output = x(1) x(7) sum(x) sum(y); disp(output) disp(x.*x)4.5000 -0.8333 11.0000 -3.0000-2.0000i 74.8333m5.9n=0:255; x = 0.1*n.*exp(-0.03*n); plot(n,x);axis(0 255 0 1.3); xlabel(n);ylabel(amplitude); title(original signal); pause z = zeros(1,50) ones(1,156) zeros(1,50); y = 4*rand(1,256)-1; yf = z.*fft(y); yinv = ifft(yf); s = x + yinv; plot(n,s);axis(0 255 -2 4); xlabel(n);ylabel(amplitude); title(noise corrupted signal); pause zc = ones(1,50) zeros(1,156) ones(1,50); sf = zc.*fft(s); xr = ifft(sf); plot(n,xr);axis(0 255 0 1.3); xlabel(n);ylabel(amplitude); title(signal after fourier-domain filtering); m6.1(a)num=input(分子系数=);den=input(分母系数=);z,p,k=tf2zp(num,den);m=abs(p);disp(零点在);disp(z);disp(极点在);disp(p);disp(增益常数);disp(k);disp(极点半径);disp(m);sos=zp2sos(z,p,k);disp(二阶部分);disp(real(sos);zplane(num,den)分子系数=2 -5 13.48 -7.78 9分母系数=4 7.2 20 -0.8 8零点在 1.050000000000001 + 1.974208702239964i 1.050000000000001 - 1.974208702239964i 0.200000000000000 + 0.927361849549570i 0.200000000000000 - 0.927361849549570i极点在 -1.000000000000000 + 1.999999999999999i -1.000000000000000 - 1.999999999999999i 0.100000000000000 + 0.624499799839840i 0.100000000000000 - 0.624499799839840i增益常数 0.500000000000000极点半径 2.236067977499789 2.236067977499789 0.632455532033676 0.632455532033676二阶部分 columns 1 through 4 0.500000000000000 -1.050000000000001 2.500000000000001 1.000000000000000 1.000000000000000 -0.399999999999999 0.900000000000000 1.000000000000000 columns 5 through 6 2.000000000000000 4.999999999999996 -0.200000000000000 0.400000000000001(b)分子系数=5 3.5 21.5 -4.6 18输入分母系数=5 15.5 31.7 22.52 4.8零点在 -0.600000000000000 + 1.907878402833891i -0.600000000000000 - 1.907878402833891i 0.250000000000000 + 0.915150260886156i 0.250000000000000 - 0.915150260886156i极点在 -1.050000000000001 + 1.702204453054923i -1.050000000000001 - 1.702204453054923i -0.599999999999999 -0.400000000000001 增益常数 1极点半径 2.000000000000003 2.000000000000003 0.599999999999999 0.400000000000001二阶部分 columns 1 through 4 1.000000000000000 -0.500000000000000 0.900000000000000 1.000000000000000 1.000000000000000 1.200000000000000 3.999999999999999 1.000000000000000 columns 5 through 6 1.000000000000000 0.240000000000000 2.100000000000002 4.000000000000011m6.3r = input(type in the residues = );p = input(type in the poles = );k = input(type in the constants = );num, den = residuez(r,p,k);disp(numerator polynomial coefficients); disp(num)disp(denominator polynomial coefficients); disp(den)(a)type in the residues = -4/5 -7/6type in the poles = -1/5 -1/6type in the constants = 3numerator polynomial coefficients 1.0333 0.7333 0.1000denominator polynomial coefficients 1.0000 0.3667 0.0333(b)numerator polynomial coefficients -0.9000 -2.5600 -0.1000 -0.6000denominator polynomial coefficients1.0000 0.4000 0.6000 0.2400(c)numerator polynomial coefficients 6.2500 6.5500 1.7300 0denominator polynomial coefficients1.0000 1.6400 0.8900 0.1600(d)numerator polynomial coefficients -4.5000 -6.8750 -3.6375 -0.8438denominator polynomial coefficients1.0000 1.5000 0.7875 0.1688m7.1b=3.8461 -6.3487 3.8461;z1=0 0;n=0:49;x1=cos(0.3*n);x2=cos(0.6*n);y=filter(b,1,x1+x2,z1);plot(y);plot(x1);plot(x2);m7.5syms(x,real);h=x*(1-x)*(1-0.2743*x+x*x)/(1+0.1532*x+0.8351*x*x)*(1+0.487*x+0.84*x*x);h=simple(h);w=0:2*pi/256:2*pi;y=subs(h,exp(-j*w);subplot(2,1,1)plot(w/pi,abs(y)subplot(2,1,2)plot(w/pi,unwrap(angle(y)sos1=1 -1 0 1 0.2695 0;1 -0.2743 1 1 0.4109 0.6758;g=0.203; b,a=sos2tf(sos1,g)b = 0.2030 -0.2587 0.2587 -0.2030a = 1.0000 0.6804 0.7865 0.1821m8.1num=input(系数向量=);den=1;sos,g=tf2sos(num,den);disp(gain is:);disp(g);sos(a)系数向量=-0.24 0.184 0.448 1.296 0.4448 0.184 -0.24gain is: -0.2400sos = 1.0000 -2.9024 1.0008 1.0000 0 0 1.0000 1.3369 1.6623 1.0000 0 0 1.0000 0.7989 0.6011 1.0000 0 0(b)系数向量=4 -13.6 -25.08 77.2 -25.08 -13.6 4gain is: 4sos = 1.0000 -1.3508 -9.6270 1.0000 0 0 1.0000 -2.1895 1.0000 1.0000 0 0 1.0000 0.1403 -0.1039 1.0000 0 0(c)系数向量=-0.24 0.184 0.4448 -0.4448 -0.184 0.24gain is: -0.2400sos = 1.0000 1.1631 0 1.0000 0 0 1.0000 -0.1402 -0.8598 1.0000 0 0 1.0000 -1.7895 1.0000 1.0000 0 0(d)系数向量=4 -13.6 -25.08 25.08 13.6 -4gain is: 4sos = 1.0000 -4.4555 0 1.0000 0 0 1.0000 0.6873 -1.6873 1.0000 0 0 1.0000 0.3682 -0.1330 1.0000 0 0m8.2num=input(分子系数=);den=input(分母系数=);disp(a)r1,p1,k1=residuez(num,den);disp(留数);disp(r1)disp(极点);disp(p1)disp(常数);disp(k1)disp(b)z2,p2,k2=tf2zp(num,den);sos=zp2sos(z2,p2,k2);disp(二阶部分=);disp(sos)disp(c)r3,p3,k3=residuez(num,den);r4,p4,k4=residue(num,den);disp(并联i型)disp(留数);disp(r3)disp(极点);disp(p3)disp(常数);disp(k3)disp(并联ii型)disp(留数);disp(r4)disp(极点);disp(p4)disp(常数);disp(k4)分子系数=0.3901 0.6426 0.8721 0.6426 0.3901分母系数=1 0.5038 0.8923 0.3844 0.1569(a)留数 columns 1 through 3 -0.1740 - 0.0727i -0.1740 + 0.0727i -0.8741 + 0.1120i column 4 -0.8741 - 0.1120i极点 columns 1 through 3 0.0307 - 0.8386i 0.0307 + 0.8386i -0.2826 - 0.3780i column 4 -0.2826 + 0.3780i常数 2.4863(b二阶部分= 0.3901 0.5809 0.3901 1.0000 0.5653 0.2228 1.0000 0.1582 1.0000 1.0000 -0.0615 0.7043(c)并联i型留数 -0.1740 + 0.0727i -0.1740 - 0.0727i -0.8741 - 0.1120i -0.8741 + 0.1120i极点 0.0307 + 0.8386i 0.0307 - 0.8386i -0.
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- (完整版)数学六年级下册期末专题资料试题A卷解析
- 【语文】江苏省南京市瑞金北村小学三年级下册期末复习试题(含答案)
- 小学五年级上学期阅读理解专项英语复习培优试题测试卷
- 五年级下册期中英语质量模拟试题测试卷(含答案)
- 【语文】北京市中关村第二小学四年级上册期末复习试题(含答案)
- (完整版)七年级下册实数数学综合测试卷及答案(二)培优试题
- 2025年初级银行从业资格之初级公司信贷基础试题库和答案
- 2025市政施工员考试试题库附答案
- 2025年职业健康培训考核考试练习题及答案解析
- 2025年大学人力资源管理试题及答案
- 专项项目贡献证明书与业绩认可函(8篇)
- 2025年广东省广州市中考二模英语试题(含答案)
- 消防员心理测试题库及答案解析
- 2025小升初租房合同模板
- 放射科造影剂过敏反应应急处理预案
- 《大嘴巴纸玩偶》名师课件
- 2025年上海市高考英语热点复习:阅读理解说明文
- 国家管网集团合同范本
- 中医全科学科
- Unit 1 Teenage life单词变形-学生背诵与默写清单-2024-2025学年高中英语人教版(2019)必修第一册
- 铁路技术规章:018铁路军事运输管理办法
评论
0/150
提交评论