修复了fit_constant==False的bug,但是不建议使用
This commit is contained in:
@@ -161,7 +161,7 @@ class MultiplePortQR:
|
||||
M_kp = None
|
||||
for i in range(self.ports):
|
||||
for j in range(self.ports):
|
||||
M0 = np.zeros((K,N*ports**2),dtype=complex)
|
||||
M0 = np.zeros((K,N*self.ports**2),dtype=complex)
|
||||
M0[:,index*N:(index+1)*N] = Phi
|
||||
M0 = np.hstack([M0, -(H[:,i,j].reshape(-1,1) * Phi)]).reshape((K, -1))[keep,:] # (K, 2N), complex
|
||||
index+=1
|
||||
@@ -225,10 +225,10 @@ class MultiplePortQR:
|
||||
H_kp = None
|
||||
for i in range(self.ports):
|
||||
for j in range(self.ports):
|
||||
H_kp0 = weights_kp @ (H[:,i,j]).reshape(1,-1)[keep,:]
|
||||
H_kp = H_kp0 if H_kp is None else np.hstack([H_kp, H_kp0])
|
||||
H_0 = H[:,i,j][keep]
|
||||
H_kp = H_0 if H_kp is None else np.hstack([H_kp, H_0])
|
||||
assert H_kp is not None
|
||||
H_kp = H_kp.reshape(-1,1)
|
||||
H_kp = weights_kp @ H_kp.reshape(-1,1)
|
||||
|
||||
b_re = np.real(d0 * H_kp)
|
||||
b_im = np.imag(d0 * H_kp)
|
||||
@@ -318,14 +318,14 @@ if __name__ == "__main__":
|
||||
network = rf.Network(f"/tmp/paramer/simulation/{id}/{id}.s2p")
|
||||
# network = rf.data.ring_slot
|
||||
ports = network.nports
|
||||
K = 5
|
||||
K = 10
|
||||
|
||||
full_freqences = network.f[start_point:]
|
||||
noised_sampled_points = network.y[start_point:,:,:].reshape(-1,ports,ports)
|
||||
sampled_points = network.y[start_point:,:,:].reshape(-1,ports,ports)
|
||||
|
||||
# noised_sampled_points = network.y[start_point:,0,0].reshape(-1,1,1)
|
||||
# sampled_points = network.y[start_point:,0,0].reshape(-1,1,1)
|
||||
# noised_sampled_points = network.y[start_point:,1,0].reshape(-1,1,1)
|
||||
# sampled_points = network.y[start_point:,1,0].reshape(-1,1,1)
|
||||
|
||||
H,freqs = auto_select_multple_ports(noised_sampled_points,full_freqences,max_points=20)
|
||||
poles = generate_starting_poles(2,beta_min=1e4,beta_max=freqs[-1]*1.1)
|
||||
|
||||
Reference in New Issue
Block a user