Skip to main content

Sample and Filter

Sample and filter are two common operations. In this chapter, we introduce the basics of the two operations. For engineering details, please refer to the signal processing section of this note.

Sample​

Sample is the process of converting an analogs signal (continuous signal) to a digital signal (discreet signal).

x[n]=x(nT)x[n] = x(nT)

Where TT is called the sampling interval.

Fourier Transform on Periodic Signals​

Sometimes we may need to perform fourier transform on a periodic signal. However, the result isn't easy to get via normal means, because the you will see delta function in the result.

We suppose,

f(t)→FF(ω)f(t) \xrightarrow{\mathcal{F}} F(\omega)

We know that periodical signal can be expanded using fourier series,

f(t)=∑k=−∞+∞akejkΩtf(t) = \sum_{k=-\infty}^{+\infty} a_k e^{j k \Omega t}

Where Ω=2πT\Omega = \frac{2\pi}{T}.

Since δ(t−a)f(t)=δ(t−a)f(a)\delta(t-a)f(t) = \delta(t-a)f(a),

f(t)=∫−∞+∞(∑n=−∞n=+∞anδ(k−n))ejkΩtdkf(t) = \int_{-\infty}^{+\infty} (\sum_{n=-\infty}^{n=+\infty} a_n\delta(k - n)) e^{j k \Omega t} \mathrm{d}k

We know that fourier inverse transform is,

f(t)=12π∫−∞+∞F(ω)ejωtdωf(t) = \frac{1}{2\pi} \int_{-\infty}^{+\infty} F(\omega) e^{j \omega t} \mathrm{d}\omega

We consider fitting the above integration into this form,

f(t)=∫−∞+∞(∑n=−∞n=+∞anδ(k−n))ejkΩtdk=∫−∞+∞(∑n=−∞n=+∞anδ(Ωk−Ωn))ejkΩtd(Ωk)=12π∫−∞+∞(∑n=−∞n=+∞2πanδ(ω−Ωn))ejωtdωf(t) = \int_{-\infty}^{+\infty} (\sum_{n=-\infty}^{n=+\infty} a_n\delta(k - n)) e^{j k \Omega t} \mathrm{d}k \\ = \int_{-\infty}^{+\infty} (\sum_{n=-\infty}^{n=+\infty} a_n\delta(\Omega k - \Omega n)) e^{j k \Omega t} \mathrm{d}(\Omega k) \\ = \frac{1}{2\pi} \int_{-\infty}^{+\infty} (\sum_{n=-\infty}^{n=+\infty} 2\pi a_n \delta(\omega - \Omega n)) e^{j \omega t} \mathrm{d}\omega \\

Since,

f(t)=12π∫−∞+∞F(ω)ejωtdωf(t) = \frac{1}{2\pi} \int_{-\infty}^{+\infty} F(\omega) e^{j \omega t} \mathrm{d}\omega

We can conclude that,

F(ω)=∑n=−∞n=+∞2πanδ(ω−Ωn)F(\omega) = \sum_{n=-\infty}^{n=+\infty} 2\pi a_n \delta(\omega - \Omega n)

For periodical signals, we need to first do fourier series decomposition, then we can get the fourier transform result.

Sampling Process​

Let's consider,

S(t)=∑n=−∞+∞δ(t−nT)S(t) = \sum_{n=-\infty}^{+\infty}\delta(t - nT)

And instead of x[n]x[n], we analyze the signal,

xs(t)=x(t)S(t)x_s(t) = x(t) S(t)

Because,

x[n]=∫nT−0(n+1)T−0xs(t)dtx[n] = \int_{nT-0}^{(n+1)T-0} x_s(t) \mathrm{d}t

xs(t)x_s(t) is exactly the distribution of a discrete signal x[n]x[n].

Suppose,

x(t)→FX(ω)x(t) \xrightarrow{\mathcal{F}} X(\omega)

According to fourier transform,

xs(t)→F12πX(ω)∗F(∑n=−∞∞δ(t−nT))x_s(t) \xrightarrow{\mathcal{F}} \frac{1}{2\pi} X(\omega) \ast \mathcal{F}(\sum_{n=-\infty}^{\infty}\delta(t - nT))

∑n=−∞∞δ(t−nT)\sum_{n=-\infty}^{\infty}\delta(t - nT) is periodical with TT, thus if we want its fourier transform, we should firstly calculate the fourier series coefficients,

Suppose, Ω=2πT\Omega = \frac{2\pi}{T},

ak=1T∫−0T−0(∑n=−∞∞δ(t−nT))e−jkωtdt=1T∫−0T−0δ(t)e−jkωtdt=1Ta_k = \frac{1}{T} \int_{-0}^{T-0} (\sum_{n=-\infty}^{\infty}\delta(t - nT)) e^{-j k \omega t} \mathrm{d}t \\ = \frac{1}{T} \int_{-0}^{T-0} \delta(t) e^{-j k \omega t} \mathrm{d}t = \frac{1}{T}

Previously, we had,

