jamming_signal_algo_20250421173847.py 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. import numpy as np
  2. class JammingSignalAlgo:
  3. @staticmethod
  4. def frequency_modulation(bandwidth, duration, sample_rate, modulation_index=0.5):
  5. """噪声调频干扰算法"""
  6. t = np.arange(0, duration, 1/sample_rate)
  7. baseband = np.random.normal(0, 1, len(t))
  8. modulated = np.sin(2 * np.pi * bandwidth * t + modulation_index * np.cumsum(baseband))
  9. return modulated
  10. @staticmethod
  11. def repeater_jamming(bandwidth, duration, sample_rate, delay=0.1, attenuation=0.5):
  12. """转发式干扰算法"""
  13. t = np.arange(0, duration, 1/sample_rate)
  14. original_signal = np.sin(2 * np.pi * bandwidth * t)
  15. return attenuation * np.roll(original_signal, int(delay * sample_rate))
  16. @staticmethod
  17. def velocity_deception(bandwidth, duration, sample_rate, doppler_shift=1000):
  18. """速度欺骗干扰算法"""
  19. t = np.arange(0, duration, 1/sample_rate)
  20. return np.sin(2 * np.pi * (bandwidth + doppler_shift) * t)
  21. @staticmethod
  22. def range_deception(bandwidth, duration, sample_rate, fake_range=500):
  23. """距离欺骗干扰算法"""
  24. t = np.arange(0, duration, 1/sample_rate)
  25. fake_delay = 2 * fake_range / 3e8 # 计算双程时延
  26. return np.sin(2 * np.pi * bandwidth * (t - fake_delay))