ENع
→What a signal is
الدرس 01 · Signals and systems in continuous time

What a signal is

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

12 دقيقة10 خطوات5 أسئلةBeginner
عن هذا الدرس

A signal is a quantity that changes and carries information. Follow one: a tuning fork rings at 440 Hz, a microphone turns the sound into a voltage x(t), and a converter samples it 8000 times a second into a list of numbers x[n], then rounds them into a digital signal a computer stores. You will meet continuous time, discrete time and digital, and build the same signal in Python with numpy. It helps to know the Circuits lesson on sinusoids and the Maths lesson on complex numbers first, but this lesson needs only the idea of a graph.

ستتعلّم

حدّد ما تشعر بأنك أتقنته. هذا التقييم الذاتي لا يؤثر في درجة الدرس.

شكل 1 · تفاعلي
01 / 10

Something that changes

A tuning fork rings. Its prongs swing 440 times a second and push the air, so the air pressure near it rises and falls. A quantity that changes and carries information is a signal.

fork        rings at f0 = 440 Hz (the note A4)
air         pressure goes up, down, up ...

signal = a quantity that changes
         (over time, or over space)
         and carries information

here: the pitch 440 Hz says "this is an A"
motion in the figure: slowed down a lot
جارٍ تحميل الرسم…
أو ← →
اقرأ الدرس خطوة بخطوة
  1. Something that changes

    A tuning fork rings. Its prongs swing 440 times a second and push the air, so the air pressure near it rises and falls. A quantity that changes and carries information is a signal.

    fork        rings at f0 = 440 Hz (the note A4)
    air         pressure goes up, down, up ...
    
    signal = a quantity that changes
             (over time, or over space)
             and carries information
    
    here: the pitch 440 Hz says "this is an A"
    motion in the figure: slowed down a lot
  2. A microphone makes a voltage

    A microphone turns air pressure into a voltage on a wire. More pressure, more voltage. The shape stays the same; only the kind of quantity changes. We call this voltage x(t) and draw it as it arrives.

    pressure  ->  microphone  ->  voltage x(t)
    
    same shape, new quantity
    (a sensor or transducer does this)
    
    plot: x(t) in millivolts (mV)
          against time t in milliseconds (ms)
          1 ms = 0.001 s
  3. A signal is a function of time

    Give the signal a time and it gives back one value. At t = 0.5 ms the voltage is x(0.5 ms) = 9.82 mV. Time is the input (the independent variable); the voltage is the output.

    x(t) = A·sin(2π·f0·t)
         A  = 10 mV,  f0 = 440 Hz
    
    t = 0.5 ms = 0.0005 s
    x  = 10·sin(2π × 440 × 0.0005)
       = 10·sin(1.382 rad)
       = 9.82 mV
    
    one input t  ->  one output x(t)
  4. Amplitude, period, frequency

    This wave peaks at 10 mV: its amplitude. It repeats every T = 1/440 s = 2.27 ms: its period. Repeats per second are the frequency, f = 1/T = 440 Hz. We hear frequency as pitch.

    amplitude  A = 10 mV  (the peak)
    period     T = 1 / f0 = 1 / 440 s
                 = 2.27 ms
    frequency  f0 = 1 / T = 440 Hz
               (hertz = repeats per second)
    
    in 5 ms: 5 / 2.27 = 2.2 periods
    sinusoids in depth: see Circuits, "Sinusoids"
  5. Continuous time: a value at every instant

    Between any two instants there is another, and x(t) has a value at each one. A signal defined for every real time t is a continuous-time signal. The voltage on the wire is one.

    continuous time:  t can be any real number
      t = 1 ms, 1.5 ms, 1.25 ms, 1.2501 ms ...
      x(t) is defined at every one of them
    
    written with round brackets: x(t)
    
    its value can be any number in a range:
    an analog signal
  6. Sampling: a value every 125 µs

    A converter (ADC) measures the voltage 8000 times a second: once every Ts = 1/8000 s = 125 µs. Each reading is a sample: x[n] = x(n·Ts). So x[4] = x(0.5 ms) = 9.82 mV.

    fs = 8000 samples per second (telephone rate)
    Ts = 1 / fs = 125 µs = 0.125 ms
    
    x[n] = x(n·Ts)
     x[0] = x(0)        = 0.00 mV
     x[1] = x(0.125 ms) = 3.39 mV
     x[2] = x(0.250 ms) = 6.37 mV
     x[3] = x(0.375 ms) = 8.61 mV
     x[4] = x(0.500 ms) = 9.82 mV
  7. Discrete time: a list of numbers

    In 5 ms the converter takes 40 samples. Now the signal is a list: x[0], x[1], x[2] ... The index n is a whole number, so x[2.5] does not exist. This is a discrete-time signal.

    discrete time:  n = 0, 1, 2, 3 ...
      whole numbers only
      x[2.5] is not defined
    
    written with square brackets: x[n]
    
    5 ms × 8000 per second = 40 samples
    between samples, x[n] says nothing
  8. Digital: the values are rounded too

    A computer stores whole numbers. This 8-bit converter counts in steps of 0.1 mV and has 2⁸ = 256 levels, so 3.39 mV is stored as 34. Discrete in time and in value: a digital signal.

    8 bits -> 2⁸ = 256 levels
    step = 0.1 mV, range −12.8 .. +12.7 mV
    
    q[n] = round(x[n] / 0.1 mV)
     x[1] = 3.39 mV -> 34
     x[2] = 6.37 mV -> 64
     x[3] = 8.61 mV -> 86
     x[4] = 9.82 mV -> 98
    
    largest rounding error here: 0.048 mV
  9. A signal in Python is an array

    In Python with numpy, a sampled signal is an array. np.arange(40) gives n = 0 to 39; one line computes all 40 samples at once. np.sin takes radians. The first five match the memory.

    import numpy as np
    fs = 8000
    n = np.arange(40)
    x = 10*np.sin(2*np.pi*440*n/fs)
    
    >>> x.round(2)[:5]
    array([0.  , 3.39, 6.37, 8.61, 9.82])
    >>> len(x)
    40
    
    (Python 3 with numpy)
  10. Signals are everywhere

    A heartbeat on an ECG, a day's temperature, a photo (brightness over two directions, x and y): all are signals. Each is a function of one or more variables. Next, systems that change signals.

    signal          independent variable(s)
    sound x(t)      time
    ECG             time
    temperature     time
    photo           x and y (2-D)
    video           x, y and time
    
    continuous time  x(t),  t any real number
    discrete time    x[n],  n a whole number
    digital          discrete time + rounded values

اختبار يتاح بعد الخطوة الأخيرة.