F(ω)=∑n=−∞n=+∞2πanδ(ω−Ωn)F(\omega) = \sum_{n=-\infty}^{n=+\infty} 2\pi a_n \delta(\omega - \Omega n)

Thus,

F(∑n=−∞∞δ(t−nT))=∑n=−∞n=+∞2πTδ(ω−Ωn)=Ω∑n=−∞n=+∞δ(ω−Ωn)\mathcal{F}(\sum_{n=-\infty}^{\infty}\delta(t - nT)) \\ = \sum_{n=-\infty}^{n=+\infty} \frac{2\pi}{T} \delta(\omega - \Omega n) \\ = \Omega \sum_{n=-\infty}^{n=+\infty} \delta(\omega - \Omega n) \\

Initially, we wanted,

xs(t)→F12πX(ω)∗F(∑n=−∞∞δ(t−nT))x_s(t) \xrightarrow{\mathcal{F}} \frac{1}{2\pi} X(\omega) \ast \mathcal{F}(\sum_{n=-\infty}^{\infty}\delta(t - nT)) F(xs(t))=12πX(ω)∗F(∑n=−∞∞δ(t−nT))=12πX(ω)∗(Ω∑n=−∞n=+∞δ(ω−Ωn))=1T(∑n=−∞n=+∞X(ω−Ωn))\mathcal{F}(x_s(t)) = \frac{1}{2\pi} X(\omega) \ast \mathcal{F}(\sum_{n=-\infty}^{\infty}\delta(t - nT)) \\ = \frac{1}{2\pi} X(\omega) \ast (\Omega \sum_{n=-\infty}^{n=+\infty} \delta(\omega - \Omega n)) \\ = \frac{1}{T} (\sum_{n=-\infty}^{n=+\infty} X(\omega - \Omega n))

Nyquist Theorem​

From the previous section, we know that the sampled signal in frequency domain is,

1T(∑n=−∞n=+∞X(ω−Ωn))\frac{1}{T} (\sum_{n=-\infty}^{n=+\infty} X(\omega - \Omega n))

If the signal x(t)x(t) is continuous (in real life, it usually is), there must exists a maximum frequency ωm\omega_m such that,

X(ω)=0∀ω>ωmX(\omega) = 0 \quad \forall \omega > \omega_m

Consider,

X(ω−Ωn)X(\omega - \Omega n)

This spans across Ωn−ωm\Omega n - \omega_m to Ωn+ωm\Omega n + \omega_m.

If we want no overlapping at all, so that we can decompose X(ω)X(\omega), and further, revert back to the original signal. For all nn, X(ω−Ωn)X(\omega - \Omega n) shouldn't overlap each other. That is to say,

ωm+Ωn<−ωm+Ω(n+1)\omega_m + \Omega n < -\omega_m + \Omega (n + 1) Ω>2ωm\Omega > 2 \omega_m

Ω>2ωm\Omega > 2 \omega_m is called the Nyquist theorem. It tells us that, if we want to flawlessly sample an analog signal, and the maximum frequency of the analog signal ωm\omega_m, our sampling frequency must be greater than 2ωm2 \omega_m.

Filter​

I'll continue the section on Filters, maintaining the same technical and educational style:

Filter​

Filtering is a process of modifying or enhancing specific frequency components of a signal. Filters can be used to remove unwanted frequencies, enhance certain frequency bands, or modify the phase characteristics of a signal.

Basic Filter Types​

There are four fundamental types of filters:

  1. Low-pass Filter: Allows frequencies below a cutoff frequency to pass while attenuating higher frequencies
  2. High-pass Filter: Allows frequencies above a cutoff frequency to pass while attenuating lower frequencies
  3. Band-pass Filter: Allows frequencies within a specific range to pass while attenuating others
  4. Band-stop Filter: Blocks frequencies within a specific range while allowing others to pass

Transfer Function​

The transfer function H(ω) of a filter describes how the filter modifies the amplitude and phase of input frequencies. For a linear time-invariant system, we know that,

Y(ω)=H(ω)X(ω)Y(\omega) = H(\omega)X(\omega)

Ideal Filters​

An ideal filter has a perfect rectangular frequency response. For example, an ideal low-pass filter has the transfer function:

H(ω)={1,∣ω∣≤ωc0,∣ω∣>ωcH(\omega) = \begin{cases} 1, & |\omega| \leq \omega_c \\ 0, & |\omega| > \omega_c \end{cases}

Where ωc\omega_c is the cutoff frequency.

However, ideal filters are not physically realizable because:

  1. They require infinite impulse response
  2. They are not causal (require future inputs)
  3. They have perfect cutoff characteristics which violate the uncertainty principle

Practical Filters​

Real filters approximate ideal characteristics with:

  1. Passband: Frequency range where signals pass through with minimal attenuation
  2. Stopband: Frequency range where signals are heavily attenuated
  3. Transition band: Region between passband and stopband
  4. Ripple: Small variations in gain within passband or stopband

We will introduce digital filters in detail in the signal processing part.