Investment Studio > Expressions > Functions > DSP > MEMDOM
| Short form: | float array[1][3]
memdom(float array mem_coefficients, boolean power, float normalized_frequency) Returns a three-column row vector containing (by column):
|
| Long form: | float array[1][3]
memdom(float array mem_coefficients, boolean power, float from_normalized_frequency, float normalized_frequency_step, integer steps) Returns a three-column row vector reporting the maximum (among the points in the specified frequency grid) of the MEM-estimated spectrum given by mem_coefficients (see mem). The result vector contains the maximum's normalized frequency, its value (spectral amplitude if power = FALSE; spectral amplitude squared = spectral power if power = TRUE) and its signal to noise ratio. If power is TRUE, the signal to noise ratio is computed by dividing the max spectral power with the average spectral power in the scanned frequency range. If power is FALSE, the signal to noise ratio is computed by dividing the max spectral amplitude with the average spectral amplitude in the scanned frequency range. |
All elements in mem_coefficients are converted to floats (with exclusion if conversion fails) and interpreted as a single, one-dimensional sequence. If the data array is two-dimensional, it's read in the usual order (i.e. row by row: left to right, top to bottom).
Normalized frequencies are frequencies expressed as fractions of the sampling rate. The sampling rate is the inverse of the sampling period. The highest frequency component that can be reconstructed from a sequence of evenly sampled values is half the sampling rate (Nyqvist's theorem), so normalized frequencies higher than 0.5 (the Nyqvist frequency) are not meaningful.
See mem for details on MEM (Maximum Entropy Method) estimation of power spectra.
Example
Given the 1024-point sine wave with normalized frequency 0.06 and amplitude 1,
_data = mop("sin()", makevector(1024, 0, 12 * PI / 100))
the expression
=memdom(mem(array(_data), 10), TRUE, 0, 0.001, 101)
equals {0.06, 2.91525690933079, 100.979159318906}.
This tells us that the highest value in the normalized frequency range [0, 0.1] of the 10-pole MEM estimate of the wave's power spectrum occurs at normalized frequency 0.06, with a spectral power of » 2.92 and a signal/noise ratio (max power over average power in the scanned frequency range) of » 100.98 (meaning that we are looking at a very sharp peak).