Learn R Programming

hht (version 2.1.6)

HHRender: Render Hilbert spectrogram

Description

This function prepares results from the Hilbert transform of EMD or EEMD results for display using HHGramImage.

Usage

HHRender(hres, dt, dfreq, time.span = NULL, freq.span = NULL, scaling = "none", 
    combine.imfs = TRUE, verbose = TRUE)

Value

hgram

A data structure containing the spectrogram image and other information required by HHGramImage.

Arguments

hres

This is the output generated by Sig2IMF, EEMDCompile, EEMDResift

, or CEEMD.

dt

Time resolution of spectrogram. Must be greater than the sample rate of the time series to avoid gaps.

dfreq

Frequency resolution of spectrogram.

time.span

Time span to render spectrogram over; NULL means over the whole time series.

freq.span

Frequency span to include in spectrogram; NULL means render all the frequencies in the time series

scaling

If "log", render a log frequency spectrogram. Defaults to "none" (linear).

combine.imfs

If TRUE, add the spectra for all IMFS together in one ensemble Hilbert spectrogram, if FALSE, keep separate so you can investigate individual IMFs in HHGramImage.

verbose

If TRUE, print progress messages.

Author

Daniel Bowman danny.c.bowman@gmail.com

Details

HHRender processes Hilbert spectral data prior to displaying with HHGramImage. HHRender returns the ensemble Hilbert spectrogram if combine.imfs = TRUE, otherwise it returns an IMF-by-IMF Hilbert spectrogram of dimensions [time, freq, imf]. The user can then choose which IMFs to plot when he or she calls HHGramImage, but this makes HHGramImage run about 40x slower on my machine. The trade off is in speed versus flexibility for HHGramImage; the combine.imfs option does not affect HHRender very much.

See Also

EEMDCompile, HHGramImage

Examples

Run this code
data(PortFosterEvent)

trials <- 10
nimf <- 10
noise.amp <- 6.4e-07
trials.dir <- "test"

set.seed(628)
#Run EEMD (this may take some time)
if (FALSE) EEMD(sig, tt, noise.amp, trials, nimf, noise.amp, trials.dir <- trials.dir)

#Compile the results
if (FALSE) EEMD.result <- EEMDCompile(trials.dir, trials, nimf)

#Calculate spectrogram
dt <- 0.1
dfreq <- 0.1

if (FALSE) hgram <- HHRender(EEMD.result, dt, dfreq)

#Plot spectrogram 
time.span <- c(5, 10)
freq.span <- c(0, 25)
amp.span <- c(1e-6, 2.5e-5)
if (FALSE) HHGramImage(hgram, time.span = time.span, 
    freq.span = freq.span, amp.span = amp.span)

Run the code above in your browser using DataLab