SpectreAnalysisClass Module



Derived Types

type, public ::  SpectreAnalysis_

Components

Type Visibility Attributes Name Initial
type(IO_), public :: display
type(IO_), public, allocatable :: files(:)
integer(kind=int32), public, allocatable :: num_lines(:,:)
integer(kind=int32), public, allocatable :: BOL(:)
real(kind=real32), public :: sampling_Hz
integer(kind=int32), public :: max_file_num = 10000
integer(kind=int32), public :: last_file_id
real(kind=real64), public, allocatable :: Freq(:)
real(kind=real64), public :: in1 = 0.0d0
real(kind=real64), public :: in2 = 0.0d0
real(kind=real64), public :: out1 = 0.0d0
real(kind=real64), public :: out2 = 0.0d0
complex(kind=real64), public :: in1_cmplx = 0.0d0
complex(kind=real64), public :: in2_cmplx = 0.0d0
complex(kind=real64), public :: out1_cmplx = 0.0d0
complex(kind=real64), public :: out2_cmplx = 0.0d0
complex(kind=real64), public, allocatable :: FDD_S(:,:)
complex(kind=real64), public, allocatable :: FDD_Phi(:,:,:)
logical, public :: initialized = .false.

Type-Bound Procedures

procedure, public :: init => initSpectreAnalysis
procedure, public :: add => addSpectreAnalysis
procedure, public :: channel => channelSpectreAnalysis
procedure, public :: plot => plotSpectreAnalysis
procedure, public, pass :: FFTSpectreAnalysis
procedure, public, pass :: FFT_for_vector_SpectreAnalysis
generic, public :: FFT => FFTSpectreAnalysis, FFT_for_vector_SpectreAnalysis
procedure, public :: PSD => PSDSpectreAnalysis
procedure, public :: PowerSpectrum => PowerSpectrumSpectreAnalysis
procedure, public :: freq_axis => freq_axisSpectreAnalysis
procedure, public :: FDD => FDD_SpectreAnalysis
procedure, public :: export => exportSpectreAnalysis
procedure, public, pass :: bandpass_complex64_scalar_SpectreAnalysis
procedure, public, pass :: bandpass_complex64_SpectreAnalysis
procedure, public, pass :: bandpass_real64_scalar_SpectreAnalysis
procedure, public, pass :: bandpass_real64_SpectreAnalysis
generic, public :: bandpass => bandpass_complex64_scalar_SpectreAnalysis, bandpass_complex64_SpectreAnalysis, bandpass_real64_scalar_SpectreAnalysis, bandpass_real64_SpectreAnalysis
procedure, public :: lowpass => lowpass_vector_SpectreAnalysis
procedure, public, pass :: cutifSpectreAnalysis
procedure, public, pass :: cutif_loggers_SpectreAnalysis
generic, public :: cutif => cutifSpectreAnalysis, cutif_loggers_SpectreAnalysis
procedure, public :: whiteNoize => whiteNoizeSpectreAnalysis
procedure, public :: time => timeSpectreAnalysis
procedure, public :: to_segment => to_segmentSpectreAnalysis
procedure, public :: applyTaper => applyTaper_SpectreAnalysis
procedure, public :: FourierAmplitude => FourierAmplitude_SpectreAnalysis
procedure, public :: FourierPhase => FourierPhase_SpectreAnalysis
procedure, public :: masw => masw_SpectreAnalysis
procedure, public :: fk => fk_SpectreAnalysis
procedure, public :: write => write_SpectreAnalysis

Functions

public function channelSpectreAnalysis(this, channel) result(vec_data)

$OMP parallel do default(shared) private(n, i, loc_data_id, line,row_data) $OMP end parallel do

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
integer(kind=int32), intent(in) :: channel

Return Value real(kind=real64), allocatable, (:)

public function FFTSpectreAnalysis(this, channel, Taper, Stacking, window_size) result(FFT_result)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
integer(kind=int32), intent(in) :: channel
integer(kind=int32), intent(in) :: Taper
real(kind=real32), intent(in) :: Stacking(:)
integer(kind=int32), intent(in) :: window_size

