390 likes | 608 Views
Lecture 13: Multirate processing and wavelets fundamentals. Instructor: Dr. Gleb V. Tcheslavski Contact: gleb@ee.lamar.edu Office Hours: Room 2030 Class web site: http://ee.lamar.edu/gleb/dsp/index.htm. Filter banks.
E N D
Lecture 13: Multirate processing and wavelets fundamentals Instructor: Dr. Gleb V. Tcheslavski Contact:gleb@ee.lamar.edu Office Hours: Room 2030 Class web site:http://ee.lamar.edu/gleb/dsp/index.htm
Filter banks A digital filter bank (FB) is a set of digital bandpass (usually) filters with either a common input (analysis FB) or a summed output (synthesis FB). Analysis FB separates the analyzed signal xn into a set of M spectral bands. A uniform filter bank – equal passband widths Let a causal IIR LPF with a real impulse response h0,n have a transfer function: (13.2.1) Assume that the filter has its passband and stopband frequencies around /M as indicated in the picture, where M is an arbitrary integer.
Filter banks Let us consider next the casual filter with the impulse response obtained by modulating h0,n with the exponent: (13.3.1) The corresponding transfer function is (13.3.2)
Filter banks The frequency response of the filter is (13.4.1) Therefore, the frequency response is obtained by shifting the frequency response of the LPF “to the right” by the amount 2k/M as shown. By designing M-1 filters obtained by modulating (shifting) the low pass prototype, we get M-1 uniformly shifted (in frequency) versions of the prototype H0. These M filters can be arranged into a uniform filter bank. Note: a DFT algorithm can be viewed in terms of a uniform filter bank.
Filter banks Two-channel Quadrature Mirror (QM) filter bank In many applications, a discrete-time signal xn is first split into a number of subband signals {vk,n} by an analysis FB; the subband signals are then (somehow) processed and finally combined by a synthesis FB to form an output yn. If the bandwidths of the subband signals are (chosen to be) much smaller than the bandwidth of the original signal, subband signals can be downsampled (sampled at a lower sampling rate) before the processing. This allows more efficient processing. Downsampling by the factor Q Qp p N ’N = N/Q Qs s
Filter banks After processing, these signals are upsampled and then combined by the synthesis bank into the output (higher rate) signal. The structure performing such operations is called a quadrature-mirror (QM) filter bank. Assuming no processing, a two-channel QM FB is: Note that for two channels, Q = 2. Analyzing this structure: (13.6.1) Downsampling and upsampling can be represented as: (13.6.2) (13.6.3) Here, k = 0,1.
Filter banks The last equation can be rewritten as: (13.7.1) Therefore, the output of the FB is: (13.7.2) Which can be rewritten as: (13.7.3) where (13.7.4) is the distortion transfer function (13.7.5) is the aliasing term.
Filter banks In general, QM FB are Linear Time-Varying systems. However, by selecting the analysis and synthesis filters such that aliasing effects are canceled, QM FB can be made an LTI system. Aliasing cancellation condition (13.8.1) Will hold when, for instance: (13.8.2) (13.8.3) In this situation: (13.8.4) If T(z) is an allpass filter, i.e. |T(z)| = c 0 (13.8.5) Therefore, amplitude distortions are possible. We can also show that no phase distortions will be introduced if T(z) has a linear phase.
Filter banks Perfect reconstruction condition An alias-free QM FB having no amplitude and phase distortions is called a perfect reconstruction QM FB. In this case: (13.9.1) which implies that: (13.9.2) Therefore: (13.9.3) and (13.9.4) Indicating that the reconstructed output is a delayed by l samples replica of the input.
Filter banks (QM FB example) Let us consider a two-channel QM FB with the analysis filters: (13.10.1) and the synthesis filters: (13.10.2) Therefore: (13.10.3) the two-channel QM FB is an alias-free system.
Filter banks (QM FB example) On the other hand: (13.11.1) Therefore, this FB is a perfect reconstruction system. In a time domain, the outputs of the analysis filters are: (13.11.2) Note: the scaling factor preserves energy. In a matrix form: (13.11.3) (13.11.4) where is the Haar transform matrix (13.11.5) The reconstruction:
Filter banks From alias-free and perfect reconstruction requirements: (13.12.1) Therefore: (13.12.2) (13.12.3) For a real filter: (13.12.4) Indicating that if h0 is a LPF, than h1 is a HPF; in fact, its mirror image with respect to the /2 – the quadrature frequency. Therefore, two analysis filters and two synthesis filters in the QM FB are essentially determined from one prototype transfer function. QM FB can be build from FIR or IIR filters.
Filter banks Orthogonal QM FB (13.13.1) Implying that if H0(z) is a causal FIR filter, three other filters must be causal FIR filters. Also, if H0(z) is a LPF, than H1(z) is a HPF. Third-order FIR filters forming analysis QM FB 7-order FIR filters forming analysis QM FB Biorthogonal QM FB – QM FB obtained for the perfect reconstruction condition and represented by nonorthogonal transfer matrices (and filters).
Filter banks L-channel QM FB is a generalization of a two-channel QM FB. (13.14.1) (13.14.2) (13.14.3)
Filter banks The vector of downsampled subband signals of an L-channel QM FB can be expressed in the matrix form as: (13.15.1) Where: (13.15.2) The input is: (13.15.3) The analysis FB modulation matrix: (13.15.4)
Filter banks The output of the QM FB is (13.16.1) which in the matrix form is (13.16.2) where the output is: (13.16.3) The synthesis FB modulation matrix: (13.16.4) The transfer matrix: (13.16.5)
Filter banks From the alias cancellation condition, the set of synthesis filters can be determined: (13.17.1) Where (13.17.2) and the distortion transfer function is: (13.17.3) If T(z) has a constant magnitude, the QM FB is magnitude-preserving. If T(z) has a linear phase, the QM FB has no phase distortion. If T(z) is a pure delay, it is a perfect reconstruction QM FB i.e.: (13.17.4) Three-channel FIR QM FB
Filter banks Multilevel FB A multichannel FB can be replaced by a multilevel FB called a tree-structured FB. Analysis and synthesis filters can be related between these two structures: (13.18.1)
Filter banks FB considered so far have equal passband widths (full tree FB). Sometimes, it is beneficial to make FB with unequal passband widths (partial tree FB). (13.19.1) Corresponding filters’ magnitude responses
Discrete Wavelet Transform (DWT) It turns out that perfect reconstruction octave band QM FB can be represented by a certain discrete wavelet transform (DWT). For this binary tree, there are two “parent” analysis FIR filters: H0(z) – LPF, and H1(z) – HPF. Which can also be represented by the equivalent structure where 0 k L and: (13.20.1) (13.20.2)
Discrete Wavelet Transform (DWT) Assuming that the input xn is a sequence of length M, the outputs will have the following approximate lengths and bandwidths: The downsampling leads to: downsampling by 2 In the wavelet decomposition, u0,n represents the “finest details” (the highest frequency components) of the input xn, while u4,n is its “coarsest” representation (its lowest frequency components).
Discrete Wavelet Transform (DWT) The process of generating the set of output subsequences uk,n where 0 k L from the finite-length input xn by the structure that can be represented as an L-level octave-band perfect reconstruction QM FB is called the discrete wavelet transform (DWT). The analysis sequences for the equivalent representation are: (13.22.1) or in the time domain: (13.22.2) The subband sequences: (13.22.3)
Discrete Wavelet Transform (DWT) The process of reconstruction (synthesis) of the output sequence yn – which is a replica of the input xn – from the subband sequences un can be accomplished by the L-level octave-band perfect reconstruction QM FB: Which has an equivalent structure, where (13.23.1) (13.23.2)
Discrete Wavelet Transform (DWT) Therefore, the output will be: (13.24.1) or, in the time domain: (13.24.2) Using the notation: (13.24.3) the output will be: (13.24.4) Which is the inverse DWT. uk,m are the wavelet coefficients of xm with respect to the basis function k,m,n
Discrete Wavelet Transform (DWT) Biorthogonal wavelets The biorthogonal wavelets are generated from biorthogonal octave-band perfect reconstruction QM FB. The simplest examples are Haar wavelets:
Discrete Wavelet Transform (DWT) Orthogonal wavelets The orthogonal wavelets are generated from orthogonal octave-band perfect reconstruction QM FB. One example would be the four-level Daubechies 4/4-tap wavelet:
On the Uncertainty Principle Observations: • A short-duration (“narrow”) waveform (signal) yields a long-duration (“wide”) spectrum. • A narrow spectrum yields a long-duration (“wide”) waveform. • Waveform and spectrum cannot be made arbitrary small simultaneously. These observations are explained by the Uncertainty Principle: (13.27.1) “=“ for Gaussian signals Here t2 is a variance in time – a measure of the duration of the signal; 2 is a variance in frequency – a measure of the bandwidth of the signal (most of the signal energy will be concentrated in 2B = 2 rad/s. Consequence: the same signal cannot have both: fine resolution in time and fine resolution in frequency.
Non-stationary… So what? Signals Estimated spectra Case 1: Stationary: S1 + S2 Case 2: Non – stationary: S1 S2
Non-stationary… So what? Ideally: from “Modern DSP” by Cristi
Short-Time Fourier Transform* The Short-Time Fourier Transform (STFT) of a windowed signal with the window centered at t is: (13.30.1) where w(t) is a low pass analysis window function, and (typically): (13.30.2) The inverse STFT is defined as: (13.30.3) Given that: (13.30.4) * - based on the lecture notes for “Advanced topics in Signal Processing” by Dr. Ben H. Jansen, UH, 2006
Short-Time Fourier Transform A natural choice for the synthesis window (t), is to make it equal to the analysis window w(t). • STFT is a linear time-frequency representation; • STFT depends on the choice of w(t); • STFT is generally complex. • Defining a spectrogram as: which is a representation of the energy distribution in the time-frequency plane, i.e. a quadratic time-frequency representation. We can show that: (13.31.1) (13.31.2) (13.31.3)
Short-Time Fourier Transform We can notice that: (13.32.1) Therefore, the STFT can be viewed as a filtering operation by a LPF with impulse response w*(-t) as shown in (A): Also: (13.32.2) Therefore, the STFT can also be viewed as a filtering operation with a BPF with impulse response ejt w*(-t) as shown in (B):
Discrete STFT Define a sampled version of STFT as: (13.33.1) Therefore, the DSTFT: (13.33.2) The IDSTFT: (13.33.3) (13.33.4) or: The IDSTFT holds if: (13.33.5)
STFT: Gabor expansion (transform) Note that (13.33.3) can be viewed as a series expansion of a 1-D signal in terms of 2-D time-frequency functions. The Gabor expansion is defined as: (13.34.1) where g(t) is a 1-D function: (13.34.2) If the basis functions gn,k(t) are selected such that they are well localized in time and well concentrated in frequency, then the Gabor coefficients Gx(n,k) will reflect the signal’s time-frequency content around (nT, kF). Gabor proposed (13.34.3) which is a Gaussian signal with The Gabor expansion is always possible if FT 1, but the Gabor coefficients are not unique (the DSTFT is just one possible solution). Note: FT of a Gaussian is a Gaussian.
Time-Frequency resolution of STFT • Using the filter representation of STFT, we observe: • All the BPFs have the same duration impulse response, hence the time resolution of the STFT is the same at all frequencies and is proportional to window length. • All the BPFs have the same bandwidth, hence the frequency resolution is the same at all times and is inversely proportional to window length. 1/T T Although, according to the uncertainty principle, , t could be made large for low frequency components and small for high frequency components… leading to corresponding changes in the frequency resolution.
Continuous Wavelet Transform (CWT) Rather than using constant bandwidth BPFs (as STFT does), we use constant Q BPFs, where center frequency (13.36.1) bandwidth In other words, the impulse response will decrease in duration (and the bandwidth increase) as center frequency increases: therefore, use scaled versions of w*(-t). For simplification, we will use (as window functions) the scaled versions of the same prototype (t): (13.36.2) Here (t)is the analyzing (mother) wavelet function: a bandpass function centered around c.
Continuous Wavelet Transform (CWT) The CWT is defined as: (13.37.1) Using b = c/, the CWT can also be defined as a time-scale representation: (13.37.2) The energy distribution in the time-domain is evaluated by the scalogram:
STFT vs. CWT STFT estimates the similarity (cross-correlation) between x(t) and g,(t): (13.38.1) Where: (13.38.2) CWT estimates the similarity (cross-correlation) between x(t) and hb,(t): (13.38.1) Where: (13.38.2)
STFT vs. CWT Same time and frequency resolutions STFT: FT = const, F = const, T = const CWT: FT = const, F const, T const from “Modern DSP” by Cristi