数字信号处理MTLAB版实验5.docx
- 文档编号:30467358
- 上传时间:2023-08-15
- 格式:DOCX
- 页数:19
- 大小:124.60KB
数字信号处理MTLAB版实验5.docx
《数字信号处理MTLAB版实验5.docx》由会员分享,可在线阅读,更多相关《数字信号处理MTLAB版实验5.docx(19页珍藏版)》请在冰豆网上搜索。
数字信号处理MTLAB版实验5
5.1
t=0:
0.0005:
1;
f=13;
xa=cos(2*pi*f*t);
subplot(2,1,1)
plot(t,xa);grid
xlabel('Time,msec');ylabel('Amplitude');
title('Continuous-timesignalx_{a}(t)');
axis([01-1.21.2])
subplot(2,1,2);
T=0.1;
n=0:
T:
1;
xs=cos(2*pi*f*n);
k=0:
length(n)-1;
stem(k,xs);grid;
xlabel('Timeindexn');ylabel('Amplitude');
title('Discrete-timesignalx[n]');
axis([0(length(n)-1)-1.21.2])
5.2
10Hz,T=0.1s
5.3
axis将横纵坐标确定能将图象全部呈现
5.4
T=0.01;f=100Hz
T=1/26;f=26Hz
T=0.2;f=5Hz
T=0.5;f=2Hz
5.5
f=3Hz;
f=7Hz
没有区别;因为xa=cos(2*pi*f*t)抽样是t=nT,T=0.1即
xa=cos(0.2*pi*f*n);f=3,7,13Hz;即xa=cos(0.6*pi*n)
xa=cos(1.4*pi*n);xa=cos(2.6*pi*n);当n=1..10时,其
相位之和为2*pi;所以值相等;
5.6
%ProgramP5_2
%IllustrationofAliasingEffectintheTime-Domain
clf;
T=0.1;f=13;
n=(0:
T:
1)';
xs=cos(2*pi*f*n);
t=linspace(-0.5,1.5,500)';
ya=sinc((1/T)*t(:
ones(size(n)))-(1/T)*n(:
ones(size(t)))')*xs;
plot(n,xs,'o',t,ya);grid;
xlabel('Time,msec');ylabel('Amplitude');
title('Reconstructedcontinuous-timesignaly_{a}(t)');
axis([01-1.21.2]);
5.7
t=[-0.5,1.5];t的增量0.004;在图中t=[0,1]
由于低通滤波
5.8
f=3Hz,7Hz
5.8
同5.5clf;
t=0:
0.0005:
1;
f=13;
xa=cos(2*pi*f*t);
subplot(3,1,1)
plot(t,xa);grid
xlabel('Time,msec');ylabel('Amplitude');
title('Continuous-timesignalx_{a}(t)');
axis([01-1.21.2])
subplot(3,1,2);
T=0.01;
n=0:
T:
1;
xs=cos(2*pi*f*n);
k=0:
length(n)-1;
stem(k,xs);grid;
xlabel('Timeindexn');ylabel('Amplitude');
title('Discrete-timesignalx[n]');
axis([0(length(n)-1)-1.21.2])
n=(0:
T:
1)';
xs=cos(2*pi*f*n);
t=linspace(-0.5,1.5,500)';
ya=sinc((1/T)*t(:
ones(size(n)))-(1/T)*n(:
ones(size(t)))')*xs;
subplot(3,1,3);
plot(n,xs,'o',t,ya);grid;
xlabel('Time,msec');ylabel('Amplitude');
title('Reconstructedcontinuous-timesignaly_{a}(t)');
axis([01-1.21.2]);
5.9
5.9
clf;
t=0:
0.005:
10;
xa=2*t.*exp(-t);
subplot(2,2,1)
plot(t,xa);grid
xlabel('Time,msec');ylabel('Amplitude');
title('Continuous-timesignalx_{a}(t)');
subplot(2,2,2)
wa=0:
10/511:
10;
ha=freqs(2,[121],wa);
plot(wa/(2*pi),abs(ha));grid;
xlabel('Frequency,kHz');ylabel('Amplitude');
title('|X_{a}(j\Omega)|');
axis([05/pi02]);
subplot(2,2,3)
T=1;
n=0:
T:
10;
xs=2*n.*exp(-n);
k=0:
length(n)-1;
stem(k,xs);grid;
xlabel('Timeindexn');ylabel('Amplitude');
title('Discrete-timesignalx[n]');
subplot(2,2,4)
wd=0:
pi/255:
pi;
hd=freqz(xs,1,wd);
plot(wd/(T*pi),T*abs(hd));grid;
xlabel('Frequency,kHz');ylabel('Amplitude');
title('|X(e^{j\omega})|');
axis([01/T02])
xa=2*t.*exp(-t);
symst;f=2*t*exp(-t);F=fourier(f)
5.10
%ProgramP5_3
%IllustrationoftheAliasingEffect
%intheFrequency-Domain
clf;
t=0:
0.005:
10;
xa=2*t.*exp(-t);
subplot(2,2,1)
plot(t,xa);grid
xlabel('Time,msec');ylabel('Amplitude');
title('Continuous-timesignalx_{a}(t)');
subplot(2,2,2)
wa=-10:
10/511:
10;
ha=freqs(2,[121],wa);
plot(wa/(2*pi),abs(ha));grid;
xlabel('Frequency,kHz');ylabel('Amplitude');
title('|X_{a}(j\Omega)|');
axis([-3302]);
subplot(2,2,3)
T=1;
n=0:
T:
10;
xs=2*n.*exp(-n);
k=0:
length(n)-1;
stem(k,xs);grid;
xlabel('Timeindexn');ylabel('Amplitude');
title('Discrete-timesignalx[n]');
subplot(2,2,4)
wd=-10:
pi/255:
10;
hd=freqz(xs,1,wd);
plot(wd/(T*pi),T*abs(hd));grid;
xlabel('Frequency,kHz');ylabel('Amplitude');
title('|X(e^{j\omega})|');
axis([-3302])
t=0:
0.005:
10;
xa=2*t.*exp(-t);
subplot(3,1,1)
plot(t,xa);grid
xlabel('Time,msec');ylabel('Amplitude');
title('Continuous-timesignalx_{a}(t)');
axis([010-11])
subplot(3,1,2);
T=1;
n=0:
T:
10;
xs=2*n.*exp(-n);
k=0:
length(n)-1;
stem(k,xs);grid;
xlabel('Timeindexn');ylabel('Amplitude');
title('Discrete-timesignalx[n]');
axis([0(length(n)-1)-1.21.2])
n=(0:
T:
1)';
xs=2*n.*exp(-n);
t=linspace(-0.5,10,500)';
ya=sinc((1/T)*t(:
ones(size(n)))-(1/T)*n(:
ones(size(t)))')*xs;
subplot(3,1,3);
plot(n,xs,'o',t,ya);grid;
xlabel('Time,msec');ylabel('Amplitude');
title('Reconstructedcontinuous-timesignaly_{a}(t)');
axis([010-11]);
5.12
%ProgramP5_3
%IllustrationoftheAliasingEffect
%intheFrequency-Domain
clf;
t=-1:
0.005:
10;
xa=exp(-pi.*t.*t);
subplot(2,2,1)
plot(t,xa);grid
xlabel('Time,msec');ylabel('Amplitude');
title('Continuous-timesignalx_{a}(t)');
subplot(2,2,2)
wa=-10:
10/511:
10;
ha=freqs(2,[121],wa);
plot(wa/(2*pi),abs(ha));grid;
xlabel('Frequency,kHz');ylabel('Amplitude');
title('|X_{a}(j\Omega)|');
axis([-44-12]);
subplot(2,2,3)
T=1;
n=0:
T:
10;
xs=exp(-pi.*n.*n);
k=0:
length(n)-1;
stem(k,xs);grid;
xlabel('Timeindexn');ylabel('Amplitude');
title('Discrete-timesignalx[n]');
subplot(2,2,4)
wd=-10:
pi/255:
10;
hd=freqz(xs,1,wd);
plot(wd/(T*pi),T*abs(hd));grid;
xlabel('Frequency,kHz');ylabel('Amplitude');
title('|X(e^{j\omega})|');
axis([-4402])
5.13
%ProgramP5_4
%DesignofAnalogLowpassFilter
clf;
Fp=3500;Fs=4500;
Wp=2*pi*Fp;Ws=2*pi*Fs;
[N,Wn]=buttord(Wp,Ws,0.5,30,'s');
[b,a]=butter(N,Wn,'s');
wa=0:
(3*Ws)/511:
3*Ws;
h=freqs(b,a,wa);
plot(wa/(2*pi),20*log10(abs(h)));grid
xlabel('Frequency,Hz');ylabel('Gain,dB');
title('Gainresponse');
axis([03*Fs-605]);
Rp=0.5;Rs=30;3500Hz;4500Hz;
5.14
符合;3500Hz
5.15
%ProgramP5_4
%DesignofAnalogLowpassFilter
clf;
Fp=3500;Fs=4500;
Wp=2*pi*Fp;Ws=2*pi*Fs;
[N,Wn]=cheb1ord(Wp,Ws,0.5,30,'s');
[b,a]=cheby1(N,0.5,Wn,'s');
wa=0:
(3*Ws)/511:
3*Ws;
h=freqs(b,a,wa);
plot(wa/(2*pi),20*log10(abs(h)));grid
xlabel('Frequency,Hz');ylabel('Gain,dB');
title('Gainresponse');
axis([03*Fs-605]);
3500Hz
5.16
clf;
Fp=3500;Fs=4500;
Wp=2*pi*Fp;Ws=2*pi*Fs;
[N,Wn]=cheb2ord(Wp,Ws,0.5,30,'s');
[b,a]=cheby1(N,30,Wn,'s');
wa=0:
(3*Ws)/511:
3*Ws;
h=freqs(b,a,wa);
plot(wa/(2*pi),20*log10(abs(h)));grid
xlabel('Frequency,Hz');ylabel('Gain,dB');
title('Gainresponse');
axis([03*Fs-605]);
5.17
clf;
Fp=3500;Fs=4500;
Wp=2*pi*Fp;Ws=2*pi*Fs;
[N,Wn]=ellipord(Wp,Ws,0.5,30,'s');
[b,a]=ellip(N,0.5,30,Wn,'s');
wa=0:
(3*Ws)/511:
3*Ws;
h=freqs(b,a,wa);
plot(wa/(2*pi),20*log10(abs(h)));grid
xlabel('Frequency,Hz');ylabel('Gain,dB');
title('Gainresponse');
axis([03*Fs-605]);
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数字信号 处理 MTLAB 实验
![提示](https://static.bdocx.com/images/bang_tan.gif)