skrf.time.time_gate¶
- skrf.time.time_gate(ntwk, start=None, stop=None, center=None, span=None, mode='bandpass', window=('kaiser', 6), media=None, boundary='reflect', return_all=False)[source]¶
Time-gate one-port s-parameters.
The gate can be defined with start/stop times, or by center/span. all times are in units of nanoseconds. common windows are:
(‘kaiser’, 6)
6 # integers are interpreted as kaiser beta-values
‘hamming’
‘boxcar’ # a straight up rect
If no parameters are passed this will try to auto-gate the largest peak.
- Parameters
ntwk (
Network
) – network to operate onstart (number, or None) – start of time gate, (ns).
stop (number, or None) – stop of time gate (ns).
center (number, or None) – center of time gate, (ns). If None, and span is given, the gate will be centered on the peak.
span (number, or None) – span of time gate, (ns). If None span will be half of the distance to the second tallest peak
mode (['bandpass','bandstop']) – mode of gate
boundary ({'reflect', 'constant', 'nearest', 'mirror', 'wrap'},) – passed to scipy.ndimage.filters.convolve1d
window (string, float, or tuple) – passed to window arg of scipy.signal.get_window
return_all (bool) –
Note
You cant gate things that are ‘behind’ strong reflections. This is due to the multiple reflections that occur.
If center!=0, then the ntwk’s time response is shifted to t=0, gated, then shifted back to where it was. This is done in frequency domain using ntwk.delay(). If the media being gated is dispersive (ie waveguide), then the gate span will be span at t=0, which is different.
If you need to time-gate an N-port network, then you should gate each s-parameter independently.
- Returns
ntwk – copy of ntwk with time-gated s-parameters
- Return type
- Parameters
Warning
Depending on sharpness of the gate, the band edges may be inaccurate, due to properties of FFT. We do not re-normalize anything.