Skip to contents

This function locates the null points in the First Order Region (FOR) of a Doppler spectrum. These nulls define the boundaries separating the first-order Bragg peak from the surrounding noise or second-order energy.

Usage

seasonder_findFORNullsInSpectrum(
  seasonder_cs_object,
  spectrum,
  doppler_bins,
  negative_Bragg_region = FALSE
)

Arguments

seasonder_cs_object

A SeaSondeRCS object containing the spectral data.

spectrum

A numeric vector representing the power spectrum to analyze.

doppler_bins

A numeric vector containing the Doppler bins corresponding to the spectrum.

negative_Bragg_region

A logical value indicating whether the function should analyze the negative Bragg region. Default is FALSE.

Value

A list with three elements:

  • FOR: A sequence of Doppler bins defining the first order region.

  • MAXP: The maximum power found in the spectrum.

  • MAXP.bin: The Doppler bin index of the maximum power.

Details

The function executes the following steps:

  1. Retrieve First Order Settings: The function extracts the fdown parameter, which defines the drop-off level relative to the maximum power.

  2. Prepare the Spectrum:

    • Convert all values to negative absolute magnitudes to facilitate peak detection.

    • Reverse the spectrum and Doppler bins if analyzing the negative Bragg region.

  3. Find the Main Spectral Peak:

    • The function identifies the first major peak using findpeaks with at least two consecutive increases and decreases.

    • The search is limited to the portion of the spectrum beyond this peak.

  4. Determine the First Order Boundaries:

    • The maximum power (MAXP) is found along with its bin index (MAXP.bin).

    • A threshold value start_point_P is computed as MAXP / fdown to establish the cutoff point for the null search.

  5. Search for Nulls: The spectrum is split into left and right sections:

    • The right-side spectrum is analyzed using seasonder_findFORNullsInFOR to find the right null.

    • The left-side spectrum undergoes the same process but reversed.

  6. Output the Results: The function returns a list containing:

    • The sequence of Doppler bins defining the FOR region.

    • The maximum power detected (MAXP).

    • The Doppler bin index where MAXP occurred (MAXP.bin).

See also