Lecture 1 - Part 2

Contents

Introduction

Deep-Edge Demo

Score:0

Fig 1: Sensors (Inspired by Scherz, P., & Monk, S. (2016). Practical electronics for inventors (4th ed.). McGraw-Hill Education)

Sensor Signal Processing Concepts

Select a sensor to analyze its signal conditioning and A/D conversion

Sensors

Temperature

Detect Temperature Change

Microphone

Detect sound

Photodiode

Detect variation in ambient light

Accelerometer

detect acceleration

Magnetometer

Detect changes in Magnetic Field

Flow Sensor

Detect changes in air or water flow

Signal Conditioning

Signal Conditioning

Select a sensor to view signal conditioning

Analog-to-Digital Conversion

Samples: 0
Resolution: 256 levels

Select a sensor to view A/D conversion

Sensor Signal processing

  1. Sensors are electronic or electro-mechanical components that allow devices to measure the operational environment and detect changes of physical stimuli (human/animal/nature generated).
  2. The sensors range from simple resistors to complex light detection and ranging (LIDARs).
  3. Many sensors will provide an output signal that is simply a voltage/current proportional to the property being measured.
  4. Some sensors use electro-mechanical structure to translate mechanical changes into electrical signals.
  5. Sensors provide stream of data for the Edge devices to make decisions and understand the environment.
  6. Sensor data is often then processed and transmitted over wireless medium.
  7. Several sensors may be deployed to monitor points/patterns-of-interest (PoI).
  8. Together these sensors form wireless sensor networks.
  9. Not all sensors need to be connected to Internet. Therefore, there is slight blury line between sensor networks and IoT in a strict sense.
  10. Sensors which have Internet connectivity can exploit secondary stream of data to understand environment better.  

Sensor

Analog Front-End
(Amplifier/Filter)

A/D Converter

Digital Processing
(DSP/Microcontroller)

Wireless Module
(Tx/Rx)

Access Point / Receiver

Sensor signals

Signal Characteristics

Signal Types

Analog Signals and Noise

Digital Signals and Noise

A/D Conversion

Given better noise resilience, and requirement to perform processing on the signal, we need to convert analog signals to digital. Before, we dive into sampling theory. Let us quickly recall what are the attributes of basic sine/cosine signals. We will then build our understanding of sampling in terms of these primitive signals. Later on, we will explore generalisation of these concepts.

Sampling

In order, to understand sampling process let us first understand a very important theoretical signal called dirac delta function.

Dirac Delta Function

The Dirac delta function, often denoted as δ(t)\delta(t), is a fundamental concept in signal processing. It is not a conventional function but a a singularity function with the following defintion:

Definition

The Dirac delta satisfies:

