ShortTimeBandPower - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


SignalProcessing

  

ShortTimeBandPower

  

calculate the short-time band power of a 1-D signal

  

ShortTimeMeanFrequency

  

calculate the short-time mean frequency of a 1-D signal

  

ShortTimeSpectralEntropy

  

calculate the short-time spectral entropy of a 1-D signal

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

ShortTimeBandPower( signal, options )

ShortTimeMeanFrequency( signal, options )

ShortTimeSpectralEntropy( signal, options )

Parameters

signal

-

1-D rtable or list of data.

Options

• 

samplerate: Positive numeric value for the sampling rate. The default is 1.0.

• 

overlapsize: Non-negative integer which specifies the target minimum overlap size of the segments. The default is 0.

• 

segmentsize: Positive integer for the size of the overlapping segments. The default is the largest power of 2 that is not larger than the size of signal.

• 

fftnormalization: One of none, symmetric, or full, indicates the normalization to be applied when using the Fast Fourier Transform (FFT). The default is symmetric.

• 

temperendpoints: Either true or false, specifies whether the short-time power spectra are to be tempered at the endpoints. The default is false.

• 

window: Either a list, name, or string, specifies the windowing command to be applied to the overlapping segments. The default is "none" (for no windowing to be applied). If a list is passed, the first element provides the name of the windowing command, and any remaining terms are passed as options to the command.

• 

windownormalization: Either true or false, indicates if the windowing function is to be normalized. The default is true.

• 

frequencyunit: Unit which specifies the unit of frequency. The default is Unit(Hz). Either of the forms algebraic or Unit(algebraic) is accepted, and the unit must be convertible to a valid unit of frequency.

• 

timeunit: Unit which specifies the unit of time. The default is Unit(s). Either of the forms algebraic or Unit(algebraic) is accepted, and the unit must be convertible to a valid unit of time.

• 

frequencyrange: (optional) Range of numeric frequency values used to filter (i.e. band-limit) the data. If omitted, all frequencies are considered.

• 

method: (optional) The method of numerical integration to be used to find band power. The options are leftendpoint, rightendpoint, simpson, and trapezoid. The default is trapezoid, which is equivalent to finding the area under the linear interpolation through all the points.

• 

bandpowerplotoptions: (optional) List of additional plot options to be passed when creating the band power plot. The default is [].

• 

meanfrequencyplotoptions: (optional) List of additional plot options to be passed when creating the mean frequency plot. The default is [].

• 

entropyplotoptions: (optional) List of additional plot options to be passed when creating the entropy plot. The default is [].

• 

output: (optional) The type of output. The supported options are:

– 

bandpower: Returns a Vector of float[8] datatype containing the Short-Time Band Power (STBP). This is the default for ShortTimeBandPower.

– 

bandpowerplot: Returns a plot of the bandpower Vector versus time.

– 

entropy: Returns a Vector of float[8] datatype containing the Short-Time Spectral Entropy (STSE). This is the default for ShortTimeSpectralEntropy.

– 

entropyplot: Returns a plot of the entropy Vector versus time.

– 

meanfrequency: Returns a Vector of float[8] datatype containing the Short-Time Mean Frequency (STMF). This is the default for ShortTimeMeanFrequency.

– 

meanfrequencyplot: Returns a plot of the meanfrequency Vector versus time.

– 

signal: Returns a Matrix of float[8] or complex[8] datatype containing the signal, with each column representing a short-time segment.

– 

stps: Returns a Matrix of float[8] datatype containing the Short-Time Power Spectrum (STPS).

– 

frequencies: Returns a Vector, of float[8] datatype and length the same as signal, containing the frequencies.

– 

times: Returns a Vector, of float[8] datatype and length the same as signal, containing the times.

– 

record: Returns a record with the previous options.

– 

list of any of the above options: Returns an expression sequence with the corresponding outputs, in the same order.

Description

• 

The ShortTimeBandPower, ShortTimeMeanFrequency, and ShortTimeSpectralEntropy commands take a 1-D rtable or list signal, and first compute the Short-Time Power Spectrum (STPS) Matrix P using the ShortTimeFourierTransform command and the provided options. The Short-Time Band Power is the Vector B having elements Bj calculated as the band power of column j of P using the BandPower command and the provided options, including frequencyrange. The Short-Time Mean Frequency and Short-Time Spectral Entropy are defined in a similar way, and use, respectively, the MeanFrequency and SpectralEntropy commands.

