Agent skill

numpy-fft

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/cuba6112/skillfactory/tree/main/skills/numpy-fft

SKILL.md

Overview

NumPy's fft module provides routines for computing Discrete Fourier Transforms (DFT). It is widely used for signal processing, image frequency analysis, and solving differential equations in the frequency domain.

When to Use

  • Analyzing the frequency components of a time-series signal.
  • Applying low-pass or high-pass filters to digital signals.
  • Accelerating convolutions by performing them in the frequency domain.
  • Visualizing centered frequency spectra in 2D image processing.

Decision Tree

  1. Is your input purely real?
    • Use np.fft.rfft for better efficiency and halved output size.
  2. Do you want the 0Hz component in the center of the plot?
    • Use np.fft.fftshift on the transform result.
  3. Performance is slow?
    • Zero-pad input to a power of 2 (e.g., 256, 1024).

Workflows

  1. Frequency Domain Analysis

    • Take a real-valued signal 'a'.
    • Compute the positive frequencies using np.fft.rfft(a).
    • Generate matching frequency bins with np.fft.rfftfreq(len(a)).
    • Plot the magnitude spectrum using np.abs(spectrum).
  2. FFT-Based Signal Filtering

    • Transform the signal into the frequency domain with np.fft.fft.
    • Zero out specific frequency components in the complex spectrum.
    • Transform back to the time domain using np.fft.ifft and take the real part.
  3. Visualizing Centered Spectra

    • Compute a 2D FFT of an image using np.fft.fft2.
    • Apply np.fft.fftshift to move the low-frequency components to the image center.
    • Visualize the log-magnitude of the shifted spectrum.

Non-Obvious Insights

  • Real Symmetry: rfft is faster because real-input transforms are Hermitian (symmetric); it skips redundant computations.
  • Precision Upcasting: NumPy FFT routines automatically upcast float32 to float64 and complex64 to complex128.
  • Optimal Sizes: Algorithms are most efficient when the signal length $n$ is a power of 2.

Evidence

  • "When the input is purely real... The family of rfft functions is designed to operate on real inputs, and exploits this symmetry by computing only the positive frequency components." Source
  • "The routine np.fft.fftshift(A) shifts transforms and their frequencies to put the zero-frequency components in the middle." Source

Scripts

  • scripts/numpy-fft_tool.py: Routines for spectral analysis and rfft frequency mapping.
  • scripts/numpy-fft_tool.js: Simulated complex magnitude logic.

Dependencies

  • numpy (Python)

References

  • references/README.md

Expand your agent's capabilities with these related and highly-rated skills.

cuba6112/skillfactory

prompt-engineering

Comprehensive prompt engineering techniques for Claude models. Use this skill when crafting, optimizing, or debugging prompts for Claude API, Claude Code, or any Claude-powered application. Covers system prompts, role prompting, multishot examples, chain of thought, XML structuring, long context handling, extended thinking, prompt chaining, Claude 4.x-specific best practices, and agentic orchestration including subagents, agent loops, skills, MCP integration, and multi-agent workflows.

0 0
Explore
cuba6112/skillfactory

adk-rag-agent

Build RAG (Retrieval-Augmented Generation) agents with Google ADK and Vertex AI RAG Engine. Use when implementing document Q&A, knowledge base search, or citation-backed responses. Covers VertexAiRagRetrieval tool, corpus setup, and citation formatting.

0 0
Explore
cuba6112/skillfactory

headless-cli-agents

Build agentic systems using Claude CLI in headless mode or the Claude Agent SDK. Use when building automation pipelines, CI/CD integrations, multi-agent orchestration, or programmatic Claude interactions. Covers CLI flags (-p, --output-format), session management (--resume, --continue), Python SDK (claude-agent-sdk), custom tools, and agent loop patterns.

0 0
Explore
cuba6112/skillfactory

notion-knowledge-capture

Capture conversations and decisions into structured Notion pages; use when turning chats/notes into wiki entries, how-tos, decisions, or FAQs with proper linking.

0 0
Explore
cuba6112/skillfactory

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

0 0
Explore
cuba6112/skillfactory

gh-fix-ci

Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize failure context, then create a fix plan and implement after user approval. Use when a user asks to debug or fix failing PR CI/CD checks on GitHub Actions and wants a plan + code changes; for external checks (e.g., Buildkite), only report the details URL and mark them out of scope.

0 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results