- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
数字信号处理matlab作业
M1-1
fs=10;ts=1/fs;
n=-2:ts:2;
f=cos(6*pi*n);
subplot(3,1,1),stem(n,f,filled);
g=cos(14*pi*n);
subplot(3,1,2),stem(n,g,filled);
h=cos(26*pi*n);
subplot(3,1,3),stem(n,h,filled);
fs=10;ts=1/fs;
n=-2:ts:2;
f=cos(1*pi*n);
subplot(3,1,1),stem(n,f,filled);
g=cos(14*pi*n);
subplot(3,1,2),stem(n,g,filled);
h=cos(2600000*pi*n);
subplot(3,1,3),stem(n,h,filled);
M2-1
(1) x=[1 -3 4 2 0 -2 ];h=[3 0 1 -1 2 1];
L=length(x)+length(h)-1;
XE=fft(x,L);
HE=fft(h,L);
y1=ifft(XE.*HE);
y=[1 0 -1 0 1 0];g=[1 3 9 27 81 243]
M=length(y)+length(g)-1;
YE=fft(y,M);
GE=fft(g,M);
y2=ifft(YE.*GE);
a=0:L-1;
subplot(2,1,1);
stem(a,real(y1));
b=0:M-1;
subplot(2,1,2);
stem(b,real(y2));
M2-2
N=10;
k=0:N-1;
f=cos(pi*k/20);
F=fft(f);
plot(k/10,abs(F),o);
hold on
set(gca,xtick,[0,0.25,0.5,0.75,1]);
set(gca,ytick,[0,2,4,6,8]);
grid on
hold off
M2-3
N=input(lenth of signal:N=);
M=input(points of DFT:M=);
k = 0:N-1;
f = cos(2*pi*100*k/600)+cos(2*pi*150*k/600); %0.15*
w=hamming(length(f));
f=f*w; %加hamming窗
F= fft(f, M);
L = 0:(M-1);
plot(L/M,abs(F))
grid on;
xlabel(Normalized frequency);
ylabel(Magnitude);
M2-4
M=4;N=64;
n=-(N-1)/2:(N-1)/2;
x=cos(2*pi*n/15)+0.75*cos(2.3*pi*n/15);
X=fft(x,N);
subplot(2,1,1);stem(n,fftshift(x));
ylabel(x[n]);xlabel(Time n);
subplot(2,1,2);
stem(omega,real(fftshift(X)));
ylabel(X[k]);
xlabel(Frequency(rad));
hold;
M2-5
w=linspace(0,10,1024);
plot(w,2./(w.^2+1));
% sampling points and frequency(rad/s)
N=input(抽样点数=);
Ws=input(抽样角频率=);
Ts=2*pi/Ws;
%compute the sampling points
k=0:N/2;
t=k*Ts;
f1=exp(-3*t);
f1(N/2+1)=2*f1(N/2+1);
f2=f1(2:N/2);
f=[f1 fliplr(f2)];
F=Ts*real(fft(f));
w=k*Ws/N;
w1=linspace(0,Ws/2,512);
plot(w1,2./(w1.^2+1),w,F(1:N/2+1),r);
axis([0 10 0 2.2]);
xlabel(频率(秒/弧度));
ylabel(幅度);
z=[N= num2str(N) Ws= num2str(Ws) 的结果];
legend(理论值,z);
title(exp(-|t|)的谱);
M4-1
wp=10;ws=2;Ap=1;As=40;
[N,Wc]=cheb1ord(wp,ws,Ap,As,s);
[num,den]=cheby1(N,Ap,Wc,s);
disp(LP 分子多项式);
fprintf(%.4e\n,num);
disp(LP 分母多项式);
fprintf(%.4e\n,den);
[numt,dent]=lp2hp(num,den,1);
disp(HP 分子多项
文档评论(0)