Identify Nulls in First Order Region (FOR) Spectrum
Source:R/SeaSondeRCS_FOR.R
seasonder_findFORNullsInSpectrum.Rd
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:
Retrieve First Order Settings: The function extracts the
fdown
parameter, which defines the drop-off level relative to the maximum power.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.
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.
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 asMAXP / fdown
to establish the cutoff point for the null search.
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.
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
seasonder_findFORNullsInFOR
for detecting nulls within a selected region.findpeaks
for peak identification.seasonder_getFOR_parameters
for retrieving FOR settings.