|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
High-performance energy analyzer with zero-copy processing. More...
#include <EnergyAnalyzer.hpp>
Inheritance diagram for MayaFlux::Yantra::EnergyAnalyzer< InputType, OutputType >:
Collaboration diagram for MayaFlux::Yantra::EnergyAnalyzer< InputType, OutputType >:Public Types | |
| using | input_type = IO< InputType > |
| using | output_type = IO< OutputType > |
| using | base_type = UniversalAnalyzer< InputType, OutputType > |
Public Types inherited from MayaFlux::Yantra::UniversalAnalyzer< InputType, OutputType > | |
| using | input_type = IO< InputType > |
| using | output_type = IO< OutputType > |
| using | base_type = ComputeOperation< InputType, OutputType > |
Public Types inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType > | |
| using | input_type = IO< InputType > |
| using | output_type = IO< OutputType > |
Public Member Functions | |
| EnergyAnalyzer (uint32_t window_size=256, uint32_t hop_size=128) | |
| Construct EnergyAnalyzer with configurable window parameters. | |
| EnergyAnalysis | analyze_energy (const InputType &data) |
| Type-safe energy analysis method. | |
| EnergyAnalysis | get_energy_analysis () const |
| Get last energy analysis result (type-safe) | |
| AnalysisType | get_analysis_type () const override |
| Get analysis type category. | |
| std::vector< std::string > | get_available_methods () const override |
| Get available analysis methods. | |
| bool | supports_method (const std::string &method) const override |
| Check if a specific method is supported. | |
| void | set_energy_method (EnergyMethod method) |
| Set energy computation method. | |
| EnergyMethod | get_energy_method () const |
| Get current energy computation method. | |
| void | set_window_parameters (uint32_t window_size, uint32_t hop_size) |
| Set window parameters for analysis. | |
| void | set_energy_thresholds (double silent, double quiet, double moderate, double loud) |
| Set energy level classification thresholds. | |
| void | enable_classification (bool enabled) |
| Enable or disable energy level classification. | |
| EnergyLevel | classify_energy_level (double energy) const |
| Classify energy value into qualitative level. | |
| int | get_level_count (const ChannelEnergy &channel, EnergyLevel level) |
| Get count of windows in a specific energy level for a channel. | |
Public Member Functions inherited from MayaFlux::Yantra::UniversalAnalyzer< InputType, OutputType > | |
| virtual | ~UniversalAnalyzer ()=default |
| std::string | get_name () const override |
| Gets human-readable name for this analyzer. | |
| void | set_parameter (const std::string &name, std::any value) override |
| Type-safe parameter management with analysis-specific defaults. | |
| std::any | get_parameter (const std::string &name) const override |
| Retrieves a parameter's current value. | |
| std::map< std::string, std::any > | get_all_parameters () const override |
| Retrieves all parameters and their values. | |
| void | set_analysis_granularity (AnalysisGranularity granularity) |
| AnalysisGranularity | get_analysis_granularity () const |
| bool | validate_input (const input_type &input) const override |
| Validates input data meets analyzer requirements. | |
| std::any | analyze_data (const InputType &data) |
| User-facing analysis method - returns analysis results directly. | |
| std::vector< std::any > | analyze_batch (const std::vector< InputType > &inputs) |
| Batch analysis for multiple inputs. | |
| std::any | get_current_analysis () const |
| Access cached analysis from last operation. | |
| bool | has_current_analysis () const |
| Check if analysis has been performed. | |
| template<typename T > | |
| T | get_parameter_or_default (const std::string &name, const T &default_value) const |
| Helper to get typed parameter with default value. | |
Public Member Functions inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType > | |
| ComputeOperation () | |
| Constructor with data type validation warnings. | |
| virtual | ~ComputeOperation ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
| output_type | apply_operation (const input_type &input) |
| Public synchronous execution interface. | |
| output_type | apply_operation_with_dependencies (const input_type &input) |
| Applies the operation with dependencies resolved. | |
| output_type | operator() (const InputType &data) |
| Convenience overload for direct data processing (backward compatibility) | |
| OutputType | apply_to_data (const InputType &data) |
| Convenience overload that extracts just the data from result. | |
| output_type | execute (const input_type &input) |
| OpUnit interface - operations can act as units in dependency graphs. | |
| void | add_dependency (std::shared_ptr< ComputeOperation > dep) |
| const auto & | get_dependencies () const |
| virtual void | set_container_for_regions (const std::shared_ptr< Kakshya::SignalSourceContainer > &container) |
| virtual const std::shared_ptr< Kakshya::SignalSourceContainer > & | get_container_for_regions () const |
| void | set_last_execution_context (const ExecutionContext &ctx) |
| const ExecutionContext & | get_last_execution_context () const |
| void | set_pre_execution_hook (const OpererationHookCallback &hook) |
| void | set_post_execution_hook (const OpererationHookCallback &hook) |
| void | set_reconstruction_callback (const ReconstructionCallback &callback) |
Static Public Member Functions | |
| static std::string | method_to_string (EnergyMethod method) |
| Convert energy method enum to string. | |
| static EnergyMethod | string_to_method (const std::string &str) |
| Convert string to energy method enum. | |
| static std::string | energy_level_to_string (EnergyLevel level) |
| Convert energy level enum to string. | |
Protected Member Functions | |
| std::string | get_analyzer_name () const override |
| Get analyzer name. | |
| output_type | analyze_implementation (const input_type &input) override |
| Core analysis implementation - creates analysis result AND pipeline output. | |
| void | set_analysis_parameter (const std::string &name, std::any value) override |
| Handle analysis-specific parameters. | |
| std::any | get_analysis_parameter (const std::string &name) const override |
| Get analysis-specific parameter. | |
Protected Member Functions inherited from MayaFlux::Yantra::UniversalAnalyzer< InputType, OutputType > | |
| output_type | operation_function (const input_type &input) override |
| Core analysis implementation - must be overridden by derived classes. | |
| virtual std::map< std::string, std::any > | get_all_analysis_parameters () const |
| virtual bool | validate_analysis_input (const input_type &) const |
| Input validation (override for custom validation logic) | |
| virtual output_type | apply_granularity_formatting (const output_type &raw_output) |
| Apply granularity-based output formatting. | |
| virtual output_type | add_attribution_metadata (const output_type &raw_output) |
| Add attribution metadata to results (override for custom attribution) | |
| virtual output_type | organize_into_groups (const output_type &raw_output) |
| Organize results into hierarchical groups (override for custom grouping) | |
| virtual output_type | create_summary_statistics (const output_type &raw_output) |
| Create summary statistics from results (override for custom summaries) | |
| template<typename AnalysisResultType > | |
| void | store_current_analysis (AnalysisResultType &&result) const |
Protected Member Functions inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType > | |
| virtual output_type | apply_operation_internal (const input_type &input, const ExecutionContext &context) |
| Internal execution method - ComputeMatrix can access this. | |
| virtual std::future< output_type > | apply_operation_async (const input_type &input) |
| Optional async implementation - default delegates to operation_function. | |
| virtual output_type | apply_operation_parallel (const input_type &input, const ExecutionContext &ctx) |
| Optional parallel-aware implementation - default delegates to operation_function. | |
| virtual output_type | apply_operation_chained (const input_type &input, const ExecutionContext &ctx) |
| Optional chain-aware implementation - default delegates to operation_function. | |
| output_type | convert_result (std::vector< std::vector< double > > &result_data, DataStructureInfo &metadata) |
| Convert processed double data back to OutputType using metadata and optional callback. | |
Private Member Functions | |
| void | validate_window_parameters () const |
| EnergyAnalysis | create_analysis_result (const std::vector< std::vector< double > > &energy_values, std::vector< std::span< const double > > original_data, const DataStructureInfo &) const |
| Create comprehensive analysis result from energy computation. | |
| output_type | create_pipeline_output (const input_type &input, const EnergyAnalysis &analysis_result, DataStructureInfo &info) |
| Create pipeline output from input and energy values. | |
| std::vector< double > | compute_energy_values (std::span< const double > data, EnergyMethod method) const |
| Compute energy values using span (zero-copy processing) | |
| size_t | calculate_num_windows (size_t data_size) const |
| Calculate number of windows for given data size. | |
Private Attributes | |
| uint32_t | m_window_size { 512 } |
| uint32_t | m_hop_size { 256 } |
| EnergyMethod | m_method { EnergyMethod::RMS } |
| bool | m_classification_enabled { false } |
| double | m_silent_threshold { 0.01 } |
| double | m_quiet_threshold = { 0.1 } |
| double | m_moderate_threshold { 0.5 } |
| double | m_loud_threshold { 0.8 } |
Additional Inherited Members | |
Protected Attributes inherited from MayaFlux::Yantra::UniversalAnalyzer< InputType, OutputType > | |
| std::any | m_current_analysis |
| output_type | m_current_output |
Protected Attributes inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType > | |
| std::shared_ptr< Kakshya::SignalSourceContainer > | m_container |
| ExecutionContext | m_last_execution_context |
High-performance energy analyzer with zero-copy processing.
The EnergyAnalyzer provides comprehensive energy analysis capabilities for digital signals using span-based processing for maximum efficiency. All data extraction and conversion is handled automatically by OperationHelper.
Example usage:
Definition at line 107 of file EnergyAnalyzer.hpp.