1234567891011121314151617181920 |
- import numpy as np
- class JammingSignalAlgo:
- @staticmethod
- def generate_noise_jam(bandwidth, duration, sample_rate):
- num_samples = int(duration * sample_rate)
- return np.random.normal(0, 1, num_samples)
- @staticmethod
- def generate_amplitude_noise_jam(bandwidth, duration, sample_rate):
- t = np.arange(0, duration, 1/sample_rate)
- carrier = np.sin(2 * np.pi * bandwidth * t)
- noise = 0.5 * np.random.normal(0, 1, len(t))
- return carrier * noise
- @staticmethod
- def generate_velocity_deceptive_jam(bandwidth, duration, sample_rate):
- t = np.arange(0, duration, 1/sample_rate)
- phase_shift = np.cumsum(np.random.uniform(-0.1, 0.1, len(t)))
- return np.sin(2 * np.pi * bandwidth * t + phase_shift)
|