how to implement a non-causal system?

조회 수: 12 (최근 30일)
Sample Hold
Sample Hold 2011년 6월 18일
답변: Bilawal 2023년 1월 31일
How do you implement a system like:
y(k+2)+2y(k+1)+1/2*y(k)=x(k+1)+x(k)
where x: input to the system and y: output of the system
What if you want to draw a block diagram for this system on paper or in simulink, how will you represent the time advancement?
Can anybody tell me what is the significance of such type of system?
  댓글 수: 1
Dr.Athar Ravish Khan
Dr.Athar Ravish Khan 2018년 7월 19일
편집: Walter Roberson 2018년 7월 20일
You do refer the code to test the causality of system
clc;
close all;
k=2;%delay
n=0:2+k;
x=[10 2 5 zeros(1,k)]; %x(n)
subplot(411)
stem(n,x)
xdelay=[zeros(1,k) x(1:3)]; %x(n-2)
subplot(412)
stem(n,xdelay)
y=x+n.*xdelay; %y(n)=x(n)+n*x(n-2)
% delayed output y'(n)=x(n-k)+(n-k)*x(n-k-2)
nk=(0:length(n)-1+k)-k;
ydelayed=[xdelay zeros(1,k)]+nk.*[zeros(1,k) xdelay]
subplot(413)
stem(0:length(ydelayed)-1,ydelayed)
n1=(0:length(n)-1+k);
ydin=[xdelay zeros(1,k)]+n1.*[zeros(1,k) xdelay] % output due to delayed input
subplot(414)
stem(0:length(ydin)-1,ydin)
%%ydelayed is not equal system is non causal

댓글을 달려면 로그인하십시오.

답변 (4개)

