2010-03-01 19:50:42 +00:00
|
|
|
%close all;
|
|
|
|
clear all;
|
|
|
|
clc
|
|
|
|
|
2010-03-16 20:43:11 +00:00
|
|
|
fmax = 50e6;
|
|
|
|
|
2010-03-04 10:53:58 +00:00
|
|
|
figure(1);
|
|
|
|
tmpu = load('../tmp/u1');
|
|
|
|
tmpi = load('../tmp/i1');
|
2010-03-01 19:50:42 +00:00
|
|
|
|
2010-03-04 10:53:58 +00:00
|
|
|
t = tmpu(:,1);
|
|
|
|
u = tmpu(:,2);
|
2010-03-01 19:50:42 +00:00
|
|
|
|
2010-03-04 10:53:58 +00:00
|
|
|
subplot(2,2,1);
|
|
|
|
title('u_1 TD');
|
2010-03-01 19:50:42 +00:00
|
|
|
plot(t,u);
|
2010-03-04 10:53:58 +00:00
|
|
|
xlabel('t \rightarrow');
|
|
|
|
ylabel('ut_1 \rightarrow');
|
2010-03-02 13:54:50 +00:00
|
|
|
grid on;
|
2010-03-01 19:50:42 +00:00
|
|
|
|
|
|
|
dt=t(2)-t(1);
|
2010-03-15 19:49:31 +00:00
|
|
|
u= [u ; zeros(5000,1)];
|
2010-03-04 10:53:58 +00:00
|
|
|
L=numel(u);
|
|
|
|
t = (1:L)*dt;
|
2010-03-01 19:50:42 +00:00
|
|
|
|
2010-03-15 19:49:31 +00:00
|
|
|
f = (0:L-1)/L/dt;
|
2010-03-01 19:50:42 +00:00
|
|
|
fu = fft(u)/L;
|
2010-03-04 10:53:58 +00:00
|
|
|
subplot(2,2,2);
|
|
|
|
title('u_1 FD');
|
2010-03-01 19:50:42 +00:00
|
|
|
plot(f(1:L/2),abs(fu(1:L/2)));
|
2010-03-04 10:53:58 +00:00
|
|
|
xlabel('f \rightarrow');
|
|
|
|
ylabel('|uf_1| \rightarrow');
|
2010-03-02 13:54:50 +00:00
|
|
|
grid on;
|
2010-03-01 19:50:42 +00:00
|
|
|
|
2010-03-04 10:53:58 +00:00
|
|
|
|
|
|
|
t = tmpi(:,1);
|
|
|
|
i = tmpi(:,2);
|
|
|
|
|
|
|
|
subplot(2,2,3);
|
|
|
|
title('i_1 TD');
|
|
|
|
plot(t,i);
|
|
|
|
xlabel('t \rightarrow');
|
|
|
|
ylabel('it_1 \rightarrow');
|
|
|
|
grid on;
|
|
|
|
|
|
|
|
dt=t(2)-t(1);
|
2010-03-15 19:49:31 +00:00
|
|
|
i = [i; zeros(5000,1)];
|
2010-03-04 10:53:58 +00:00
|
|
|
L=numel(i);
|
|
|
|
t = (1:L)*dt;
|
2010-03-15 19:49:31 +00:00
|
|
|
f = (0:L-1)/L/dt;
|
2010-03-04 10:53:58 +00:00
|
|
|
|
|
|
|
fi = fft(i)/L;
|
|
|
|
subplot(2,2,4);
|
|
|
|
title('i_1 FD');
|
|
|
|
plot(f(1:L/2),abs(fi(1:L/2)));
|
|
|
|
xlabel('f \rightarrow');
|
|
|
|
ylabel('|if_1| \rightarrow');
|
|
|
|
grid on;
|
|
|
|
|
|
|
|
figure(2);
|
2010-03-15 19:49:31 +00:00
|
|
|
subplot(2,1,1);
|
2010-03-04 10:53:58 +00:00
|
|
|
plot(f,real(fu./fi));
|
2010-03-16 20:43:11 +00:00
|
|
|
xlim([0 fmax]);
|
2010-03-04 10:53:58 +00:00
|
|
|
grid on;
|
2010-03-15 19:49:31 +00:00
|
|
|
subplot(2,1,2);
|
|
|
|
plot(f,imag(fu./fi));
|
2010-03-16 20:43:11 +00:00
|
|
|
xlim([0 fmax]);
|
2010-03-15 19:49:31 +00:00
|
|
|
grid on;
|
2010-03-04 10:53:58 +00:00
|
|
|
|
|
|
|
|