Why when plotting - no Phase change of 180 degrees ?

조회 수: 3 (최근 30일)
STP
STP 2019년 3월 28일
편집: STP 2019년 4월 1일
I would like to change phase of my inputs as per:
Is the below correct interpretation? It should be a particular phase , then phase ramp, then 180 degrees shift, then nothing. I don't my below code is doing that
Ek1 = exp(1)^(1i*pi);
phi= pi/2;
k = -phi./(t2a(1)-t1(1));
Ek2a = @(t) exp(1)^(1i*(phi + k.*(t-t1(1))));
Ek2b = exp(1)^(1i*0);
Ek3 = 0;

답변 (1개)

darova
darova 2019년 3월 28일
maybe you need a function:
function res = Ek(t)
% t1 =
% t1B =
% t2 =
phi0 = pi/2;
k = -phi0/(t1B-t1);
res = zeros(size(t));
for i = 1:length(t)
if t(i) < t1
res(i) = exp(1i*pi);
elseif t1 <= t(i) && t(i) < t1B
res(i) = exp(1i*(phi0 + k*[t(i)-t1]));
elseif t1B <= t(i) && t(i) < t2
res(i) = exp(0i); % or just 1
else
res(i) = 0;
end
end
end
  댓글 수: 3
darova
darova 2019년 3월 28일
Dont understand
k = -phi./(t2a(1)-t1(1)); % you mean: k = -phi./(t1B - t1)?
STP
STP 2019년 3월 29일
편집: STP 2019년 4월 1일
Yup the same. Is it wrong?

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

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by