torchsig.datasets.dataset_utils.frequency_shift_signal¶
- torchsig.datasets.dataset_utils.frequency_shift_signal(signal: Signal, center_freq_min: float, center_freq_max: float, sample_rate: float, frequency_max: float, frequency_min: float, random_generator: Generator | None = None) Signal[source]¶
Randomly shifts the frequency of a signal to a new center frequency and applies aliasing filters if necessary.
- Parameters:
signal (Signal) – The signal object to be frequency shifted.
center_freq_min (float) – Minimum center frequency for the random shift.
center_freq_max (float) – Maximum center frequency for the random shift.
sample_rate (float) – The sample rate of the signal.
frequency_max (float) – Maximum frequency limit for aliasing.
frequency_min (float) – Minimum frequency limit for aliasing.
random_generator (np.random.Generator, optional) – Random number generator for generating the random shift. Defaults to np.random.default_rng().
- Returns:
The frequency-shifted signal with updated metadata.
- Return type: