Вы находитесь на странице: 1из 1

%harmonisa

t=0:0.001:0.1;
A1=1;
A3=0.3;
A5=0.2;
A7=0.05;
phi=3.14;
w=2*phi.*50;
y=A1.*sin(w.*t)+A3.*sin(3.*w.*t)+A5.*sin(5.*w.*t)+A7.*sin(7.*w.*t);
plot(t,y,'k')
ylabel('Amplitude (V)');
xlabel('Time (sec)');

%Tegangan kedip
u = inline('t >= 0');
t = [0:0.001:0.2];
A=0.5; t1=0.08; t2=0.12;
phi=3.14;
w=2*phi.*50;
y=(1-A*(u(t-t1)-u(t-t2))).*sin(w.*t);
figure (2)
plot(t,y,'k')
ylabel('Amplitude (V)');
xlabel('Time (sec)');

%Oscillatory Transient
t=0:0.0001:0.2;
A1=0.1;
t1=0.09; t2=0.12; tau = 0.07;
phi=3.14;
w=2*phi.*50;
w1=2*phi.*800;
y=(sin(w.*t))+((A1.*exp(-(t-t1)/t2)).*sin(w1.*(t-t1)));
plot(t,y,'k')
ylabel('Amplitude (V)');
xlabel('Time (sec)');

%Notching
u = inline('t >= 0');
t=0:0.0001:0.2;
t1=0.0001; t2=0.01;
h=0;
for i=0:9
y = h + 0.3*(u(t-(t1+0.02*i))-u(t-(t2+0.02*i)));
h=y;
end;
phi=3.14;
w=2*phi.*50;
v=sin(w.*t)-sign(sin(w.*t)).*h;
figure(10)
plot(t,v,'k')
ylabel('Amplitude (V)');
xlabel('Time (sec)');

Вам также может понравиться