Walter Roberson
Walter Roberson 2011년 6월 18일
편집: Walter Roberson 2018년 7월 20일
According to Maple's recurrence solver, if you have initial values for y(1) and y(2), then
y(k) = (1/4)*sqrt(2)*(Sum(((1/(-2+sqrt(2)))^(k-k0) * (2+sqrt(2)) + (2+sqrt(2))^(-k+k0) * (2*(-1)^(1+k-k0) + sqrt(2)*(-1)^(k-k0))) * (x(k0-2) + x(k0-1)), k0 = 3 .. k)) + (1/4*((6*y(1) + 4*y(2)) * sqrt(2) - 4*y(2) - 8*y(1))) * (-1-(1/2)*sqrt(2))^k - (3/2)*(-1+(1/2)*sqrt(2))^k * ((y(1) + (2/3)*y(2)) * sqrt(2) + (4/3)*y(1) + (2/3)*y(2))
What it means, I don't know.
[EDIT]
If you want to start with y(0) (you didn't say so I had to guess) then the formula becomes
y(k) = (1/4)*sqrt(2)*(Sum(((1/(-2+sqrt(2)))^(k-k0)*(2+sqrt(2))+(2+sqrt(2))^(-k+k0)*(2*(-1)^(1+k-k0)+sqrt(2)*(-1)^(k-k0)))*(x(k0-2)+x(k0-1)), k0 = 2 .. k))+(1/4*((-2*y(0)-2*y(1))*sqrt(2)+2*y(0)))*(-1-(1/2)*sqrt(2))^k+(1/2*((y(0)+y(1))*sqrt(2)+y(0)))*(-1+(1/2)*sqrt(2))^k
which is essentially identical in the summation but differs in the initialization.
According to this formula, the first several y(k) values starting at y(0) are:
y(0),
y(1), x[0]+x[1]-(1/2)*y(0)-2*y(1),
-2*x[0]-x[1]+x[2]+(7/2)*y(1)+y(0),
(7/2)*x[0]+(3/2)*x[1]-x[2]+x[3]-(7/4)*y(0)-6*y(1),
-6*x[0]-(5/2)*x[1]+(3/2)*x[2]-x[3]+x[4]+3*y(0)+(41/4)*y(1),
(41/4)*x[0]+(17/4)*x[1]-(5/2)*x[2]+(3/2)*x[3]-x[4]+x[5]-(41/8)*y(0)-(35/2)*y(1),
-(35/2)*x[0]-(29/4)*x[1]+(17/4)*x[2]-(5/2)*x[3]+(3/2)*x[4]-x[5]+x[6]+(35/4)*y(0)+(239/8)*y(1),
(239/8)*x[0]+(99/8)*x[1]-(29/4)*x[2]+(17/4)*x[3]-(5/2)*x[4]+(3/2)*x[5]-x[6]+x[7]-51*y(1)-(239/16)*y(0),
-51*x[0]-(169/8)*x[1]+(99/8)*x[2]-(29/4)*x[3]+(17/4)*x[4]-(5/2)*x[5]+(3/2)*x[6]-x[7]+x[8]+(51/2)*y(0)+(1393/16)*y(1),
(1393/16)*x[0]+(577/16)*x[1]-(169/8)*x[2]+(99/8)*x[3]-(29/4)*x[4]+(17/4)*x[5]-(5/2)*x[6]+(3/2)*x[7]-x[8]+x[9]-(1393/32)*y(0)-(1189/8)*y(1),
-(1189/8)*x[0]-(985/16)*x[1]+(577/16)*x[2]-(169/8)*x[3]+(99/8)*x[4]-(29/4)*x[5]+(17/4)*x[6]-(5/2)*x[7]+(3/2)*x[8]-x[9]+x[10]+(1189/16)*y(0)+(8119/32)*y(1),
(8119/32)*x[0]+(3363/32)*x[1]-(985/16)*x[2]+(577/16)*x[3]-(169/8)*x[4]+(99/8)*x[5]-(29/4)*x[6]+(17/4)*x[7]-(5/2)*x[8]+(3/2)*x[9]-x[10]+x[11]-(8119/64)*y(0)-(3465/8)*y(1),
-(3465/8)*x[0]-(5741/32)*x[1]+(3363/32)*x[2]-(985/16)*x[3]+(577/16)*x[4]-(169/8)*x[5]+(99/8)*x[6]-(29/4)*x[7]+(17/4)*x[8]-(5/2)*x[9]+(3/2)*x[10]-x[11]+x[12]+(3465/16)*y(0)+(47321/64)*y(1),
(47321/64)*x[0]+(19601/64)*x[1]-(5741/32)*x[2]+(3363/32)*x[3]-(985/16)*x[4]+(577/16)*x[5]-(169/8)*x[6]+(99/8)*x[7]-(29/4)*x[8]+(17/4)*x[9]-(5/2)*x[10]+(3/2)*x[11]-x[12]+x[13]-(47321/128)*y(0)-(40391/32)*y(1),
-(40391/32)*x[0]-(33461/64)*x[1]+(19601/64)*x[2]-(5741/32)*x[3]+(3363/32)*x[4]-(985/16)*x[5]+(577/16)*x[6]-(169/8)*x[7]+(99/8)*x[8]-(29/4)*x[9]+(17/4)*x[10]-(5/2)*x[11]+(3/2)*x[12]-x[13]+x[14]+(275807/128)*y(1)+(40391/64)*y(0)
You can see that each of these is essentially a linear combination of y(0) with y(1).

Sample Hold
Sample Hold 2011년 6월 18일
horrible what is that equation......
consider this one:
If you have y(1) and y(2) then you can get a current output for y(0) from x(0) and x(1). After that to calculate y(1), you need y(2) and y(3). What is the guarantee that the y(1) this time will not be a different from the one used before to calculate y(0)?
And, how will you draw a block diagram for this type of system?

Daniel Shub
Daniel Shub 2011년 6월 18일
Add a two smaple delay and your system becomes causal.

Bilawal
Bilawal 2023년 1월 31일
y(k) = (1/4)*sqrt(2)*(Sum(((1/(-2+sqrt(2)))^(k-k0) * (2+sqrt(2)) + (2+sqrt(2))^(-k+k0) * (2*(-1)^(1+k-k0) + sqrt(2)*(-1)^(k-k0))) * (x(k0-2) + x(k0-1)), k0 = 3 .. k)) + (1/4*((6*y(1) + 4*y(2)) * sqrt(2) - 4*y(2) - 8*y(1))) * (-1-(1/2)*sqrt(2))^k - (3/2)*(-1+(1/2)*sqrt(2))^k * ((y(1) + (2/3)*y(2)) * sqrt(2) + (4/3)*y(1) + (2/3)*y(2))
y(k) = (1/4)*sqrt(2)*(Sum(((1/(-2+sqrt(2)))^(k-k0)*(2+sqrt(2))+(2+sqrt(2))^(-k+k0)*(2*(-1)^(1+k-k0)+sqrt(2)*(-1)^(k-k0)))*(x(k0-2)+x(k0-1)), k0 = 2 .. k))+(1/4*((-2*y(0)-2*y(1))*sqrt(2)+2*y(0)))*(-1-(1/2)*sqrt(2))^k+(1/2*((y(0)+y(1))*sqrt(2)+y(0)))*(-1+(1/2)*sqrt(2))^k

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by