Learn R Programming

PAMmisc (version 1.12.4)

wignerTransform: Calculate the Wigner-Ville Transform of a Signal

Description

Calculates the Wigner-Ville transform a signal. By default, the signal will be zero-padded to the next power of two before computing the transform, and creates an NxN matrix where N is the zero-padded length. Note that this matrix can get very large for larger N, consider shortening longer signals.

Usage

wignerTransform(signal, n = NULL, sr, plot = FALSE)

Value

a list with three items. tfr, the real values of the wigner transform as a matrix with n rows and number of columns equal to the next power of two from the length of the input signal. f and t

the values of the frequency and time axes.

Arguments

signal

input signal waveform

n

number of frequency bins of the output, if NULL will be the next power of two from the length of the input signal (recommended)

sr

the sample rate of the data

plot

logical flag whether or not to plot the result

Author

Taiki Sakai taiki.sakai@noaa.gov

Details

This code mostly follows Pamguard's Java code for computing the Wigner-Ville and Hilbert transforms.

Examples

Run this code
clickWave <- createClickWave(signalLength = .05, clickLength = 1000, clicksPerSecond = 200,
                             frequency = 3e3, sampleRate = 10e3)
wt <- wignerTransform(clickWave@left, n = 1000, sr = 10e3, plot=TRUE)

Run the code above in your browser using DataLab