[DSP] W05 - Ideal Filters
contents
- frequency classification
- ideal low pass filter
- derived ideal filters
- demodulation - frequency domain
- based on the frequencies that filters attenuate or boost, they maybe classified into different categories
- low pass filter:
- lets through only low frequencies
- kills high frequencies
- high pass filter:
- reverse operation of low pass filter
- bandpass filter:
- allow a middle band
- kills low end and high end
- ideal filers:
- theoretical best performance filters in each class of filters
- similar to an ideal engine
- cannot be implemented in real life
- a useful paradigm to understand limitations of real-world filters
frequency classification
- based on the shape of magnitude response of filters, they can be categorized into four types
- lowpass
- let low frequencies live and kill everything else
- highpass
- let high frequencies live and kill the rest
- bandpass
- let a band of central frequencies through and kill all else
- allpass
- let all frequencies through
- the magnitude curve is a constant through all frequencies
- lowpass
- this mirrors the time-domain filter classification
-
moving-average and leaky-integrator are lowpass filters
- filters can also be classified based on phase change characteristic
- linear phase
- non-linear phase
ideal low pass filter
fig: ideal lowpass filter magnitude spectrum
- \(\omega_c\): cutoff frequency
- frequencies above \(\omega_c\) are killed
- below it are let through filter
- the magnitude response transistions from \(1\) to \(0\) at \(\omega_c\)
- filter bandwidth: \(\omega_b = 2 \omega_c \)
ideally:
- lowpass filters are those which let all low band frequencies through
- low frequency signals are untouched
- completely attenuates high frequencies
- magnitude of spectrum is
- \(1\) for the low frequency pass band
- \(0\) for the high frequency stop band
- for this, magnitude response should be a real function
- zero phase filter
- no delay is added by the filter
formal low pass filter
\[ \begin{align}
H(e^{j \omega} ) & = \Bigg \{ \begin{matrix} 1 & \text{ for } \vert \omega \vert \leq \omega_c \\ 0 & \text{ otherwise } \end{matrix} & (2\pi\text{-periodicity implicit})\
\end{align}
\]
- perfectly flat passband
- infinite attenuation in the stopband
- zero-phase (no-delay)
impulse response of ideal lowpass filter
\[ \begin{align}
h[n] & = IDFT \{ H(e^{j\omega}) \} \
& = \frac{1}{2\pi} \int_{-\pi}^{\pi} H( e^{j\omega} ) e^{j \omega n} d \omega \
& = \frac{1}{2\pi} \int_{-\omega_c}^{\omega_c} e^{j \omega n} d \omega \
& = \frac{1}{\pi n} \frac{e^{j \omega_c n} - e^{-j \omega_c n}}{2j} \
& = \frac{\sin \omega_c n}{\pi n} \
\end{align}
\]
fig: ideal lowpass filter impulse response
- response has a nice oscillatory shape
- response is an infinite support impulse response
- infinite both to the right and left
- no matter how the convolution is computed, there will always be an infinite number of operations to compute
- this is the ideal behavior and causes issue in real world filter implementation
- cannot compute the output in a finite amount of time
- this behavior is approximated to build filters that respond in finite time
- approximation for computable, usable, real-world filters
- the impulse response decays very slowly over time; i.e. @ rate \(\frac{1}{n}\)
- a lot of samples are needed for a good approximation
dedicated filter response functions
- the sinc-rect pair:
\[ \begin{align}
rect(x) & = \Bigg \{ \begin{matrix} 1 & \vert x \vert \leq \frac{1}{2} \\ 0 & \vert x \vert > \frac{1}{2} \end{matrix} \
\
sinc(x) & = \Bigg \{ \begin{matrix} \frac{\sin (\pi x)}{\pi x} & x \neq 0 \\ 1 & x = 0 \end{matrix} \
sinc(x) & = 0 \text{ when } x \text{ is a non-zero integer } \
\text{ sinc } & \text{ function here is normalized } \
\end{align}
\]
frequency response of lowpass filter
- frequency response in terms of a \( rect \) function of ideal lowpass filter is
\[ rect(\frac{\omega}{2\omega_c})
\]
- \( \omega_c \): cutoff frequency of lowpass filter
impulse response of lowpass filter
- impulse response in terms of a \( sinc \) function of ideal lowpass filter is \[ \frac{\omega_c}{\pi} sinc(\frac{\omega_c}{\pi}n) \]
relationship between lowpass filter impulse and frequency response
fig: ideal lowpass filter frequency (top) and impulse response (bottom) relationship
- here:
- \( \omega_c = \frac{\pi}{3} \)
quirks of the ideal lowpass filter
- the \( sinc \) function is not absolutely summable
- consequently, the ideal lowpass is not BIBO stable
- example:
\[ \begin{align}
\omega_c & = \frac{\pi}{3} \
h[n] & = \bigg ( \frac{1}{3} \bigg ) sinc \bigg (\frac{n}{3} \bigg ) \end{align} \] -
consider a bounded input signal for ideal filter \[ x[n] = sign \bigg \{ sinc \bigg ( -\frac{n}{3} \bigg ) \bigg \} \]
- to compute output of ideal filter, convolve this input and impulse response of ideal lowpass filter
\[ \begin{align}
y[0] & = (x*h)[0] \
& = \frac{1}{3} \sum_{k=-\infty}^{\infty} \Bigg \vert sinc \bigg ( \frac{k}{3} \bigg ) \Bigg \vert \
& = \infty \end{align}
\]- the convolution is divergent computation
-
however, the divergence is fairly slow
fig: slow divergence of the ideal lowpass filter convolution with input \(x[n]\)
derived ideal filters
- a series of other ideal filters can be derived from the ideal lowpass filter
ideal highpass filter
fig: ideal highpass filter magnitude spectrum
formal ideal highpass filter
\[ \begin{align}
H_{hp}(e^{j\omega}) & = \Bigg \{ \begin{matrix} 1 & \text{ for } \pi \leq \vert \omega \vert \leq \omega_c \\ 0 & \text{ otherwise } \end{matrix} & (2\pi\text{-periodicity implicit}) \
\
H_{hp} (e^{j\omega}) & = 1 - H_{lp} (e^{j\omega}) & \text{(highpass-lowpass relationship in frequency)} \
\
h_{hp}[n] & = \delta[n] - \frac{\omega_c}{\pi}sinc\bigg ( \frac{\omega_c}{\pi} \bigg ) & \text{(highpass-lowpass relationship in time)} \
\end{align}
\]
- it can be seen that the ideal highpass is a complementary filter of an ideal lowpass filter in the frequency domain
ideal bandpass filter
fig: ideal bandpass filter magnitude spectrum
- this is derived from the ideal lowpass filter by modulating them with a cosine wave
fig: ideal lowpass filter modulated with cosine wave to obtain ideal bandpass
formal ideal bandpass filter
\[ \begin{align}
H_{bp}(e^{j\omega}) & = \Bigg \{ \begin{matrix} 1 & \text{ for } \vert \omega \pm \omega_0 \vert \leq \omega_c \\ 0 & \text{ otherwise } \end{matrix} & (2\pi\text{-periodicity implicit}) \
\
h_{bp}[n] & = 2 \cos(\omega_0 n) \frac{\omega_c}{\pi} sinc \bigg ( \frac{\omega_c}{\pi} n \bigg ) & \text{(highpass-lowpass relationship in time)} \
\end{align}
\]
demodulation - frequency domain
- time domain demodulation concepts
- apply sinusoidal modulation to \(x[n]\) \[ y[n] = x[n] \cos \omega_0 n \]
- demodulate by multiplication with carrier \[ x\prime[n] = y[n]\cos \omega_0 n \]
- demodulated signal contains unwanted high frequency components
- these unwanted high frequency components are filtered out with a lowpass filter
filtering a demodulated signal
-
consider a signal in the frequency domain \( X(e^{j \omega} ) \)
fig: signal in frequency domain \( X(e^{j \omega}) \)
-
this is then modulated to get two half amplitudes at the modulation frequency
fig: modulate \( X(e^{j \omega}) \) signal in frequency domain
-
this has a periodicity of \(2\pi\) in the frequency domain
fig: extended bounds to reveal periodicity of modulated signal \( X(e^{j \omega}) \)
-
this is then multiplied by \(\cos\omega_0 \) to demodulate, which yields two components
fig: one copy of the demodulated signal
fig: second copy of the demodulated signal
-
to get the full demodulated signal, the two components are summed together to get
fig: sum of the components of the demodulated signal
-
examining a single period of this summation in \( [-\pi,\pi] \)
fig: single period (between \( [-\pi,\pi] \)) of the summed signal
- here, spurious high frequency components near \(\pi \) has to be filtered out
-
this is achieved using a lowpass filter
fig: low pass filter applied to demodulated signal
-
the original signal is obtained as the output of the filter
fig: original signal obtained from filtering demodulated signal