Skip to content

Added reporting of fitting error.#18

Open
capn-freako wants to merge 8 commits into
mainfrom
17-check-report-fitting-error
Open

Added reporting of fitting error.#18
capn-freako wants to merge 8 commits into
mainfrom
17-check-report-fitting-error

Conversation

@capn-freako
Copy link
Copy Markdown
Owner

Fixes #17

@capn-freako capn-freako self-assigned this Aug 26, 2025
@capn-freako
Copy link
Copy Markdown
Owner Author

It's a little difficult to review these changes to Jupyter notebooks, using the built-in GitHub diff engine.
So, here's the code I've written, to calculate the fitting error:

_f = ntwk_dd.f
sig = ntwk_dd.s21.s[:, 0, 0]
Hs = vf.get_model_response(0, 0, _f)
mag_err = np.abs(Hs) - np.abs(sig)
rmse = np.sqrt(np.mean(mag_err**2))
rmss = np.sqrt(np.mean(np.abs(sig)**2))
print(f"Average fit SNR: {20 * np.log10(rmss / rmse):.0f} dB")

Is that acceptable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modify the ImpulseResponseFromSparameters notebook to include total fitting error in Sec. 7.2 - Vector Fitting Differential Insertion Loss

1 participant