信号的产生及时间变量的变换.docx

上传人:b****5 文档编号:6013498 上传时间:2023-01-03 格式:DOCX 页数:17 大小:192.83KB
下载 相关 举报
信号的产生及时间变量的变换.docx_第1页
第1页 / 共17页
信号的产生及时间变量的变换.docx_第2页
第2页 / 共17页
信号的产生及时间变量的变换.docx_第3页
第3页 / 共17页
信号的产生及时间变量的变换.docx_第4页
第4页 / 共17页
信号的产生及时间变量的变换.docx_第5页
第5页 / 共17页
点击查看更多>>
下载资源
资源描述

信号的产生及时间变量的变换.docx

《信号的产生及时间变量的变换.docx》由会员分享,可在线阅读,更多相关《信号的产生及时间变量的变换.docx(17页珍藏版)》请在冰豆网上搜索。

信号的产生及时间变量的变换.docx

信号的产生及时间变量的变换

1产生并画出下列信号:

A.单位冲激信号

与单位脉冲序列

;

B.单位阶跃信号u(t)与单位阶跃序列u[n].

(1)

%Impulsesquence

subplot(1,2,1);

n=[-10:

10];

z=(n==0);

stem(n,z);

title('Impulsesequence');

xlabel('n');

ylabel('\delta[n]');

%Impulsefunction

subplot(1,2,2);

t=-10:

0.1:

10;

y=(t==0);

plot(t,y,'r');

title('Impulsefunction');

xlabel('t');

ylabel('\delta[t]');

(2)

%Stepsquence

subplot(1,2,1);

n=[-10:

10];

z=(n>=0);

stem(n,z);

title('stepsequence');

xlabel('n');

ylabel('\u[n]');

%Stepfunction

subplot(1,2,2);

t=-10:

0.1:

10;

y=(t>=0);

plot(t,y,'b');

title('stepfunction');

xlabel('t');

ylabel('\u[t]');

思考题:

(1).在matlab中不能产生理想的单位冲激信号.

(2).不相等,

在零时刻的值为无穷,

在零时刻的值为1.

2.产生并画出下列信号:

A在[-2П,2П]的范围内,画出正弦信号sin(t);

B利用sawtooth函数,在[-5П,5П]的范围内,画出周期三角波和锯齿波;

C利用square函数,在[-5П,5П]的范围内,画出周期方波。

(1)

%sincewave

t=-2*pi:

pi/20:

2*pi;

plot(t,sin(t));

title('sincewave');

xlabel('t');

ylabel('sin(t)');

(2)subplot(1,2,1);

t=-5*pi:

pi/100:

5*pi;x=sawtooth(t,0.5);plot(t,x);

title('Triangularwave');xlabel('t');ylabel('x');

