Why when plotting - no Phase change of 180 degrees ?
2 views (last 30 days)
Show older comments
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;
0 Comments
Answers (1)
darova
on 28 Mar 2019
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 Comments
darova
on 28 Mar 2019
Dont understand
k = -phi./(t2a(1)-t1(1)); % you mean: k = -phi./(t1B - t1)?
See Also
Categories
Find more on Audio I/O and Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!