envelope
The envelope of the signal.
| Library |
|
Syntax
Function call
-
yupper,ylower = envelope(x)— returns the upper and lower envelopes of the input sequencexas the amplitude of its analytical signal. Analytical signalxit is found using the discrete Fourier transform implemented in the functionhilbert. The function first removes the average valuexand adds it back after calculating the envelope. Ifx— the matrix, thenenvelopeit acts independently on each columnx.
-
yupper,ylower = envelope(x,wl,"rms")— returns the upper and lower RMS envelopesx. The envelopes are determined using a sliding window of lengthwlcounts.
-
yupper,ylower = envelope(x,np,"peak")— returns the upper and lower peak envelopesx. The envelopes are determined using spline interpolation from local maxima separated by a minimumnpby counting down.
-
envelope(___)— plots the signal and its upper and lower envelopes without output arguments. This syntax accepts any input arguments from the previous syntaxes.
Arguments
Input arguments
# x is the input sequence
+
vector | the matrix
Details
An input sequence specified as a vector or matrix. If x — vector, it is considered as one channel. If x — the matrix, then the function envelope calculates envelope estimates independently for each column. All the elements x they must be finite.
| Типы данных |
|
# fl is the length of the Hilbert filter
+
a positive integer scalar
Details
The length of the Hilbert filter, set as a positive integer scalar. The filter is created by superimposing an ideal filter window with a rectangular amplitude characteristic with a Kaiser window of length fl and the form parameter .
| Типы данных |
|
# wl — window length
+
a positive integer scalar
Details
The window length, set as a positive integer scalar.
| Типы данных |
|
# np — interval between peaks
+
a positive integer scalar
Details
The distance between the peaks, set as a positive integer scalar.
| Типы данных |
|
Name-value input arguments
# out — type of output data
+
:plot (by default) | :data
Details
Type of output data:
-
:plot— the function returns a graph. -
:data— the function returns data.
Output arguments
# yupper, ylower — upper and lower envelopes of the signal
+
vectors | matrices
Details
The upper and lower envelopes of the signal, returned as vectors or matrices.
Examples
The envelope of an asymmetric sequence
Details
Let’s create and display a signal resembling the initial detection of a light pulse propagating through a dispersive medium.
t = 0.5:-1/100:-2.49
z = airy.(t*10) .* exp.(-t.^2)
plot(z)
Let’s define the envelopes of the sequence using the magnitude of its analytical signal. Let’s plot the envelopes.
import EngeeDSP.Functions: envelope
envelope(z)
Let’s calculate the analytical envelope of the signal using 50-link Hilbert filter.
envelope(z, 50, "analytic")
Calculate the RMS envelope of the signal using 40-countdown sliding window. Let’s plot the result graph.
envelope(z, 40, "rms")
Let’s define the envelopes of the peaks. We use spline interpolation with "not-a-knot" boundary conditions for local maxima separated from each other by at least 10 counts.
envelope(z, 10, "peak")