Прием радиоволн и добавление шума с помощью Python

  1. Генерация электромагнитных волн:

    • Пример кода (Python):

      import numpy as np
      import matplotlib.pyplot as plt
      
      # Parameters
      frequency = 2.4e9  # 2.4 GHz
      duration = 1.0    # 1 second
      sample_rate = 44100
      
      # Time axis
      t = np.linspace(0, duration, int(sample_rate * duration))
      
      # Generate wave
      wave = np.sin(2 * np.pi * frequency * t)
      
      # Plot the wave
      plt.plot(t, wave)
      plt.xlabel('Time (s)')
      plt.ylabel('Amplitude')
      plt.title('Generated Electromagnetic Wave')
      plt.show()
  2. Распространение электромагнитных волн:

    • Пример кода (Python):

      import numpy as np
      import matplotlib.pyplot as plt
      
      # Parameters
      frequency = 2.4e9  # 2.4 GHz
      wavelength = 3e8 / frequency
      
      # Distance axis
      distance = np.linspace(0, 10 * wavelength, 1000)
      
      # Electric field amplitude decay with distance
      amplitude = np.exp(-distance / (2 * wavelength))
      
      # Plot the decay
      plt.plot(distance, amplitude)
      plt.xlabel('Distance (m)')
      plt.ylabel('Electric Field Amplitude')
      plt.title('Propagation of Electromagnetic Waves')
      plt.show()
  3. Прием радиоволн:

    • Пример кода (Python):

      import numpy as np
      import matplotlib.pyplot as plt
      
      # Parameters
      frequency = 2.4e9  # 2.4 GHz
      duration = 1.0    # 1 second
      sample_rate = 44100
      
      # Time axis
      t = np.linspace(0, duration, int(sample_rate * duration))
      
      # Generate received wave
      received_wave = np.sin(2 * np.pi * frequency * t) + np.random.normal(0, 0.1, len(t))
      
      # Plot the received wave
      plt.plot(t, received_wave)
      plt.xlabel('Time (s)')
      plt.ylabel('Amplitude')
      plt.title('Received Radio Wave')
      plt.show()