δ(t)={,t=00,t0\begin{equation} \delta(t) = \begin{cases} \infty, & t = 0 \\ 0, & t \neq 0 \end{cases} \end{equation}

with the property:

δ(t)dt=1\int_{-\infty}^{\infty} \delta(t) \, dt = 1

Fig 2: Dirac Delta Function

Key Properties

1.Sifting Property

f(t)δ(tt0)dt=f(t0)\int_{-\infty}^{\infty} f(t) \delta(t-t_0) \, dt = f(t_0)

This property allows the delta function to “pick out” the value of a function at a specific point.

2.Scaling Property Because the amplitude of an impulse is infinite, it does not make sense to describe a scaled impulse by its amplitude. Instead, the strength of a scaled impulse by its area.

δ(at)=1aδ(t),a0\delta(a t) = \frac{1}{|a|} \delta(t), \quad a \neq 0

3.Even Function

δ(t)=δ(t)\delta(-t) = \delta(t)

4.Shift Property

δ(tt0) shifts the impulse to t=t0\delta(t-t_0) \text{ shifts the impulse to } t = t_0

5.Multiplication by a Function

f(t)δ(tt0)=f(t0)δ(tt0)f(t) \delta(t-t_0) = f(t_0) \delta(t-t_0)

Approximating Dirac with a Real Pulse

A Dirac delta can be approximated by a real, narrow pulse pϵ(t)p_\epsilon(t) of width ϵ\epsilon and height 1/ϵ1/\epsilon, such that its area is 1:

pϵ(t)={1ϵ,tϵ20,t>ϵ2\begin{equation} p_\epsilon(t) = \begin{cases} \frac{1}{\epsilon}, & |t| \le \frac{\epsilon}{2} \\ 0, & |t| > \frac{\epsilon}{2} \end{cases} \end{equation}

As ϵ0\epsilon \to 0, pϵ(t)δ(t)p_\epsilon(t) \to \delta(t) in the sense of distributions.
This is useful in practice because real systems cannot generate an ideal Dirac impulse—they produce very short pulses with finite amplitude, which act like delta functions in analysis.

Fig 3: Impulse Approximation

The Dirac delta function can be used to describe an impulse train, i.e. collection of dirac-delta impulses as:

ΔTs[n]=n=δ[tnTs]\begin{equation} \Delta_{T_{s}}[n] = \sum_{n=-\infty}^{\infty} \delta[t - nT_s] \end{equation}

Fig 4: Impulse A continuous-time signal x(t) x(t) can be sampled as:

xs(t)=x(t)n=δ(tnTs)\begin{equation} x_s(t) = x(t) \cdot \sum_{n=-\infty}^{\infty} \delta(t-nT_s) \end{equation}

where TsT_s is the sampling period. Employing the sifting property:

xs(t)=n=x(nTs)ΔTs[n]x_s(t) = \sum_{n=-\infty}^{\infty} x(nT_s) \Delta_{T_{s}}[n]

This expresses the sampled signal as a weighted sum of impulses, where the weights are the sampled values of x(t)x(t).

Fig 5: Sampling

Fig 6: Sampling

Note

Take any analogue signal x(t)x(t) – we have used a sine wave simply as a example above. The simple question is – how fast must we sample x(t)x(t) > with an ADC so that if we transmit only the discrete-time samples (i.e. x(nT)x(nT)), then > at the receiver, we can reconstruct exactly the continuous-time/analogue x(t)x(t) (with no error) by using a DAC?

Fig 7: Sampling

Note

Clearly we have two sinusoids whose samples are identical and so the ADC will not be able to distinguish one from the other. How fast we should sample so that we can exactly reconstruct any analogue signal from its samples.

Fig 8: Some Insight

The figure above clearly provides us with some insight as to how fast we need to sample. However, we still precisely do not know how much fsf_s should exceed ff. Let us dive into frequency domain perspective, recall the Fourier Series.

Interactive Fourier Series Demo

Understanding how complex waveforms are built from simple sine waves

1Hz
1
1x

Square Wave

Contains only odd harmonics with amplitudes 1/n

x(t)=4πn=1sin((2n1)ω0t)(2n1)x(t) = \frac{4}{\pi} \sum_{n=1}^{\infty} \frac{\sin((2n-1) \omega_0 t)}{(2n-1)}

Harmonic Content:

Combined waveform

Key Concepts

Fundamental frequency: The lowest frequency component, determines the period of the waveform ω0\omega_0
Harmonics: Integer multiples of the ω0\omega_0
Amplitude weights: Each harmonic has a different amplitude that determines its contribution
Synthesis: Adding all harmonics together reconstructs the original complex waveform

Mathematical Details

General Form:

x(t)=a0+n=1ansin ⁣(ωnt+ϕn)x(t) = a_{0} + \sum_{n=1}^{\infty} a_{n} \sin\!\big(\omega_{n} t + \phi_{n}\big)

Where:

a0a_0 = DC component (average value)
ana_n = Fourier coefficients
ωn\omega_n = harmonic frequency

Fourier Series

Suppose x(t)x(t) is our information signal

Definition

A periodic waveform x(t)x(t) can be represented as a sum of weighted (an) sinusoids of different frequencies ωn=nω0\omega_n=n \omega_0:

Fig 9: Fourier Series Credit: [Kyle Jamieson] (https://www.cs.princeton.edu/courses/archive/spring18/cos463/)

The frequency domain view is simply the weight ana_n vs the frequencies wnw_n, showing the amount of power concentrated on each frequency.

Fig 10: Frequency View Credit: [Kyle Jamieson] (https://www.cs.princeton.edu/courses/archive/spring18/cos463/)

Fourier Transform

The Fourier Series deals with periodic signals. Not all signals are periodic, Fourier Transform deals with non-periodic signals.

Notation x(t)FX(f)x(t) \xleftrightarrow{\mathcal{F}} X(f)

Fourier Transform Pairs

Sampling

Nyquist Theorem

Definition

The sampling frequency should be at least twice the highest frequency contained in the signal.

fs>2f,\begin{equation} f_s>2f, \end{equation}

where fsf_s is sampling frequency and ff is the highest frequency contained in signal.

Fourier Transform of the Impulse Train

Let us have a quick look at what is happening here, use angular frequency ω \omega. The impulse train ΔTs(t) \Delta_{T_s}(t) has Fourier transform (a standard result):

F{ΔTs(t)}=ST(ω)=2πTk=δ(ωkωs),\mathcal{F}\{ \Delta_{T_s}(t) \} = S_T(\omega) = \frac{2\pi}{T} \sum_{k=-\infty}^{\infty} \delta(\omega - k\omega_s),

where

ωs=2πT.\omega_s = \frac{2\pi}{T}.

Equivalently, in ordinary frequency ff:

ST(f)=k=δ(fkfs),fs=1T.S_T(f) = \sum_{k=-\infty}^{\infty} \delta(f - k f_s), \quad f_s = \frac{1}{T}.

Fourier Transform of the Sampled Signal — Convolution in Frequency

Multiplication in time         \;\;\Rightarrow\;\; convolution in frequency.

Let

X(ω)=F{x(t)},Xs(ω)=F{xs(t)}.X(\omega) = \mathcal{F}\{x(t)\}, \quad X_s(\omega) = \mathcal{F}\{x_s(t)\}.

Then

Xs(ω)=12π(X(ω)ST(ω)).X_s(\omega) = \frac{1}{2\pi} \Big( X(\omega) \ast S_T(\omega) \Big).

Substituting ST(ω)S_T(\omega):

Xs(ω)=12π  X(ω)(2πTk=δ(ωkωs))X_s(\omega) = \frac{1}{2\pi} \; X(\omega) \ast \left( \frac{2\pi}{T} \sum_{k=-\infty}^{\infty} \delta(\omega - k\omega_s) \right) =1Tk=[X(ω)δ(ωkωs)]= \frac{1}{T} \sum_{k=-\infty}^{\infty} \Big[ X(\omega) \ast \delta(\omega - k\omega_s) \Big] =1Tk=X(ωkωs).= \frac{1}{T} \sum_{k=-\infty}^{\infty} X(\omega - k\omega_s).

So:

Xs(ω)=1Tk=X(ωkωs).X_s(\omega) = \frac{1}{T} \sum_{k=-\infty}^{\infty} X(\omega - k\omega_s).

That is, the spectrum of the sampled signal is the original spectrum repeated (shifted) by integer multiples of omegasomega_s, scaled by 1/T1/T.

In Ordinary Frequency (Hz)

If we use ff with fs=1/Tf_s = 1/T:

Xs(f)=k=X(fkfs).X_s(f) = \sum_{k=-\infty}^{\infty} X(f - k f_s).

(Here there is no 1/T1/T scaling in the ff-domain because of the Fourier transform normalization. Both forms are equivalent if you use consistent conventions.)


Interpretation — Aliasing and Nyquist

If X(ω)X(\omega) is bandlimited to ω<ωB|\omega| < \omega_B and ωs>2ωB\omega_s > 2\omega_B (equivalently fs>2fBf_s > 2f_B), the shifted spectra do not overlap. The original spectrum can be recovered by lowpass filtering and scaling. If ωs\omega_s (or fsf_s) is too small, the shifted spectra overlap resulting in aliasing.


Short Summary

Sampling in time:

xs(t)=x(t)n=δ(tnT)=n=x(nT)δ(tnT).x_s(t) = x(t) \sum_{n=-\infty}^{\infty} \delta(t - nT) = \sum_{n=-\infty}^{\infty} x(nT) \, \delta(t - nT).

Spectrum of impulse train:

ST(ω)=2πTk=δ(ωkωs).S_T(\omega) = \frac{2\pi}{T} \sum_{k=-\infty}^{\infty} \delta(\omega - k\omega_s).

Spectrum of sampled signal:

Xs(ω)=1Tk=X(ωkωs).X_s(\omega) = \frac{1}{T} \sum_{k=-\infty}^{\infty} X(\omega - k\omega_s).

Natural Sampling

  1. Original continuous signal recovered from its samples by separating its original baseband spectrum from its higher frequency spectral replicas
  2. Filter used is called a reconstruction filter

Aliasing

  1. Antialiasing filter located immediately prior to sampling circuit
  2. Antialiasing filter limits frequencies in pre-sampled signal to half the sampling rate (folding frequency) thus preventing aliasing
  3. To avoid amplitude (and phase) distortion amplitude response should be flat across the bandwidth of signal (and phase response must be linear)
  4. To minimise aliasing filter must have sufficiently rapid roll-off and sufficient attenuation above the cut-off (i.e. folding) frequency