You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.9 KiB
57 lines
1.9 KiB
clear;close all;
|
|
|
|
Nfft = 8000;
|
|
|
|
f1 =0.2e9;f2=7.8e9;
|
|
|
|
freq_array = linspace(f1,f2,Nfft);
|
|
|
|
freq = freq_array;
|
|
|
|
%% begin of SpaceTime data
|
|
folder = './TimeDomain/SpaceTime';
|
|
|
|
INCNAME = sprintf('%s/%s.TD_Vinc',folder,'PBGDDMST_src');
|
|
REFNAME1 = sprintf('%s/%s.TD_Vref',folder,'PBGDDMST_recv');
|
|
REFNAME2 = sprintf('%s/%s.TD_Vref',folder,'PBGDDMST_src');
|
|
|
|
v_in = load(INCNAME);v_in = v_in(:,[1,2]);
|
|
t = v_in(:,1);dt = t(2)-t(1);N = ceil(length(t));
|
|
v_in = v_in(1:N,2);
|
|
|
|
v_ref1 = load(REFNAME1);v_ref2 = load(REFNAME2);
|
|
v_ref1 = v_ref1(:,[1,2]);v_ref1 = v_ref1(1:N,2);
|
|
v_ref2 = v_ref2(:,[1,2]);v_ref2 = v_ref2(1:N,2);
|
|
|
|
|
|
[X_ref1] = time_to_frequency_domain([v_ref1(:,1);zeros(Nfft-length(v_ref1),1)],dt,freq_array,0);
|
|
[X_ref2] = time_to_frequency_domain([v_ref2(:,1);zeros(Nfft-length(v_ref2),1)],dt,freq_array,0);
|
|
[X_in] = time_to_frequency_domain([v_in(:,1);zeros(Nfft-length(v_in),1)],dt,freq_array,0);
|
|
plot(freq/1e9,20*(log10(abs(X_ref1./X_in))),'-.','linewidth',2);hold on;
|
|
plot(freq/1e9,20*(log10(abs(X_ref2./X_in))),':','linewidth',2);hold on;
|
|
|
|
|
|
%%
|
|
fdtddata = load('./TimeDomain/Reference/s12fdtd.mat');
|
|
fdtddata=fdtddata.s12fdtd;
|
|
plot(fdtddata(:,1)+0.1,fdtddata(:,2),'.','linewidth',2);hold on;
|
|
gratings11 = load('./TimeDomain/Reference/s11grating.mat');
|
|
gratings11=gratings11.s11grating;
|
|
plot(gratings11(:,1)+0.05,gratings11(:,2)+1.3,'linewidth',2);hold on;
|
|
gratings12 = load('./TimeDomain/Reference/s12grating.mat');
|
|
gratings12=gratings12.s12grating;
|
|
plot(gratings12(:,1)+0.1,gratings12(:,2),'linewidth',2);hold on;
|
|
xlabel('Frequency (GHz)','fontsize',14);
|
|
legend('S12-Space-Time-Parallel','S11-Space-Time-Parallel','S12-FDTD','S11-Grating','S12-Grating','fontsize',14);
|
|
ylabel('S-parameters (dB)','fontsize',14);
|
|
xlim([3e9/1e9 f2/1e9]);
|
|
grid off;
|
|
% title('S parameters of PBG');
|
|
legend box off;
|
|
|
|
|
|
% clear;
|
|
% a=load('ebgdata'); a = a.ebgd;
|
|
% plot(a(1,:),a(2,:));hold on;
|
|
% a=load('airdata'); a = a.aird;
|
|
% plot(a(1,:),a(2,:)); |