ihaart
Inverse 1-D Haar wavelet transform
Description
specifies
how the inverse 1-D Haar transform handles integer-valued data, using
any of the previous syntaxes.xrec
= ihaart(___,integerflag
)
Examples
Obtain the Haar and inverse Haar transforms of noisy data.
Load the noisy data signal
load noisdopp;
Obtain the Haar transform of the noisy signal.
[a,d] = haart(noisdopp);
Reconstruct the data by inverting the Haar transform.
xrec = ihaart(a,d);
Compare the original and reconstructed data by determining the maximum difference between them. The difference is essentially zero, which indicates a near-perfect reconstruction.
max(abs(xrec-noisdopp'))
ans = 4.4409e-15
Obtain the Haar transform and inverse Haar transform of ECG heart rate data.
Load and plot the ECG data.
load BabyECGData; plot(times,HR) xlabel('Hours') ylabel('Heart Rate') title('ECG Data')
Obtain the Haar transform and inverse Haar transform. Compare the reconstructed data at level 4 to the original data.
[a,d] = haart(HR); HaarHR = ihaart(a,d,4); figure plot(times,HaarHR) xlabel('Hours') ylabel('Heart Rate') title('Haar Approximation of Heart Rate')
Obtain the Haar and inverse Haar transforms for a series of random integers.
Create the series.
x = randi(10,100,1);
Obtain the Haar and inverse Haar transforms.
[a,d] = haart(x,'integer'); xrec = ihaart(a,d,'integer');
Plot and compare the original and reconstructed data.
subplot(2,1,1) stem(x); title('Original Data') subplot(2,1,2) stem(xrec) title('Reconstructed Integer-to-Integer Data')
Determine the maximum difference between the original data values and the reconstructed values. The difference is zero, which indicates perfect reconstruction.
max(abs(x(:)-xrec(:)))
ans = 0
Input Arguments
Approximation coefficients, specified as a scalar, vector, or
matrix of coefficients, depending on the level to which the Haar transform
was calculated. a
is an output from the haart
function.
Approximation, or scaling, coefficients are a lowpass representation of the input. At each level the approximation coefficients are divided into coarser approximation and detail coefficients.
Data Types: single
| double
Complex Number Support: Yes
Detail coefficients, specified as a scalar, vector, matrix, or cell array of wavelet coefficients. d
is an output from the haart
function. The number of detail coefficients depends on the selected level and the length of the input. If d
is a cell array, the elements of d
are ordered from finest to coarsest resolution.
If d
is a cell array, it can contain scalars, vectors, or matrices. The level of the Haar transform equals the number of elements in d
.
If d
is a vector or matrix, the Haar transform was computed only down to one level coarser in resolution.
If a
and the elements of d
are
vectors, xrec
is a vector. If a
and
the elements of d
are matrices, xrec
is
a matrix, where each column is the inverse Haar transform of the corresponding
columns in a
and d
.
Data Types: single
| double
Complex Number Support: Yes
Integer-valued data handling, specified as either 'noninteger'
or
'integer'
. 'noninteger'
does not
preserve integer-valued data, and 'integer'
preserves it.
The 'integer'
option applies only if all elements of
a
and d
are integer-valued.
You must have used 'integer'
with
haart
to obtain integer-valued
a
and d
inputs. The inverse
1-D Haar transform algorithm, however, uses floating-point
arithmetic.
Output Arguments
Inverse 1-D Haar wavelet transform, returned as a vector or
matrix. If a
and the elements of d
are
vectors, xrec
is a vector. If a
and
the elements of d
are matrices, xrec
is
a matrix, where each column is the inverse 1-D Haar transform of the
corresponding columns in a
and d
.
Data Types: single
| double
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
Version History
Introduced in R2016b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)