This commit is contained in:
2025-10-15 13:31:11 -05:00
parent 0c177eda44
commit d3187bb86f

View File

@@ -42,7 +42,7 @@ pinst235 = [14+31.755831065931034,
14+32.45807181713604]
pinst5 = [14+19.567076092915567,
14+-20.05316841156921,
14+20.05316841156921,
14+18.774664683716043,
14+20.252929968934183,
14+19.01518926375179]
@@ -88,7 +88,7 @@ print(f'Estimated path-loss exponent n: {n:.2f}')
predicted_PL = PL_d0 + model.predict(X)
# calc shadowing std. deviation using all measurements
residuals = measured_PL = predicted_PL[:, np.newaxis] # residuals for all
residuals = predicted_PL[:, np.newaxis] # residuals for all
# measurements
sigma = np.std(residuals)
@@ -96,12 +96,29 @@ print(f'Shadowing standard deviation: {sigma:.2f} dB')
# plot
plt.figure(figsize=(8,6))
plt.scatter(np.repeat(X, measured_PL.shape[1]), measured_PL.flatten(),
label='Measured PL')
plt.plot(X, predicted_PL, color='red', label='Fitted line')
#plt.scatter(np.repeat(X, measured_PL.shape[1]), measured_PL.flatten(),
# label='Measured PL')
#for xyz in measured_PL:
'''
for xyz in range(5):
plt.scatter(np.repeat(X, measured_PL[xyz]),
measured_PL[xyz].flatten(),
label=f'Path Loss {xyz}')
'''
#plt.plot(X, predicted_PL, color='red', label='Fitted line')
for xyz in range(5):
plt.plot(X, measured_PL[xyz], 'ro')
plt.plot(X, predicted_PL, label='Fitted Line')
plt.xlabel('10*log10(d/d0)')
plt.ylabel('Path Loss (dB)')
plt.title('Path Loss Experiment & Shadowing Estimation')
plt.legend()
plt.grid(True)
plt.show()
print(measured_PL)