信号处理作业111.docx
- 文档编号:7731560
- 上传时间:2023-01-26
- 格式:DOCX
- 页数:16
- 大小:153.89KB
信号处理作业111.docx
《信号处理作业111.docx》由会员分享,可在线阅读,更多相关《信号处理作业111.docx(16页珍藏版)》请在冰豆网上搜索。
信号处理作业111
《数字信号处理》
10.3加窗对正弦信号傅里叶分析的影响
程序:
clf;clc;
n=0:
1:
63;
w=rectwin(64);
[H,W]=freqz(w,1,10000,'whole');
Y2=fftshift(H);
subplot(3,2,1);
plot(W/pi-1,abs(Y2),'LineWidth',2);gridon;
xlabel('\omega');ylabel('|W(e^j^\omega)|');
title('矩形窗的傅里叶变换');
w1=1/3*pi;w2=2/3*pi;
xn=cos(w1*n)+0.75*cos(w2*n);
[H,W]=freqz(xn,1,10000,'whole');
Y2=fftshift(H);
subplot(3,2,2);
plot(W/pi-1,abs(Y2),'LineWidth',2);gridon;
xlabel('\omega');
ylabel('|V(e^j^\omega)|');
w1=2/14*pi;w2=4/15*pi;
xn=cos(w1*n)+0.75*cos(w2*n);
[H,W]=freqz(xn,1,10000,'whole');
Y2=fftshift(H);
subplot(3,2,3);
plot(W/pi-1,abs(Y2),'LineWidth',2);gridon;
xlabel('\omega');ylabel('|V(e^j^\omega)|');
w1=2/14*pi;w2=2/12*pi;
xn=cos(w1*n)+0.75*cos(w2*n);
[H,W]=freqz(xn,1,10000,'whole');
Y2=fftshift(H);
subplot(3,2,4);
plot(W/pi-1,abs(Y2),'LineWidth',2);gridon;
xlabel('\omega');
ylabel('|V(e^j^\omega)|');
text(0.3,26,'\omega0=2*pi/14');
text(0.3,15,'\omega1=2*pi/12');
w1=2/14*pi;w2=4/25*pi;
xn=cos(w1*n)+0.75*cos(w2*n);
[H,W]=freqz(xn,1,10000,'whole');
Y2=fftshift(H);
subplot(3,2,5);
plot(W/pi-1,abs(Y2),'LineWidth',2);gridon;
xlabel('\omega');
ylabel('|V(e^j^\omega)|');
text(0.3,26,'\omega0=2*pi/14');
text(0.3,15,'\omega1=2*pi/25');
运行结果:
10.4谱采样影响
程序:
clf;clc;
n=0:
1:
63;
v=cos(2*pi*n/14)+0.75*cos(4*pi*n/15);
figure
(1);
subplot(3,1,1);
stem(n,v,'.');grid;
xlabel('n');
ylabel('幅值');
axis([0,63,-2,2]);
Y=fft(v);
R=real(fft(v));
figure
(1);
subplot(3,1,2);
stem(n,R,'.');grid;
xlabel('k');ylabel('幅值');
axis([0,63,-4,8]);
title('Re{V[k]}');
Im=imag(fft(v));
figure
(1);
subplot(3,1,3);
stem(n,Im,'.');grid;
xlabel('k');ylabel('幅值');
axis([0,63,-30,30]);
title('Im{V[k]}');
H=abs(Y);
figure
(2);
subplot(3,1,1);
stem(n,H,'.');grid;
xlabel('k');ylabel('幅值');
axis([0,63,0,32]);
title('DFT幅度')
Agle=angle(fft(v));
figure
(2);
subplot(3,1,2);
stem(n,Agle,'.');grid;
xlabel('k');ylabel('弧度');
axis([0,63,-2,2]);
title('相位');
[H,W]=freqz(v,1,1000,'whole');
figure
(2);
subplot(3,1,3);
plot(W/pi,abs(H),'LineWidth',1.5);grid;
xlabel('w');ylabel('幅值');
运行结果
10.5用与DFT频率一致的频率进行谱采样
程序:
clf;clc;
n=0:
1:
63;
v=cos(2*pi*n/16)+0.75*cos(2*pi*n/8);
subplot(2,1,1);
figure
(1);
stem(n,v,'.');grid;
xlabel('n');
ylabel('幅值');
axis([0,63,-1,2]);
title('加窗的信号v[n]');
Y=fft(v);
H=abs(Y);
figure
(1);
subplot(2,1,2);
stem(n,H,'.');grid;
xlabel('k');ylabel('幅值');
axis([0,63,0,32]);
title('加窗DFT的幅值');
[H,W]=freqz(v,1,1000,'whole');
figure
(2);
subplot(2,1,1);
plot(W/pi,abs(H));grid;
xlabel('w');ylabel('幅值');
title('|V(e^j^\omega)|');
n1=0:
1:
63;
w=0:
1:
127;
v1=cos(2*pi*n1/16)+0.75*cos(2*pi*n1/8);
form=65:
1:
128
v1(m)=0;
end
Y1=fft(v1);
H1=abs(Y1);
figure
(2);
subplot(2,1,2);
stem(w,H1,'.');grid;
xlabel('k');
ylabel('幅值');
axis([0,127,0,32]);
title('|V[k]|');
程序结果:
10.6加Kaiser窗时对正弦信号的DFT分析
程序:
clf;clc;
n=0:
1:
63;
W=KAISER(64,5.48);
T=W';
v=cos(2*pi*n/14)+0.75*cos(4*pi*n/15);
fork=1:
1:
64
M(k)=T(k)*v(k);
end
figure
(1);
subplot(4,1,1);
stem(n,M,'.');grid;
xlabel('k');
ylabel('幅值');
axis([0,63,-2,2]);
title('v[n]');
Y=fft(M);
H=abs(Y);
figure
(1);
subplot(4,1,2);
stem(n,H,'.');grid;
xlabel('k');ylabel('幅值');
axis([0,63,0,15]);
title('DFT的幅值');
n=0:
1:
31;
W1=KAISER(32,5.48);
T1=W1';
fork=1:
1:
32
M1(k)=T1(k)*v(k);
end
figure
(1);
subplot(4,1,3);
stem(n,M1,'.');grid;
xlabel('k');
ylabel('幅值');
axis([0,31,-1,2]);
title('v[n]');
Y1=fft(M1);
H1=abs(Y1);
figure
(1);
subplot(4,1,4);
stem(n,H1,'.');grid;
xlabel('k');ylabel('幅值');
axis([0,31,0,8]);
title('DFT的幅值');
运行结果:
10.7用32点Ksise窗和补零时的DFT分析
程序:
clf;clc;
n=0:
1:
31;
W=KAISER(32,5.48);
T=W';
v=cos(2*pi*n/14)+0.75*cos(4*pi*n/15);
fork=1:
1:
32
M(k)=T(k)*v(k);
end
Y=fft(M);
H=abs(Y);
subplot(4,1,1);
stem(n,H,'.');grid;
xlabel('k');ylabel('幅值');
axis([0,31,0,8]);
title('|V[k]|');
n=0:
1:
63;
v=cos(2*pi*n/14)+0.75*cos(4*pi*n/15);
W1=KAISER(32,5.48);
T1=W1';
form=33:
1:
64
T1(m)=0;
end
fork=1:
1:
64
M1(k)=T1(k)*v(k);
end
Y1=fft(M1);
H1=abs(Y1);
subplot(4,1,2);
stem(n,H1,'.');grid;
xlabel('k');
ylabel('幅值');
axis([0,63,0,10]);
title('|V[k]|');
n=0:
1:
127;
v=cos(2*pi*n/14)+0.75*cos(4*pi*n/15);
W1=KAISER(32,5.48);
T2=W1';
form=33:
1:
128
T2(m)=0;
end
fork=1:
1:
128
M2(k)=T2(k)*v(k);
end
Y2=fft(M2);
H2=abs(Y2);
subplot(4,1,3);
stem(n,H2,'.');
xlabel('k');
ylabel('幅值');
axis([0,127,0,10]);
title('|V[k]|');
n=0:
1:
1023;
v=cos(2*pi*n/14)+0.75*cos(4*pi*n/15);
W1=KAISER(32,5.48);
T3=W1';
form=33:
1:
1024
T3(m)=0;
end
fork=1:
1:
1024
M3(k)=T3(k)*v(k);
end
Y3=fft(M3);
H3=abs(Y3);
subplot(4,1,4);
plot(n,H3,'.');grid;
xlabel('k');
ylabel('幅值');
axis([0,1023,0,10]);
title('|V[k]|');
运行结果:
10.8对于频率估计的过采样和线性内插
程序:
clf;clc;
n=0:
1:
1023;
v=cos(2*pi*n/14)+0.75*cos(4*pi*n/15);
W1=KAISER(32,5.48);
T1=W1';
form=33:
1:
1024
T1(m)=0;
end
fork=1:
1:
1024
M1(k)=T1(k)*v(k);
end
Y1=fft(M1);
H1=abs(Y1);
subplot(4,1,1);
plot(n,H1,'-','LineWidth',2);grid
xlabel('k');
ylabel('幅值');
axis([0,1024,0,15]);
n=0:
1:
1023;
v=cos(2*pi*n/14)+0.75*cos(4*pi*n/15);
W2=KAISER(42,5.48);
T2=W2';
form=43:
1:
1024
T2(m)=0;
end
fork=1:
1:
1024
M2(k)=T2(k)*v(k);
end
Y2=fft(M2);
H2=abs(Y2);
subplot(4,1,2);
plot(n,H2,'-','LineWidth',2);grid;
xlabel('k');
ylabel('幅值');
axis([0,1024,0,15]);
W3=KAISER(54,5.48);
T3=W3';
form=55:
1:
1024
T3(m)=0;
end
fork=1:
1:
1024
M3(k)=T3(k)*v(k);
end
Y3=fft(M3);
H3=abs(Y3);
subplot(4,1,3);
plot(n,H3,'-','LineWidth',2);grid;
xlabel('k');
ylabel('幅值');
axis([0,1024,0,15]);
W4=KAISER(64,5.48);
T4=W4';
form=65:
1:
1024
T4(m)=0;
end
fork=1:
1:
1024
M4(k)=T4(k)*v(k);
end
Y4=fft(M4);
H4=abs(Y4);
subplot(4,1,4);
plot(n,H4,'-','LineWidth',2);grid;
xlabel('k');
ylabel('幅值');
axis([0,1024,0,18]);
运行结果:
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 信号 处理 作业 111