|
SynchroPMU
C implementation of the Phasor Measurement Unit Estimator based on the Iterative Interpolated DFT Synchrophasor Estimation Algorithm
|
PMU (Phasor Measurement Unit) Estimator Header File. More...


Go to the source code of this file.
Data Structures | |
| struct | estimator_config |
| Configuration structure for the PMU estimator. More... | |
| struct | phasor |
| Represents a synchrophasor (complex voltage/current measurement) More... | |
| struct | pmu_frame |
| Complete PMU output frame. More... | |
| struct | SynchrophasorEstimatorParams |
| Internal parameters for synchrophasor estimation. More... | |
| struct | InternalBuffers |
| Dynamically allocated internal buffers. More... | |
| struct | HanningTransformConstants |
| Precomputed constants for Hanning window Fourier Transform. More... | |
| struct | RocoFEstimationStates |
| State variables for ROCOF (Rate of Change of Frequency) estimation. More... | |
| struct | pmu_context |
| PMU estimator context structure. More... | |
Macros | |
| #define | CONFIG_FROM_INI 1 |
| Configuration source: Load configuration from INI file. | |
| #define | CONFIG_FROM_STRUCT 0 |
| Configuration source: Load configuration from structure. | |
Typedefs | |
| typedef struct pmu_context | pmu_context |
Functions | |
| int | pmu_init (pmu_context *ctx, void *cfg, bool_p config_from_ini) |
| Initialize a PMU estimator instance. | |
| int | pmu_estimate (pmu_context *ctx, float_p *in_signal_windows, float_p mid_fracsec, pmu_frame *out_frame) |
| Estimate synchrophasor, frequency, and ROCOF from input signal. | |
| int | pmu_deinit (pmu_context *ctx) |
| Deinitialize and free resources of PMU estimator instance. | |
| int | pmu_dump_frame (pmu_frame *frame, FILE *stream) |
| Print PMU frame data to output stream. | |
PMU (Phasor Measurement Unit) Estimator Header File.
This header file provides the interface for the PMU estimator library, which implements the Iterative Enhanced Interpolated DFT (Discrete Fourier Transform) Synchrophasor Estimation Algorithm.
The library provides functionality for:
| #define CONFIG_FROM_INI 1 |
Configuration source: Load configuration from INI file.
| #define CONFIG_FROM_STRUCT 0 |
Configuration source: Load configuration from structure.
| typedef struct pmu_context pmu_context |
| int pmu_deinit | ( | pmu_context * | ctx | ) |
Deinitialize and free resources of PMU estimator instance.
Releases all dynamically allocated memory associated with the PMU context and resets the initialization flag. After calling this function, the context can be reinitialized with pmu_init() if needed.
| [in,out] | ctx | Pointer to the PMU context to deinitialize |
| int pmu_dump_frame | ( | pmu_frame * | frame, |
| FILE * | stream ) |
Print PMU frame data to output stream.
Outputs the contents of a pmu_frame structure in a human-readable format to the specified output stream (e.g., stdout, stderr, or a file).
| [in] | frame | Pointer to the PMU frame to dump |
| [in] | stream | Output stream (e.g., stdout, stderr, or FILE pointer from fopen) |
| int pmu_estimate | ( | pmu_context * | ctx, |
| float_p * | in_signal_windows, | ||
| float_p | mid_fracsec, | ||
| pmu_frame * | out_frame ) |
Estimate synchrophasor, frequency, and ROCOF from input signal.
This is the main estimation function that processes a window of input samples and produces synchrophasor and ROCOF estimates using the Iterative Enhanced Interpolated DFT algorithm.
| [in] | ctx | Pointer to initialized PMU context |
| [in] | in_signal_windows | Pointer to input signal samples. For multi-channel: array of pointers to signal windows for each channel. Array size must match NUM_CHANLS configuration. |
| [in] | mid_fracsec | Fractional second timestamp (relative to PPS) of the midpoint of the observation window. Used for phase correction. |
| [out] | out_frame | Pointer to output PMU frame structure where results are stored |
| int pmu_init | ( | pmu_context * | ctx, |
| void * | cfg, | ||
| bool_p | config_from_ini ) |
Initialize a PMU estimator instance.
Initializes a PMU estimator context with the specified configuration. The configuration can be loaded from an INI file or passed as a structure.
| [in,out] | ctx | Pointer to the PMU context structure to initialize |
| [in] | cfg | Configuration: either a filename (char*) if config_from_ini=1, or a pointer to an estimator_config structure if config_from_ini=0 |
| [in] | config_from_ini | Configuration source flag:
|