spectrum_peaks¶
-
ipkiss3.all.
spectrum_peaks
(smatrix1dsweep, port_pairs=None, func=<function signal_power>, threshold=None, method='spline', bandpass=None, **kwargs)¶ Extract information about the peaks in the given S-parameter spectra
Two methods are available: based on a spline fit or based on convolution with wavelets, optionally with an extra convolution with a gaussian.
Parameters: smatrix1dsweep: SMatrix1DSweep
The smatrix sweep object that represents the spectra
port_pairs: Iterable[Tuple] or None
List of port pairs to process, e.g. [(‘out1’, ‘in1’), (‘out2’, ‘in1’)] or None to process all
func: Callable
Function f(x) to apply to each spectrum, defaults to power(x) = abs(x)**2
threshold: float or None
Decision threshold for peaks. Defaults to the average between minimum and maximum (after applying func).
method: ‘spline’ or ‘cwt’
Peak finding method to use
bandpass: bool or None
Bandpass (True) or bandstop (False) filter. None for auto-detect.
Returns: peak_info: Dict[(port_out, port_in), ndarray]
Peak wavelengths/frequencies for each port pair
Other Parameters: smoothing: float
Spline smoothing factor (‘spline’ method). Defaults to 0.0