Engee documentation

envelope

The envelope of the signal.

Library

EngeeDSP

Syntax

Function call

  • yupper,ylower = envelope(x) — returns the upper and lower envelopes of the input sequence x as the amplitude of its analytical signal. Analytical signal x it is found using the discrete Fourier transform implemented in the function hilbert. The function first removes the average value x and adds it back after calculating the envelope. If x — the matrix, then envelope it acts independently on each column x.

  • yupper,ylower = envelope(x,fl,"analytic") — returns the envelope x, determined by the amplitude of its analytical signal. The analytical signal is calculated by filtering x using a Hilbert FIR filter of length fl. This syntax is used if only two arguments are specified.

  • yupper,ylower = envelope(x,wl,"rms") — returns the upper and lower RMS envelopes x. The envelopes are determined using a sliding window of length wl counts.

  • yupper,ylower = envelope(x,np,"peak") — returns the upper and lower peak envelopes x. The envelopes are determined using spline interpolation from local maxima separated by a minimum np by 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.

Типы данных

Float32, Float64

# 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 .

Типы данных

Float32, Float64

# wl — window length

+ a positive integer scalar

Details

The window length, set as a positive integer scalar.

Типы данных

Float32, Float64

# np — interval between peaks

+ a positive integer scalar

Details

The distance between the peaks, set as a positive integer scalar.

Типы данных

Float32, Float64

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)

envelope 1

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)

envelope 2

Let’s calculate the analytical envelope of the signal using 50-link Hilbert filter.

envelope(z, 50, "analytic")

envelope 3

Calculate the RMS envelope of the signal using 40-countdown sliding window. Let’s plot the result graph.

envelope(z, 40, "rms")

envelope 4

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")

envelope 5