measure_thd
Calculate Total Harmonic Distortion (THD) percentage and harmonic components from PicoScope oscilloscope signals to analyze signal purity and identify distortion issues.
Instructions
Measure Total Harmonic Distortion (THD).
Args: channel: Channel to measure.
Returns: Dictionary containing THD percentage and harmonic components.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes |
Implementation Reference
- The handler function implementing the 'measure_thd' tool logic. It is decorated with @mcp.tool() for automatic registration with the MCP server. Currently a placeholder with TODO for full implementation.@mcp.tool() def measure_thd(channel: Literal["A", "B", "C", "D"]) -> dict[str, Any]: """Measure Total Harmonic Distortion (THD). Args: channel: Channel to measure. Returns: Dictionary containing THD percentage and harmonic components. """ # TODO: Implement THD measurement return {"status": "not_implemented", "channel": channel}
- src/picoscope_mcp/server.py:18-18 (registration)The call to register_analysis_tools(mcp) in the main server file, which triggers the definition and registration of the measure_thd tool.register_analysis_tools(mcp)
- src/picoscope_mcp/server.py:8-8 (registration)Import of register_analysis_tools from analysis.py in the server.py file, necessary for registering the analysis tools including measure_thd.from .tools.analysis import register_analysis_tools