Skip to content

FXC-4546: add baseband source time classes for transient simulations#3250

Open
dmarek-flex wants to merge 1 commit intodevelopfrom
dmarek/FXC-4546-baseband-source-time
Open

FXC-4546: add baseband source time classes for transient simulations#3250
dmarek-flex wants to merge 1 commit intodevelopfrom
dmarek/FXC-4546-baseband-source-time

Conversation

@dmarek-flex
Copy link
Contributor

@dmarek-flex dmarek-flex commented Feb 6, 2026

Note

Medium Risk
Introduces new source_time variants and updates schema discriminators and type unions used across simulation/source validation, which could affect serialization and downstream integrations if any assumptions about allowed SourceTimeType values exist.

Overview
Adds new baseband (carrier-free) source time types for transient RF simulations: BasebandStep, BasebandGaussianPulse, BasebandRectangularPulse, and BasebandCustomSourceTime (dataset-driven with FFT-derived bandwidth and end-time detection).

Wires these types through the system by introducing a shared SourceTimeType union in components/types/time.py, updating imports/validators and S-matrix component modelers/ports, exporting the new classes via tidy3d.__init__ and tidy3d/rf.py, and extending JSON schemas (Simulation, ModeSimulation, TerminalComponentModeler) so source_time discriminators accept the new variants.

Adds a comprehensive microwave test suite covering phase-locking to 0, waveform shapes, frequency_range/end_time behavior (including edge cases), plotting, and full Simulation validation with each new baseband type; also updates the CHANGELOG accordingly.

Written by Cursor Bugbot for commit 8e17e32. This will update automatically on new commits. Configure here.

@dmarek-flex dmarek-flex self-assigned this Feb 6, 2026
@dmarek-flex dmarek-flex added the RF label Feb 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Diff Coverage

Diff: origin/develop...HEAD, staged and unstaged changes

  • tidy3d/init.py (100%)
  • tidy3d/components/microwave/time.py (100%)
  • tidy3d/components/source/base.py (100%)
  • tidy3d/components/source/time.py (88.9%): Missing lines 110,115
  • tidy3d/components/types/time.py (100%)
  • tidy3d/plugins/smatrix/component_modelers/base.py (100%)
  • tidy3d/rf.py (100%)

Summary

  • Total: 149 lines
  • Missing: 2 lines
  • Coverage: 98%

tidy3d/components/source/time.py

Lines 106-119

  106         freqs = np.fft.rfftfreq(len(values), d=dt)
  107 
  108         peak = np.max(spectrum)
  109         if peak == 0:
! 110             return (0.0, 1.0)
  111 
  112         cutoff = np.exp(-(num_fwidth**2) / 2)
  113         above_cutoff = spectrum >= cutoff * peak
  114         if not np.any(above_cutoff):
! 115             return (0.0, freqs[-1])
  116 
  117         indices = np.where(above_cutoff)[0]
  118         fmin = float(freqs[indices[0]])
  119         fmax = float(freqs[indices[-1]])

@dmarek-flex dmarek-flex force-pushed the dmarek/FXC-4546-baseband-source-time branch from 711db32 to 965c864 Compare February 6, 2026 22:01
@dmarek-flex
Copy link
Contributor Author

Here are some nice pictures of the new baseband signals
demo_baseband

Add BasebandStep, BasebandGaussianPulse,
BasebandRectangularPulse, and BasebandCustomSourceTime for
unmodulated transient RF excitations (TDR, step functions,
arbitrary time profiles). These inherit from SourceTime directly,
require no freq0/fwidth, and compute frequency_range from the
signal's actual frequency content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dmarek-flex dmarek-flex force-pushed the dmarek/FXC-4546-baseband-source-time branch from 965c864 to 8e17e32 Compare February 7, 2026 03:25
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

"rise_time"
],
"type": "object"
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Schema type names mismatch Python class names

High Severity

The JSON schemas define type discriminators BasebandStepSourceTime and BasebandGaussianSourceTime, but the corresponding Python classes are named BasebandStep and BasebandGaussianPulse. This mismatch will cause JSON serialization/deserialization failures since the type discriminator values won't match between the Python code output and what the schemas expect.

Additional Locations (1)

Fix in Cursor Fix in Web

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant