cross_spec {fftab}R Documentation

Compute the Cross-Spectrum (Cross FFT)

Description

The cross_spec function computes the cross-spectrum between two inputs using the Fourier transform. It supports multiple input types including numeric vectors, time series (ts), arrays, and fftab objects. The function provides options for normalization and controlling whether the conjugate of the second input is used.

Usage

cross_spec(a, b, norm = FALSE, conj = TRUE)

## Default S3 method:
cross_spec(a, b, norm = FALSE, conj = TRUE)

## S3 method for class 'ts'
cross_spec(a, b, norm = FALSE, conj = TRUE)

## S3 method for class 'array'
cross_spec(a, b, norm = FALSE, conj = TRUE)

## S3 method for class 'fftab'
cross_spec(a, b, norm = FALSE, conj = TRUE)

Arguments

a

The first input for the cross FFT. Supported types include numeric vectors, ts objects, arrays, and fftab objects.

b

The second input for the cross FFT. Must match the dimensions or structure of a.

norm

Logical; if TRUE, normalizes the Fourier transforms before computation. Default is FALSE.

conj

Logical; if TRUE, uses the complex conjugate of the Fourier transform of b. Default is TRUE.

Value

An object representing the cross-spectrum:

Methods (by class)

See Also

fftab()

Examples

cross_spec(rnorm(8), rnorm(8), norm = TRUE)

cross_spec(
  ts(rnorm(8), frequency = 4),
  ts(rnorm(8), frequency = 4)
)


[Package fftab version 0.1.0 Index]