信号处理实验三报告

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1/10实验三抽样3.3.1抽样引起的混叠【实验内容】f0=500HZ,fs分别取100HZ,1kHZ,10kHZ,绘出x[n]及其DTFT。【程序】%---文件exp331.m---%问题3.3.1实验内容closeall;clearall;f0=500;B=0.25*pi;%初相n=0:20;fs1=100;%采样频率100HZt1=n/fs1;x1=sin(2*pi*f0*t1+B);[X1,W1]=dtft(x1,1000);%对采样信号做DTFTfs2=1000;%采样频率1kHZt2=n/fs2;x2=sin(2*pi*f0*t2+B);[X2,W2]=dtft(x2,1000);%对采样信号做DTFTfs3=10000;%采样频率10kHZt3=n/fs3;x3=sin(2*pi*f0*t3+B);[X3,W3]=dtft(x3,1000);%对采样信号做DTFThf=figure;%绘制x1时域采样结果subplot(2,3,1);stem(n,x1);title('fs=100HZ时域采样结果');xlabel('n');ylabel('x1[n]');subplot(2,3,4);%绘制x1频域解图plot(W1,X1);gridon;title('fs=100HZ采样信号的DTFT');xlabel('W1');ylabel('X1');%绘制x2时域采样结果subplot(2,3,2);stem(n,x2);title('fs=1kHZ时域采样结果');xlabel('n');ylabel('x2[n]');subplot(2,3,5);%绘制x2频域解图plot(W2,X2);gridon;title('fs=1kHZ采样信号的DTFT');xlabel('W2');ylabel('X2');%绘制x3时域采样结果subplot(2,3,3);stem(n,x3);title('fs=10kHZ时域采样结果');xlabel('n');ylabel('x3[n]');%绘制x3频域解图subplot(2,3,6);plot(W3,X3);gridon;title('fs=10kHZ采样信号的DTFT');xlabel('W3');ylabel('X3');saveas(hf,'exp331.fig');【结果及分析】如图1.1所示,前三幅图分别为欠采样、临界采样和完全采样的结果,后三幅图为他们分别对应的DTFT。2/10图1.1正弦信号的不同频率采样及DTFT3.3.2抽样的频域视图【实验内容】a.已知1000|t|()aXte求出并绘制其傅里叶变换xa(jΩ)b.以5000HZ和1000Hz分别对其进行采样得到x1(n),x2(n);画出他们的DTFT并与xa(jΩ)。【程序】%---文件exp332.m---%问题a%傅里叶变换结果X(W)=2000/(1000000+W^2)clearall;Dt=0.00005;%模拟信号t=-0.005:Dt:0.005;xa=exp(-1000*abs(t));Wmax=2*pi*2000;K=500;k=0:1:K;W=k*Wmax/K;Xa=xa*exp(-j*t'*W)*Dt;Xa=real(Xa);%连续时间傅里叶变换W=[-fliplr(W),W(2:501)];%频率介于-Wmax和Wamx之间Xa=[fliplr(Xa),Xa(2:501)];%Xa介于-Wmax和Wamx之间hf=figure;subplot(2,2,1);plot(t*1000,xa);xlabel('t(ms)');ylabel('xa(t)');gridon;title('模拟信号');subplot(2,2,2);plot(W/(2*pi*1000),Xa*1000);xlabel('f(kHZ)');ylabel('Xa(jw)');gridon;title('连续时间傅里叶变换');0102000.20.40.60.8fs=100HZ时域采样结果nx1[n]-505-5051015fs=100HZ采样信号的DTFTW1X101020-1-0.500.51fs=1kHZ时域采样结果nx2[n]-505-5051015fs=1kHZ采样信号的DTFTW2X201020-1-0.500.51fs=10kHZ时域采样结果nx3[n]-505-50510fs=10kHZ采样信号的DTFTW3X33/10Ts1=0.0002;n=-25:25;x1=exp(-1000*abs(n*Ts1));%离散信号K=500;k=0:K;w=pi*k/K;X1=x1*exp(-j*n'*w);X1=real(X1);%离散时间傅里叶变换w=[-fliplr(w),w(2:K+1)];X1=[fliplr(X1),X1(2:K+1)];subplot(2,2,3);plot(w/pi,X1);xlabel('w(rad/s)');ylabel('X1(w)');gridon;title('Ts=5000HZ');Ts2=0.001;n=-25:25;x2=exp(-1000*abs(n*Ts2));%离散信号K=500;k=0:K;w=pi*k/K;X2=x2*exp(-j*n'*w);X2=real(X2);%离散时间傅里叶变换w=[-fliplr(w),w(2:K+1)];X2=[fliplr(X2),X2(2:K+1)];subplot(2,2,4);plot(w/pi,X2);xlabel('w(rad/s)');ylabel('X2(w)');gridon;title('Ts=1000HZ');saveas(hf,'exp332.fig');【实验结果及分析】如图1.2所示,第一幅图为模拟信号原型,第二幅图为他的连续时间傅里叶变换,第三四幅分别为采样周期5000HZ和1000Hz的DTFT。5000HZ采样满足奈奎斯特定理,1000Hz不满足奈奎斯特定理。图1.2实验3.3.2结果3.3.3从样本重建信号1、拟合正弦波【实验内容】假设三个样本符合正弦波,能不能确定其各个参数,w需要什么条件。不能的话,给出理由。选取几个样本绘制图像。【程序】%---文件exp333_1.m---%问题1-50500.51t(ms)xa(t)模拟信号-2-101200.511.52f(kHZ)Xa(jw)连续时间傅里叶变换-1-0.500.510510w(rad/s)X1(w)Ts=5000HZ-1-0.500.510123w(rad/s)X2(w)Ts=1000HZ4/10%拟合正弦波%不能确定。t=0:0.01:2*pi;x=2*cos(pi*t/3);closeall;hf=figure;plot(t,x);gridon;title('解出频率w=pi/3的信号');set(gca,'xtick',0:0.01:2*pi);xlabel('t(s)');ylabel('x(t)');saveas(hf,'exp333.1.fig');【结果及分析】不能根据三点得到正弦信号各个量,由于Ts=1,由采样定理,当wpi时才能基本确定重建信号。程序产生正弦信号x(t)=2cos(pi*t/3)。并绘制其图形进行展示。图1.3计算正弦信号绘制2、线性与多项式插值【实验内容】a.使用matlab用直线连接样本,解释plot如何绘制图像。b.将三角形冲击与样本卷积。证明假设t=-1和t=3的样本是0,上面结果与线性插值相同c.使用matlab对上面样本拟合为二阶多项式。绘制结果。此信号是否能很好的在0~2区间以外拓展。【程序】%---exp333_2.m---%问题2%%%a问x=[21-1];n=0:2;closeall;hf=figure(1);00.010.020.030.040.050.060.070.080.090.10.110.120.130.140.150.160.170.180.190.20.210.220.230.240.250.260.270.280.290.30.310.320.330.340.350.360.370.380.390.40.410.420.430.440.450.460.470.480.490.50.510.520.530.540.550.560.570.580.590.60.610.620.630.640.650.660.670.680.690.70.710.720.730.740.750.760.770.780.790.80.810.820.830.840.850.860.870.880.890.90.910.920.930.940.950.960.970.980.9911.011.021.031.041.051.061.071.081.091.11.111.121.131.141.151.161.171.181.191.21.211.221.231.241.251.261.271.281.291.31.311.321.331.341.351.361.371.381.391.41.411.421.431.441.451.461.471.481.491.51.511.521.531.541.551.561.571.581.591.61.611.621.631.641.651.661.671.681.691.71.711.721.731.741.751.761.771.781.791.81.811.821.831.841.851.861.871.881.891.91.911.921.931.941.951.961.971.981.9922.012.022.032.042.052.062.072.082.092.12.112.122.132.142.152.162.172.182.192.22.212.222.232.242.252.262.272.282.292.32.312.322.332.342.352.362.372.382.392.42.412.422.432.442.452.462.472.482.492.52.512.522.532.542.552.562.572.582.592.62.612.622.632.642.652.662.672.682.692.72.712.722.732.742.752.762.772.782.792.82.812.822.832.842.852.862.872.882.892.92.912.922.932.942.952.962.972.982.9933.013.023.033.043.053.063.073.083.093.13.113.123.133.143.153.163.173.183.193.23.213.223.233.243.253.263.273.283.293.33.313.323.333.343.353.363.373.383.393.43.413.423.433.443.453.463.473.483.493.53.513.523.533.543.553.563.573.583.593.63.613.623.633.643.653.663.673.683.693.73.713.723.733.743.753.763.773.783.793.83.813.823.833.843.853.863.873.883.893.93.913.923.933.943.953.963.973.983.9944.014.024.034.044.054.064.074.084.094.14.114.124.134.144.154.164.174.184.194.24.214.224.234.244.254.264.274.284.294.34.314.324.334.344.354.364.374.384.394.44.414.424.434.444.454.464.474.484.494.54.

1 / 10
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功