FourierSpectrum (FPScript)

21.09.2021

Computes the windowed Fourier spectrum.

Syntax

FourierSpectrum(Signal, [ SpectrumType = SPECTRUM_DBNORM ], [ Window = WIN_HANNING+WIN_NORMALIZEAMPLITUDE ], [ Adjustment ], [ FFTLength = 0 ] [ , Peaks ])

 

The syntax of the FourierSpectrum function consists of the following parts:

Part

Description

Signal

The data to be analyzed. The data must have a constant sampling rate and must not contain void values. If this is not the case, then you should use the FourierSpectrumUneven function.

Permitted data structures are data series, data matrix, signal und signal series. All real data types are permitted, except calendar time und time span.

Void values are not permitted in this argument.

For the X component additional restrictions do apply.The values must have a constant positive spacing. Void values are not permitted in this argument.

If the argument is a list, then the function is executed for each element of the list and the result is also a list.

SpectrumType

The spectral format to be computed.

The argument SpectrumType can have the following values:

Constant

Meaning

SPECTRUM_AMPLITUDE

Amplitude

SPECTRUM_RMSAMPLITUDE

RMS Amplitude

SPECTRUM_AMPLITUDE2

Amplitude2

SPECTRUM_DB O

Amplitude in dB (decibels)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

SPECTRUM_DBNORM O

dB (decibels) peak normalized to zero

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

SPECTRUM_PSD O

PSD (Power Spectral Density)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

SPECTRUM_TISA O

TISA (Time Integral Amplitude2)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

SPECTRUM_MSA

MSA (Mean Amplitude2)

SPECTRUM_SSA O

SSA (Sum Amplitude2)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

SPECTRUM_VARIANCE O

Power variance normalized

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

SPECTRUM_MAGNITUDE2 O

Magnitude2

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

SPECTRUM_MAGNITUDE O

Magnitude

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

SPECTRUM_PHASE O

Phase

O This constant requires the option Spectral Analysis to be licensed.

SPECTRUM_PHASEUNWRAP O

Phase unwrapped

O This constant requires the option Spectral Analysis to be licensed.

SPECTRUM_COMPLEX O

Complex spectrum

O This constant requires the option Spectral Analysis to be licensed.

SPECTRUM_REAL O

Real component

O This constant requires the option Spectral Analysis to be licensed.

SPECTRUM_IMAG O

Imaginary component

O This constant requires the option Spectral Analysis to be licensed.

+ SPECTRUM_PEAKS O

If this constant is added to one of the spectrum types above, then only peaks in the spectrum are output.

O This constant requires the option Spectral Analysis to be licensed.

+ SPECTRUM_SIGNIFICANCE50 O

If one of these constants is added to one of the spectrum types above, then the critical limit for the significance level 50 % is output as a curve across the frequency.

O This constant requires the option Spectral Analysis to be licensed.

+ SPECTRUM_SIGNIFICANCE90 O

If one of these constants is added to one of the spectrum types above, then the critical limit for the significance level 90 % is output as a curve across the frequency.

O This constant requires the option Spectral Analysis to be licensed.

+ SPECTRUM_SIGNIFICANCE95 O

If one of these constants is added to one of the spectrum types above, then the critical limit for the significance level 95 % is output as a curve across the frequency.

O This constant requires the option Spectral Analysis to be licensed.

+ SPECTRUM_SIGNIFICANCE99 O

If one of these constants is added to one of the spectrum types above, then the critical limit for the significance level 99 % is output as a curve across the frequency.

O This constant requires the option Spectral Analysis to be licensed.

+ SPECTRUM_SIGNIFICANCE99_9 O

If one of these constants is added to one of the spectrum types above, then the critical limit for the significance level 99.9 % is output as a curve across the frequency.

O This constant requires the option Spectral Analysis to be licensed.

SPECTRUM_ALL O

Outputs the complete spectral information as a data matrix. For the Fourier Spectrum, these are: Frequency, Real Component, Imaginary Component, Magnitude, Magnitude², Amplitude, Wave Length, Phase, dB, dB normalized, SSA, MSA, TISA, PSD and Power variance normalized. For the periodogram, these are: Frequency, Magnitude, Amplitude, dB, dB normalized, SSA, MSA, TISA, PSD and Power variance normalized. All spectral values in this case are output in two columns with the mean value and standard deviation, which are calculated from the segments. This type is permitted for one-dimensional data sets only.

O This constant requires the option Spectral Analysis to be licensed.

SPECTRUM_HARMONICS O

Outputs the spectral information about the peaks in the spectrum as a data matrix. These are for the Fourier spectrum: Frequency, Amplitude, Phase, PSD, % Power and Relative Power %. % Power is normalized to the sum of 100 and Relative Power % is normalized to a maximum of 100 %. For the Uneven Data Fourier Spectrum: Frequency, Amplitude, PSD, % Power and Relative Power %. For the periodogram: Frequency, Amplitude, Amplitude SD, PSD, % Power and Relative Power %. For the Multitaper Spectrum: Frequency, Amplitude, Phase, PSD, % Power, Relative Power % and F value. If the argumentPeaks is not specified, then a peak count of 10 is taken as a default. This type is permitted for one-dimensional data sets only.

O This constant requires the option Spectral Analysis to be licensed.

Permitted data structures are scalar value. All integral data types are permitted.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

If this argument is omitted, it will be set to the default value SPECTRUM_DBNORM.

Window

The fixed or adjustable data window to be applied to the data.

The argument Window can have the following values:

Constant

Meaning

WIN_RECTANGULAR

Rectangular -13 dB (no windowing, width=1)

WIN_WELCH

Welch -21 dB (fixed width=1.4)

WIN_SINE

Sine -23 dB (fixed width=1.5)

