필터 지우기
필터 지우기

shifting and time reversal of a piecewise defined signal

조회 수: 6 (최근 30일)
Aaron Connell
Aaron Connell 2016년 10월 16일
댓글: Walter Roberson 2016년 10월 16일
I have a piece-wise defined function x(t) as shown below. I need to plot x(-t-1) now but am not sure how to do it. I tried to create a function like "modified_x= @x x(-t-1) but it only returns a horizontal line at x(t)=0. Please help gurus! below is my code that gives me my desired function of t. Now I need to apply x(-t-1).

채택된 답변

Walter Roberson
Walter Roberson 2016년 10월 16일
x = @(t) (0 <= t & t < 2) .* exp(t)/2 + (2 <= t & t < 4) .* (2*t-8);
shifted_x = @(t) x(-t-1);
t = linspace(-6, 0);
plot(t, shifted_x(t))
xlabel('Time(t)')
ylabel('x(t)');
Reversal around time t = c would be x(c-t) so you are reversing around t = -1 and that means that anything that used to happen at time 2 would now happen at time -3, anything time 3 would now happen at -4 and so on, so your primary problem was that you were looking in the wrong time range and you were cutting out the interesting parts of the plot with your axis() call.
  댓글 수: 3
Aaron Connell
Aaron Connell 2016년 10월 16일
any way to cut off the function at t=-1? It looks as if it does a little drop and then a flat line up to zero
Walter Roberson
Walter Roberson 2016년 10월 16일
Change the linspace bounds for t.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by