• 

The values of a=overlapsize, b=segmentsize, and n=numelemssignal must satisfy 2n, 0a, 2b, a<b, and bn.

• 

Maple will attempt to coerce the provided signal to a 1-D Vector of either float[8] or complex[8] datatype, and an error will be thrown if this is not possible. For this reason, it is most efficient for the passed input to use this datatype.

• 

The input signal cannot have an indexing function, and must use rectangular storage.

• 

The ShortTimeBandPower, ShortTimeMeanFrequency, and ShortTimeSpectralEntropy commands are not thread safe.

Examples

withSignalProcessing&colon;

withStatistics&colon;

Example 1

STBPShortTimeBandPower1&comma;10&comma;2&comma;9&comma;3&comma;8&comma;4&comma;segmentsize=4&comma;overlapsize=2

STBP35.785714285714327.785714285714327.9285714285715

(1)

Example 2

STBP,STMF,STSEShortTimeMeanFrequency5&comma;2&comma;8&comma;3&comma;6&comma;segmentsize=3&comma;overlapsize=1&comma;output=bandpower&comma;meanfrequency&comma;entropy

STBP,STMF,STSE20.400000000000028.6666666666667,0.1161290322580650.377981651376147,0.9023840604289701.58066498968778

(2)

Detecting Noise

Pure Signal

• 

First, construct a signal over time interval 0&comma;2π from a pure sinusoid:

signal_size4096&colon;

sample_rateevalhfsignal_size12π

sample_rate651.739491961311387

(3)

TimesVectorsignal_size&comma;ievalhfi1sample_rate&comma;datatype=float8

gt2sin5t3+7

gt2sin5t3+7

(4)

Signal_PureVector`~`gTimes&comma;datatype=float8

• 

Now, find the spectral entropy of the pure signal, along with the plot:

segment_size64&colon;

overlap_size0&colon;

Entropy_Vector_Pure,Entropy_Plot_PureShortTimeSpectralEntropySignal_Pure&comma;samplerate=sample_rate&comma;segmentsize=segment_size&comma;overlapsize=overlap_size&comma;output=entropy&comma;entropyplot&colon;

Entropy_Vector_Pure

Entropy_Plot_Pure

Noisy Signal

• 

Second, we add some noise:

NoiseVectorcolumnSampleRandomVariableNormal0&comma;5&comma;signal_size

Signal_NoisySignal_Pure+Noise

• 

With noise, of course, the short-time entropy changes:

Entropy_Vector_Noisy,Entropy_Plot_NoisyShortTimeSpectralEntropySignal_Noisy&comma;samplerate=sample_rate&comma;segmentsize=segment_size&comma;overlapsize=overlap_size&comma;output=entropy&comma;entropyplot&colon;

Entropy_Vector_Noisy

Entropy_Plot_Noisy

Comparison

• 

As we see from a plot of the original and noisy signals, the noise conceals the pure sinusoid:

dataplotTimes&comma;Signal_Noisy&comma;Signal_Pure&comma;size=800&comma;400&comma;color=red&comma;blue&comma;style=line&comma;legend=Noisy Signal&comma;Pure Signal&comma;labels=Time (s)&comma;Amplitude&comma;title=Signal&comma;font=Verdana&comma;15&comma;labelfont=Verdana&comma;10&comma;legendstyle=font=Verdana&comma;15

• 

However, the plot of the short-time spectral entropy indicates the locations where the original signal is strongest (namely, where the entropy is lowest and has the highest information content) and weakest (where the entropy is highest).

Compatibility

• 

The SignalProcessing[ShortTimeBandPower], SignalProcessing[ShortTimeMeanFrequency] and SignalProcessing[ShortTimeSpectralEntropy] commands were introduced in Maple 2021.

• 

For more information on Maple 2021 changes, see Updates in Maple 2021.

See Also

AudioTools

SignalProcessing

SignalProcessing[BandPower]

SignalProcessing[MeanFrequency]

SignalProcessing[ShortTimeFourierTransform]

SignalProcessing[SpectralEntropy]

SignalProcessing[Statistics]

SignalProcessing[Welch]