WIN_BISQUARE

Bi-Square or Connes -28 dB (fixed width=1.8)

WIN_BARTLETT

Bartlett -27 dB (fixed width=2)

WIN_HANNING

Hanning Max. Rolloff -31 dB (cosine, order 2, fixed width=2)

WIN_TUKEYHANN O

Tukey-Hann -37 dB (fixed width=2)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_BARTLETTMOD O

Modified Bartlett -39 dB (fixed width=2.3)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_HAMMING

Hamming Min. Sidelobe -43 dB (cosine, order 2, fixed width=2)

WIN_COS3MAXROLLOFF O

C3 Max. Rolloff -47 dB (cosine, order 3, fixed width=3)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COS3BLACKMAN

Blackman -58 dB (cosine, order 3, fixed width=3)

WIN_COS3BHARRIS62 O

Blackman-Harris -62 dB (cosine, order 3, fixed width=3)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COS3NUTALL O

C1 Nutall -64 dB (cosine, order 3, fixed width=3)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COS3BLACKMANEXACT O

Blackman Exact -68 dB (cosine, order 3, fixed width=3)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COS3BHARRIS68 O

Blackman-Harris -68 dB (cosine, order 3, fixed width=3)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COS3MINSIDELOBE O

Nutall -71 dB (cosine, order 3, fixed width=3)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COS4MAXROLLOFF O

C5 Max. Rolloff -61 dB (cosine, order 4, fixed width=4)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COS4BHARRIS74 O

Blackman-Harris -74 dB (cosine, order 4, fixed width=4)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COS4NUTALL83 O

C3 Nutall -83 dB (cosine, order 4, fixed width=4)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COS4BHARRIS92 O

Blackman-Harris -92 dB (cosine, order 4, fixed width=4)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COS4NUTALL93 O

C1 Nutall -93 dB (cosine, order 4, fixed width=4)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COS4NUTALL96 O

Nutall -96 dB (cosine, order 4, fixed width=4)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_FLATTOP

Flattop -68 dB (cosine, order 5, fixed width=5)

WIN_BETA O

Beta, Max. Rolloff (adjustable width=1.5-6)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COSMAXROLLOFF O

Cosine Max. Rolloff (adjustable width=1.5-6)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_KAISERBESSEL

Kaiser-Bessel (fixed width=3, adjustable width=1.5-6 with the Spectral Analysis option installed)

WIN_VANDERMAAS O

VanderMaas (adjustable width=1.5-6)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_CHEBYSHEV O

Chebyshev (adjustable width=1.75-5.75)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_CHEBYSHEVAPPROX O

Chebyshev Approx. (adjustable width=2.1-5)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_SLEPIAN O

Slepian DPSS-1 (adjustable width=2-5)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_GAUSS O

Gaussian (adjustable width=2-6)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

WIN_COSTAPER O

Tapered Cosine (adjustable width=1-2)

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

+ WIN_NORMALIZEAMPLITUDE

If this constant is added to one of the window constants above, an amplitude normalization is performed after applying the window. In this case the gain of the used window function is used for normalization which is the sum of all values of the window divided by their number. This compensates the damping of the amplitudes caused by the window. Therefore it is especially useful for measuring peaks within the spectrum.

+ WIN_NORMALIZEPOWER O

If this constant is added to one of the window constants above, a power normalization is performed after applying the window. Thus the loss of power is compensated. The ratio of the sum of the squared data before and after applying the window is used as a normalization factor.

O This constant requires the option Order Tracking or the option Spectral Analysis to be licensed.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

If this argument is omitted, it will be set to the default value WIN_HANNING+WIN_NORMALIZEAMPLITUDE.

Adjustment

The one-sided Fourier width as a multiple of the frequency interval. The valid range is window specific within 1.0 to 6.0. The default is 1.5 for a tapered cosine window and 3.0 for all other adjustable data windows.

Permitted data structures are scalar value. All real data types are permitted.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

FFTLength

The length of the Fourier transform. Zero padding applies if the FFT length is greater than the data length. The valid range is from the data length to the maximum limit of FFT. The default value is -1, which sets the FFT length equal to the next highest power of two. The default value is 0, which sets FFT length equal to the data length.

Permitted data structures are scalar value. All integral data types are permitted.

The value must be greater or equal to -1 and less or equal to 2147483648.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

If this argument is omitted, it will be set to the default value 0.

Peaks O

If specified, only bin-interpolated peaks in the spectrum are output. The peaks can be specified as a number or determined using a dB threshold. Specify a number as a positive number from 1 to 100 without a unit. You can specify a dB threshold as a quantity with the unit dB between 0.01 dB and 300 dB, or as a negative number between -0.01 and -300 without a unit. This argument is permitted for one-dimensional data sets only.

Permitted data structures are scalar value. All real data types are permitted.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Remarks

The data structure of the result is signal or signal series. If the argument Signal is a data series or data matrix, then the X component of the result contains Nyquist-normalized frequencies.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

FourierSpectrum(Signal, SPECTRUM_DBNORM, WIN_COS4BHARRIS92, 4, 8192)

Calculates the windowed Fourier spectrum for the equidistant signal 'Signal'. Normalized dB is used as the spectrum type, and Cos4 Blackman-Harris -92 dB W=4 is selected as the window type. The FFT length is 8192. This is an example from the Fourier Spectral Analysis tutorial.

See Also

FourierSpectrumUneven Function

Periodogram Function

MultitaperSpectrum Function

CrossSpectrum Function

FFTn Function

STFTSpectrum Function

Spectral Analysis Option

Fourier Spectral Analysis Object

Data Tapering Window

Fourier Spectral Analysis

Fourier Spectral Analysis Tutorial

Share article or send as email:

You might be interested in these articles