input: Write a function to generate a voltage signal with random noise based on a given frequency and amplitude. Return the generated signal. If the frequency or amplitude is not provided, default them to 250 Hz and 1 V respectively.
  assert generate_signal(250, 1).shape == (1000,)
  assert generate_signal().shape == (1000,)
  assert isinstance(generate_signal(250, 1), np.ndarray)
  assert isinstance(generate_signal(), np.ndarray)
  assert generate_signal(500) is not None
output: import numpy as np
  
  def generate_signal(frequency=250, amplitude=1):
      t = np.linspace(0, 1, 1000)
      signal = amplitude * np.sin(2 * np.pi * frequency * t)
      noise = np.random.normal(0, 0.1, 1000)
      return signal + noise