본문내용
unnega23=zeros(1,length(nnega23));
nposi12=[2:1:200];
unposi12=ones(1, length(nposi23));
nnega12=[-10:1:1];
unnega12=zeros(1,length(nnega12));
un=[unnega unposi];
un1=[unnega1 unposi1];
un12=[unnega12 unposi12];
un21=[unnega21 unposi21];
un23=[unnega23 unposi23];
hn1=un.*0.5-un12.*0.5;
hn21=un*0.5-un21*0.5;
hn22=-(un1*0.5-un23*0.5);
hn23=hn21+hn22;
figure; orient tall;
subplot(411); stem(n,hn1); title (\'h1[n]\'); grid on; %hn1
axis([-10 200 -2 2]);
subplot(412); stem(n,hn23); title (\'h23[n]\'); grid on;
axis([-10 200 -2 2]);
y1 = conv(xn,hn1);
y2 = conv(xn,hn23);
ylen1=length(xn)+length(hn1)-1;
ny1=[-10:1:ylen1-11];
ylen2=length(xn)+length(hn23)-1;
ny2=[-10:1:ylen2-11];
subplot(413); stem(ny1,y1); title (\'y1[n]=x[n]*h1[n]\'); grid on;
axis([-10 200 -2 2]);
subplot(414); stem(ny2,y2); title (\'y2[n]=x[n]*h23[n]\'); grid on;
axis([-10 200 -2 2]);
%Question C
%
h1[n]의 경우 입력 값이 0에서는 0.5를 가리키고 그 외 200까지 다른 점들은 xn의 original 값과 거의 같았다. h2[n]의 경우도 입력 값이 0에서는 0.5를 가리키었으나 그 외의 다른 점에서는 임펄스 응답의 상쇄로 인해 출력파형이 orginal 파형과는 다르게 작게 나왔다.
고찰3))
코딩을 하면서 h1[n]과 h2[n]을 만들기가 어려웠는데 교수님께서 힌트로 알려주신 hln=[0.5 0.5], h2n=[0.5 -0.5]는 사용하지 못하였고, Unit step 함수를 이용하여 h1n과 h2n을 만들었습니다. 변수를 많이 이용하여 코딩 시 약간의 어려움을 겪었습니다.
nposi12=[2:1:200];
unposi12=ones(1, length(nposi23));
nnega12=[-10:1:1];
unnega12=zeros(1,length(nnega12));
un=[unnega unposi];
un1=[unnega1 unposi1];
un12=[unnega12 unposi12];
un21=[unnega21 unposi21];
un23=[unnega23 unposi23];
hn1=un.*0.5-un12.*0.5;
hn21=un*0.5-un21*0.5;
hn22=-(un1*0.5-un23*0.5);
hn23=hn21+hn22;
figure; orient tall;
subplot(411); stem(n,hn1); title (\'h1[n]\'); grid on; %hn1
axis([-10 200 -2 2]);
subplot(412); stem(n,hn23); title (\'h23[n]\'); grid on;
axis([-10 200 -2 2]);
y1 = conv(xn,hn1);
y2 = conv(xn,hn23);
ylen1=length(xn)+length(hn1)-1;
ny1=[-10:1:ylen1-11];
ylen2=length(xn)+length(hn23)-1;
ny2=[-10:1:ylen2-11];
subplot(413); stem(ny1,y1); title (\'y1[n]=x[n]*h1[n]\'); grid on;
axis([-10 200 -2 2]);
subplot(414); stem(ny2,y2); title (\'y2[n]=x[n]*h23[n]\'); grid on;
axis([-10 200 -2 2]);
%Question C
%
h1[n]의 경우 입력 값이 0에서는 0.5를 가리키고 그 외 200까지 다른 점들은 xn의 original 값과 거의 같았다. h2[n]의 경우도 입력 값이 0에서는 0.5를 가리키었으나 그 외의 다른 점에서는 임펄스 응답의 상쇄로 인해 출력파형이 orginal 파형과는 다르게 작게 나왔다.
고찰3))
코딩을 하면서 h1[n]과 h2[n]을 만들기가 어려웠는데 교수님께서 힌트로 알려주신 hln=[0.5 0.5], h2n=[0.5 -0.5]는 사용하지 못하였고, Unit step 함수를 이용하여 h1n과 h2n을 만들었습니다. 변수를 많이 이용하여 코딩 시 약간의 어려움을 겪었습니다.
소개글