Engee documentation

Window Function

Calculation and application of a window function to an input signal.

blockType: WindowFunction

Path in the library:

/Signal Operations/Signal Operations/Window Function

Description

Block Window Function It has three operating modes that allow you to apply a window function, calculate a window function, or calculate and apply a window function to an input signal. You can select the mode using the parameter Operation. In each mode, the block first creates a vector of the window function. by selecting the window function specified in the parameter Window type.

Ports

Input

# IN_1 — The input signal
vector | the matrix | multidimensional array

Details

An input signal specified as a vector, matrix, or multidimensional array.

If the input signal is represented by fixed-point data, it can only be signed.

This port is enabled only if for the parameter Operation the value is set Apply window to input or Generate and apply window.

This port has no name if for the parameter Operation the value is set Apply window to input.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Complex numbers support

Yes

Output

# OUT_1 — The output signal
vector | the matrix | multidimensional array

Details

The output signal returned as a vector, matrix, or multidimensional array.

This port is enabled only if for the parameter Operation the value is set Apply window to input or Generate and apply window.

This port has no name if for the parameter Operation the value is set Apply window to input.

The output signal has the same dimensions as the input signal.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Complex numbers support

No

# Win — the output signal of the window function
vector

Details

The output of the window function, returned as a vector.

If for the parameter Operation the value is set Apply window to input or Generate and apply window, the vector of the window function has a length equal to the number of lines in the input signal. If for the parameter Operation the value is set Generate window, the length of the window function vector is determined by the parameter Window length.

Dependencies

To use this port, set the parameter Operation value selected Generate window or Generate and apply window.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Complex numbers support

No

Parameters

Main

# Operation — Operating modes
Apply window to input | Generate window | Generate and apply window

Details

Block Window Function It has three operating modes, which can be selected using the parameter Operation. In each mode, the block first creates a vector of the window function. by selecting the window function specified in the parameter Window type, in discrete points. The operating modes are as follows:

  • Apply window to input — in this mode, the block calculates the vector of the window function lengths and applies it to the input signal. The output signal it always has the same dimension as the input one.

    If the input is a matrix of size on , the window function is multiplied element - wise by each of channels of the input matrix .

    The window function is always applied to the first dimension.:

    An undirected length vector It is considered as a vector of size on .

  • Generate window — in this mode, the block generates an undirected vector of the window function lengths , set by the parameter Window length. The input port for this mode is disabled.

  • Generate and apply window — in this mode, the block generates a vector of the window function lengths and applies it to the input signal. The unit has two outputs:

    • Out port — the output port to which the block outputs the multiplication result. , has the same dimension as the input one.

    • Port Win is the output port to which the block outputs the vector of the window function. by dimension on .

      If the input is a matrix of size on , the window function is multiplied element - wise by each of channels of the input matrix .

      The window function is always applied to the first dimension.:

      Input one-dimensional length vector It is considered as a vector of size on .

Values

Apply window to input | Generate window | Generate and apply window

Default value

Apply window to input

Program usage name

Operation

Tunable

No

Evaluatable

No

# Window type — type of window function
Bartlett | Blackman | Boxcar | Chebyshev | Hamming | Hann | Kaiser | Triang

Details

The table below lists the available types of window functions.

Type of window function Description

Bartlett

Computes the Bartlett window function.

w = bartlett(M)

Blackman

Computes the Blackman window function.

w = blackman(M)

Boxcar

Calculates a rectangular window function.

w = rectwin(M)

Chebyshev

Calculates the Chebyshev window function with stop band pulsation R.

w = chebwin(M,R)

Hamming

Calculates the Hamming window function.

w = hamming(M)

Hann

Computes the Hanna window function (also known as the Hanning window function).

w = hann(M)

Kaiser

Calculates the Kaiser window function with the Kaiser parameter beta.

w = kaiser(M,beta)

Triang

Calculates a triangular window function.

w = triang(M)
Values

Bartlett | Blackman | Boxcar | Chebyshev | Hamming | Hann | Kaiser | Triang

Default value

Hamming

Program usage name

WindowType

Tunable

No

Evaluatable

No

# Sample mode — sampling mode
Continuous | Discrete

Details

Sampling mode for the block, continuous or discrete when it is in the mode Generate window. In the modes Apply window to input or Generate and apply window The block inherits the sampling mode from its control block.

Dependencies

To use this parameter, set for the parameter Operation meaning Generate window.

Values

Continuous | Discrete

Default value

Continuous

Program usage name

SampleMode

Tunable

No

Evaluatable

No

# Sample Time — the interval between the calculation steps
SampleTime (real number / vector of two real numbers)

Details

Specify the interval between the calculation steps for the block, if for the parameter Operation value selected Generate window, and for Sample mode the value is set Discrete.

If for the parameter Operation the value is set Apply window to input or Generate and apply window, the block inherits the interval between calculation steps from its control block.

Dependencies

To use this parameter, set for the parameter Sample mode meaning Discrete.

Default value

1

Program usage name

SampleTime

Tunable

No

Evaluatable

Yes

# Window length — length of the window function
Int64 integer

Details

Specify the length of the window function to be applied.

Dependencies

To use this parameter, set for the parameter Operation meaning Generate window. Otherwise, the length of the window function vector is calculated according to the length of the first measurement of the input signal.

Default value

64

Program usage name

WindowLength

Tunable

No

Evaluatable

Yes

# Stopband attenuation in dB — fading of the stop band
Real number

Details

Specify the level of relaxation of the stop strip in dB.

Dependencies

To use this parameter, set for the parameter Window type meaning Chebyshev.

Default value

50

Program usage name

StopbandAttenuationInDB

Tunable

No

Evaluatable

Yes

# Beta — parameter the Kaiser window function
Real number

Details

Specify the parameter the Kaiser window function. Increase expands the baseband and reduces the amplitude of the side lobes of the window function in its frequency response.

Dependencies

To use this parameter, set for the parameter Window type meaning Kaiser.

Default value

10

Program usage name

Beta

Tunable

No

Evaluatable

Yes

# Sampling — sample type
Symmetric | Periodic

Details

The type of sample for generalized cosine window functions.

For generalized cosine window functions (Blackman, Hamming and Hann) parameter Sampling defines how the samples of the window function will be calculated — periodically or symmetrically. For example, if the parameter Sampling set to the value Symmetric, the window Hamming function of length calculated as follows:

w = hamming(M) # Симметричная (апериодическая) оконная функция

If for the parameter Sampling value selected Periodic, then the same window function is calculated as follows:

w = hamming(M+1) # Периодическая (асимметричная) оконная функция
w = w(1:M)

Dependencies

To use this parameter, set for the parameter Window type meaning Blackman, Hamming or Hann.

Values

Symmetric | Periodic

Default value

Symmetric

Program usage name

Sampling

Tunable

No

Evaluatable

No