Return Value complex(kind=complex64), allocatable, (:)

public function FFT_for_vector_SpectreAnalysis(this, vector, Taper, Stacking, window_size) result(FFT_result)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
real(kind=real64), intent(in) :: vector(:)
integer(kind=int32), intent(in) :: Taper
real(kind=real32), intent(in) :: Stacking(:)
integer(kind=int32), intent(in) :: window_size

Return Value complex(kind=complex64), allocatable, (:)

public function taper_function(n, percent) result(taper_f)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: n
integer(kind=int32), intent(in) :: percent

Return Value real(kind=real64), allocatable, (:)

public function PowerSpectrumSpectreAnalysis(this, channel, Taper, Stacking, window_size) result(PowerSpectrum)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
integer(kind=int32), intent(in) :: channel
integer(kind=int32), intent(in) :: Taper
real(kind=real32), intent(in) :: Stacking(:)
integer(kind=int32), intent(in) :: window_size

Return Value real(kind=real64), allocatable, (:)

public function freq_axisSpectreAnalysis(this, window_size) result(freq)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
integer(kind=int32), intent(in) :: window_size

Return Value real(kind=real64), allocatable, (:)

public function PSDSpectreAnalysis(this, channel, Taper, Stacking, window_size, wave_data) result(PSD_result)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
integer(kind=int32), intent(in) :: channel
integer(kind=int32), intent(in) :: Taper
real(kind=real32), intent(in) :: Stacking(:)
integer(kind=int32), intent(in) :: window_size
type(SpectreAnalysis_), intent(inout) :: wave_data(:)

Return Value complex(kind=complex64), allocatable, (:,:,:)

public function bandpass_real64_SpectreAnalysis(this, x, freq_range) result(ft)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
real(kind=real64), intent(in) :: x(:)
real(kind=real32), intent(in) :: freq_range(1:2)

Return Value real(kind=real64), allocatable, (:)

public function bandpass_complex64_SpectreAnalysis(this, x, freq_range) result(ft)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
complex(kind=real64), intent(in) :: x(:)
real(kind=real32), intent(in) :: freq_range(1:2)

Return Value complex(kind=real64), allocatable, (:)

public function bandpass_complex64_scalar_SpectreAnalysis(this, x, freq_range) result(ft)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
complex(kind=real64), intent(in) :: x
real(kind=real32), intent(in) :: freq_range(1:2)

Return Value complex(kind=real64)

public function bandpass_real64_scalar_SpectreAnalysis(this, x, freq_range) result(ft)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
real(kind=real64), intent(in) :: x
real(kind=real32), intent(in) :: freq_range(1:2)

Return Value real(kind=real64)

public function whiteNoizeSpectreAnalysis(this, n, t) result(x)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
integer(kind=int32), intent(in) :: n
real(kind=real64), intent(inout), optional, allocatable :: t(:)

Return Value real(kind=real64), allocatable, (:)

public function timeSpectreAnalysis(this, n) result(t)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
integer(kind=int32), intent(in) :: n

Return Value real(kind=real64), allocatable, (:)

public function cutifSpectreAnalysis(this, x_t, window_size, sigma) result(x_r)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
real(kind=real64), intent(in) :: x_t(:)
integer(kind=int32), intent(in) :: window_size
real(kind=real64), intent(in), optional :: sigma

Return Value real(kind=real64), allocatable, (:)

public function cutif_loggers_SpectreAnalysis(this, x_t, window_size, sigma, log) result(x_r)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
real(kind=real64), intent(in) :: x_t(:,:)
integer(kind=int32), intent(in) :: window_size
real(kind=real64), intent(in), optional :: sigma
character(len=*), intent(in), optional :: log

Return Value real(kind=real64), allocatable, (:,:)

public function bandpass_filter(x, freq_range, sampling_Hz, in1, in2, out1, out2) result(ft)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x
real(kind=real64), intent(in) :: freq_range(1:2)
real(kind=real64), intent(in) :: sampling_Hz
real(kind=real64), intent(inout) :: in1
real(kind=real64), intent(inout) :: in2
real(kind=real64), intent(inout) :: out1
real(kind=real64), intent(inout) :: out2

