measure_thd
Measure Total Harmonic Distortion (THD) percentage and harmonic components on PicoScope oscilloscope channels 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 for the 'measure_thd' tool, decorated with @mcp.tool(). It currently returns a 'not_implemented' status as a stub 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:14-19 (registration)Registration of analysis tools (including measure_thd) via call to register_analysis_tools(mcp) in the main server setup.# Register all tool categories register_discovery_tools(mcp) register_configuration_tools(mcp) register_acquisition_tools(mcp) register_analysis_tools(mcp) register_advanced_tools(mcp)
- src/picoscope_mcp/tools/analysis.py:9-10 (registration)Function that registers all analysis tools, including measure_thd, by defining them with @mcp.tool() decorators inside it.def register_analysis_tools(mcp: Any) -> None: """Register signal analysis tools with the MCP server."""