subplot(1,2,2);z=sawtooth(t);plot(t,z);title('Sawtoothwave');xlabel('t);ylabel('z');

(3)

%Squarewave

t=-5*pi:

pi/100:

5*pi;

x=square(t);

plot(t,x);

axis([-5*pi,5*pi,-1.5,1.5]);

title('Squarewave');

xlabel('t');

ylabel('x');

思考题:

(1).锯齿波有下降沿,三角波没有.

(2).两函数都产生周期为2

,可以通过改变角频率w的大小实现。

3.在[-4П,4П]的范围内,产生sinc函数曲线和diric函数曲线(N=5)

Sinc函数的定义sinc(t)=[sin(πt)]/πt;

diric的函数定义为diric=(sin(Nt/2))/(Nsin(t/2))

figure

(1);clf;

t=-4*pi:

pi/20:

4*pi;

%Sincfunction

subplot(2,1,1);

plot(t,sinc(t));

title('Sincfunction');

grid;

xlabel('t');

ylabel('sinc(t)');

%Diricfunction

subplot(2,1,2);

plot(t,diric(t,5));

title('Diricfunction');

grid;

xlabel('t');

ylabel('diric(t)');

思考题:

(1)sinc函数是奇函数;当sinc(t)函数的导数等于0即

时,取得极值点;当sin

=0即t=k(整数)时为零点。

diric函数是奇函数;当diric函数得导数等于0即

=0时,取得极值点;当sin(Nt/2)=0即当t=2k

/2时为零点。

4.在n=[-10:

10]范围内产生离散信号:

x[n]=

n=[-10:

10];

x=2*n.*(n<=3&n>=-3);

stem(n,x);

title('Adiscretesignal');

xlabel('n');

ylabel('x[n]');

5.在n=[-10:

10]范围内画出以下信号:

n=[-10:

10];

x1=delta(n);

x2=delta(n+2);

x3=delta(n-4);

x4=2*delta(n+2)-delta(n-4);

subplot(2,2,1);stem(n,x1);

title('x_1[n]=\delta[n]');axis([-10,10,-1,2]);gridon;

subplot(2,2,2);stem(n,x2);

title('x_2[n]=\delta[n+2]');axis([-10,10,-1,2]);gridon;

subplot(2,2,3);stem(n,x3);

title('x_3[n]=\delta[n-4]');axis([-10,10,-1,2]);gridon;

subplot(2,2,4);stem(n,x4);

title('x_4[n]=2*\delta[n+2]-\delta[n-4]');axis([-10,10,-1,2]);gridon;

6产生复信号:

并画出它们的实部和虚部及模值和相角;

(1)

n=[0:

32];

x=exp(j*(pi/8)*n);

subplot(2,2,1);stem(n,real(x));title('Realpart');xlabel('n');

subplot(2,2,2);stem(n,imag(x));title('Imaginarypart');xlabel('n');

subplot(2,2,3);stem(n,abs(x));title('Magnitude');xlabel('n');

subplot(2,2,4);stem(n,(180/pi)*angle(x));

title('Phase(\circ)part');xlabel('n');

%angle(x)inradunit;(180/pi)*angle(x)indegreeunit

(2)n=[-10:

10];

x=exp((-0.1+j*0.3)*n);

subplot(2,2,1);stem(n,real(x));title('Realpart');xlabel('n');

subplot(2,2,2);stem(n,imag(x));title('Imaginarypart');xlabel('n');

subplot(2,2,3);stem(n,abs(x));title('Magnitude');xlabel('n');

subplot(2,2,4);stem(n,(180/pi)*angle(x));

title('Phase(\circ)part');xlabel('n');

思考题:

①模等于实部的平方加上虚部的平方再进行开方

②-180到180③Re[x[n]]=模*cos(r(n)),Im[x[n]]=模*sin(

(n))

7.已知x[n]=u[n]-u[n-10],要求将它进行奇偶分量进行分解,分解为奇分量

主程序如下:

n=[0:

10];

x=stepseq(0,0,10)-stepseq(10,0,10);

[xe,xo,m]=evenodd(x,n);

subplot(2,2,1);stem(n,x);title('Stepsequence');

xlabel('n');ylabel('x[n]');axis([-1010-1.21.2]);

subplot(2,2,3);stem(m,xe);title('Evenpart');

xlabel('n');ylabel('xe[n]');axis([-1010-1.21.2]);

subplot(2,2,4);stem(m,xo);title('Oddpart');

xlabel('n');ylabel('xo[n]');axis([-1010-1.21.2]);

Stepseq.m的源程序如下:

function[x,n]=stepseq(n0,n1,n2);

ifnargin~=3

disp('Usage:

Y=stepseq(n0,n1,n2)');

elseif((n0n2)|(n1>n2))

error('argumentsmustsatisfyn1<=n0<=2')

end

n=[n1:

n2];

x=[(n-n0)>=0];

evenodd.m的源程序如下:

function[xe,xo,m]=evenodd(x,n)

ifany(imag(x)~=0)

error('xisnotarealsequence');

return;

end

m=-fliplr(n);

m1=min([m,n]);m2=max([m,n]);m=m1:

m2;

nm=n

(1)-m

(1);n1=1:

length(n);

x1=zeros(1,length(m));

x1(n1+nm)=x;x=x1;

xe=0.5*(x+fliplr(x));

xo=0.5*(x-fliplr(x));

8.已知序列

 

a.画出x[n];

x=zeros(1,21);y1=zeros(1,21);y2=zeros(1,21);y3=zeros(1,21);

forn=-10:

10

switchn

case0

x(n+11)=2;

case2

x(n+11)=1;

case3

x(n+11)=-1;

case4

x(n+11)=3;

otherwise

x(n+11)=0;

end

end

forn=1:

21;

ifn-2>0

y1(n)=x(n-2);

end

ifn+1<=21

y2(n)=x(n+1);

end

end

forn=-10:

10;

y3(n+11)=x(-n+11);

end

n=-10:

10;

subplot(2,2,1);stem(n,x);title('x[n]');xlabel('n');ylabel('x');gridon;

subplot(2,2,2);stem(n,y1);title('y_1[n]');xlabel('n');ylabel('y_1');gridon;

subplot(2,2,3);stem(n,y2);title('y_2[n]');xlabel('n');ylabel('y_2');gridon;

subplot(2,2,4);stem(n,y3);title('y_3[n]');xlabel('n');ylabel('y_3');gridon;

思考题:

①信号x[

]与x[n]是何关系?

②信号x[-n]与x[n]是何关系?

①x[

]为x[n]向右移动了

个单位(

为正整数)

②x[-n]为x[n]沿纵轴翻转得来的

9.在n=[0:

31]范围内画出下列信号:

n=[0:

31];

x1=sin(n*pi/4).*cos(n*pi/4);x2=sin(n);

figure

(1);stem(n,x1);title('x_1[n]');xlabel('n');ylabel('x_1');axis([031-11]);gridon;

figure

(2);stem(n,x2);title('x_2[n]');xlabel('n');ylabel('x_2');axis([031-11]);gridon;

思考题:

①当角频率

为何值时,信号x[n]=sin(

n)是周期信号?

解:

=(2kп)/N(N为整数)

②信号

[n]与

[n]是否是周期信号?

如果周期信号,其基波周期是多少?

信号

[n]与

[n]是周期信号,其基波周期是8.

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 求职职场 > 简历

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1