View source: R/computeInstantaneousAttributes.R
| computeInstantaneousAttributes | R Documentation |
Computes, for each column of a matrix of modes, the analytic signal and its instantaneous amplitude, continuous phase and frequency.
computeInstantaneousAttributes(modes, samplingInterval)
modes |
Finite double matrix, samples by modes, with at least three
rows; it may have zero columns. Attributes other than |
samplingInterval |
Sampling interval |
The analytic signal z = c + i \mathcal{H} c of each column is
computed with the discrete Fourier transform, multiplying each bin by
1 + \mathrm{sgn}(\omega): positive frequencies are doubled, negative
ones removed, and the zero bin and, for an even number of samples, the
Nyquist bin keep the factor 1, so \mathrm{Re}\, z = c. The transform
implies the periodic extension of the record. The amplitude is
a = |z|. Within each run of samples with |z| > 0, the phase
starts at the principal value of \arg z and adds the increments
\arg(z_{n+1} \bar z_n) taken in (-\pi, \pi]; a zero of z
leaves its sample undefined (NA) and the next run starts again at
its principal value. The frequency is
f_n = \frac{\phi_{n+1} - \phi_{n-1}}{4 \pi \Delta t}
in Hz, the central difference of \omega = \phi'; it is NA where
one of the three phases is, and each border repeats its neighbour. These
local undefined values raise no condition.
A list of three matrices, samples by modes:
amplitude |
Instantaneous amplitude, in the units of the modes. |
phase |
Continuous phase in radians, |
frequency |
Instantaneous frequency in Hz, |
buildHilbertSpectrum, decomposeEMD,
estimateMaskFrequency
SamplingInterval <- 1 / 1000
Time <- seq_len(1000) * SamplingInterval
# Three tones of 2, 24 and 288 Hz as columns.
Tones <- cbind(cos(2 * pi * 2 * Time), 0.25 * cos(2 * pi * 24 * Time),
0.0625 * cos(2 * pi * 288 * Time))
OUT <- computeInstantaneousAttributes(Tones,
samplingInterval = SamplingInterval)
apply(OUT$amplitude, 2, range)
apply(OUT$frequency, 2, range)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.