Return Value real(kind=real64)

public function movingAverage_filter(x, in1, in2) result(ft)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x
real(kind=real64), intent(inout) :: in1
real(kind=real64), intent(inout) :: in2

Return Value real(kind=real64)

public function lowpass_vector_SpectreAnalysis(this, x, cutoff_frequency) result(ret)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
real(kind=real64), intent(in) :: x(:)
real(kind=real64), intent(in) :: cutoff_frequency

Return Value real(kind=real64), allocatable, (:)

public function lowpass_filter(x_n, buf, fc, sampling_Hz) result(x)

Arguments

Type IntentOptional Attributes Name
real(kind=Real64), intent(in) :: x_n
real(kind=Real64), intent(inout) :: buf
real(kind=Real64), intent(in) :: fc
real(kind=Real64), intent(in) :: sampling_Hz

Return Value real(kind=Real64)

public function to_segmentSpectreAnalysis(this, time_and_components, n) result(segments)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
real(kind=real64), intent(in) :: time_and_components(:,:)
integer(kind=int32) :: n

Return Value real(kind=real64), allocatable, (:,:,:)

public function FourierAmplitude_SpectreAnalysis(this, all_segments) result(all_spectrum)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
real(kind=real64), intent(in) :: all_segments(:,:,:)

Return Value real(kind=real64), allocatable, (:,:,:)

public function FourierPhase_SpectreAnalysis(this, all_segments) result(all_spectrum)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
real(kind=real64), intent(in) :: all_segments(:,:,:)

Return Value real(kind=real64), allocatable, (:,:,:)

public function masw_SpectreAnalysis(this, t, x, position, c_axis) result(ret)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
real(kind=real64), intent(in) :: t(:)
real(kind=real64), intent(in) :: x(:,:)
real(kind=real64), intent(in) :: position(:)
real(kind=real64), intent(in) :: c_axis(:)

Return Value complex(kind=real64), allocatable, (:,:)

public function fk_SpectreAnalysis(this, t, x, position, k_axis) result(z)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
real(kind=real64), intent(in) :: t(:)
real(kind=real64), intent(in) :: x(:,:)
real(kind=real64), intent(in) :: position(:)
real(kind=real64), intent(in) :: k_axis(:)

Return Value complex(kind=real64), allocatable, (:,:)


Subroutines

public subroutine initSpectreAnalysis(this, sampling_Hz, max_file_num)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
real(kind=real32), intent(in) :: sampling_Hz
integer(kind=int32), intent(in), optional :: max_file_num

public subroutine addSpectreAnalysis(this, name, lines, BOL)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
character(len=*), intent(in) :: name
integer(kind=int32), intent(in) :: lines(1:2)
integer(kind=int32), intent(in) :: BOL

public subroutine plotSpectreAnalysis(this, channels)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
integer(kind=int32), intent(in) :: channels(:)

public subroutine FDD_SpectreAnalysis(this, wave_data, window_size, channel, Taper, Stacking)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(inout) :: this
type(SpectreAnalysis_), intent(inout) :: wave_data(:)
integer(kind=int32), intent(in) :: window_size
integer(kind=int32), intent(in) :: channel
integer(kind=int32), intent(in) :: Taper
real(kind=real32), intent(in) :: Stacking(:)

public subroutine exportSpectreAnalysis(this, name)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
character(len=*), intent(in) :: name

public subroutine applyTaper_SpectreAnalysis(this, segments, percent)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
real(kind=real64), intent(inout) :: segments(:,:,:)
integer(kind=int32), intent(in) :: percent

public subroutine write_SpectreAnalysis(this, name, all_spectrum)

Arguments

Type IntentOptional Attributes Name
class(SpectreAnalysis_), intent(in) :: this
character(len=*), intent(in) :: name
real(kind=real64), allocatable :: all_spectrum(:,:,:)