# orthfilt

Orthogonal wavelet filter set

## Syntax

```[Lo_D,Hi_D,Lo_R,Hi_R] = orthfilt(W) ```

## Description

`[Lo_D,Hi_D,Lo_R,Hi_R] = orthfilt(W)` computes the four filters associated with the scaling filter `W` corresponding to a wavelet:

 `Lo_D` Decomposition low-pass filter `Hi_D` Decomposition high-pass filter `Lo_R` Reconstruction low-pass filter `Hi_R` Reconstruction high-pass filter

For an orthogonal wavelet, in the multiresolution framework, we start with the scaling function ϕ and the wavelet function ψ. One of the fundamental relations is the twin-scale relation:

`$\frac{1}{2}\varphi \left(\frac{x}{2}\right)=\sum _{n\in Z}{w}_{n}\varphi \left(x-n\right)$`

All the filters used in `dwt` and `idwt` are intimately related to the sequence ${\left({w}_{n}\right)}_{n\in Z}$. Clearly if ϕ is compactly supported, the sequence (wn) is finite and can be viewed as a FIR filter. The scaling filter `W` is

• A low-pass FIR filter

• Of length 2N

• Of sum 1

• Of norm

For example, for the `db3` scaling filter,

```load db3 db3 db3 = 0.2352 0.5706 0.3252 -0.0955 -0.0604 0.0249 sum(db3) ans = 1.000 norm(db3) ans = 0.7071 ```

From filter `W`, we define four FIR filters, of length 2N and norm 1, organized as follows:

Filters

Low-Pass

High-Pass

Decomposition

`Lo_D``Hi_D`

Reconstruction

`Lo_R``Hi_R`

The four filters are computed using the following scheme:

where `qmf` is such that `Hi_R` and `Lo_R` are quadrature mirror filters (i.e., `Hi_R(k) = (-1)k````Lo_R(2N + 1 - k)```, for `k = 1, 2, Ä, 2N`), and where `wrev` flips the filter coefficients. So `Hi_D` and `Lo_D` are also quadrature mirror filters. The computation of these filters is performed using `orthfilt`.

## Examples

```% Load scaling filter. load db8; w = db8; subplot(421); stem(w); title('Original scaling filter'); % Compute the four filters. [Lo_D,Hi_D,Lo_R,Hi_R] = orthfilt(w); subplot(423); stem(Lo_D); title('Decomposition low-pass filter'); subplot(424); stem(Hi_D); title('Decomposition high-pass filter'); subplot(425); stem(Lo_R); title('Reconstruction low-pass filter'); subplot(426); stem(Hi_R); title('Reconstruction high-pass filter'); % Check for orthonormality. df = [Lo_D;Hi_D]; rf = [Lo_R;Hi_R]; id = df*df' id = 1.0000 0 0 1.0000 id = rf*rf' id = 1.0000 0 0 1.0000 % Check for orthogonality by dyadic translation, for example: df = [Lo_D 0 0;Hi_D 0 0]; dft = [0 0 Lo_D; 0 0 Hi_D]; zer = df*dft' zer = 1.0e-12 * -0.1883 0.0000 -0.0000 -0.1883 % High- and low-frequency illustration. fftld = fft(Lo_D); ffthd = fft(Hi_D); freq = [1:length(Lo_D)]/length(Lo_D); subplot(427); plot(freq,abs(fftld)); title('Transfer modulus: low-pass'); subplot(428); plot(freq,abs(ffthd)); title('Transfer modulus: high-pass') % Editing some graphical properties, % the following figure is generated. ```

## References

Daubechies, I. (1992), Ten lectures on wavelets, CBMS-NSF conference series in applied mathematics, SIAM Ed. pp. 117–119, 137, 152.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 2, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9519314765930176, "perplexity": 2680.9171546167745}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243991252.15/warc/CC-MAIN-20210512035557-20210512065557-00110.warc.gz"}