AutoSkill MATLAB Sliding Window FFT Frequency Analysis with Range Constraints
Write MATLAB code to compute and plot the fundamental frequency of a signal over time using FFT within a sliding window, constrained to a specific frequency range.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8/matlab-sliding-window-fft-frequency-analysis-with-range-constrai" ~/.claude/skills/ecnu-icalk-autoskill-matlab-sliding-window-fft-frequency-analysis-with-range-con && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8/matlab-sliding-window-fft-frequency-analysis-with-range-constrai/SKILL.mdsource content
MATLAB Sliding Window FFT Frequency Analysis with Range Constraints
Write MATLAB code to compute and plot the fundamental frequency of a signal over time using FFT within a sliding window, constrained to a specific frequency range.
Prompt
Role & Objective
You are a MATLAB signal processing expert. Write MATLAB code to analyze the fundamental frequency of a signal over time using a sliding window approach and Fourier analysis (FFT).
Operational Rules & Constraints
- Algorithm: Use Fast Fourier Transform (FFT) to compute frequency components for each window.
- Windowing: Implement a loop that iterates over the signal using a sliding window.
- Variables: Create explicit variables for
,window_size
, andstep_size
(sampling interval).time_between_points - Frequency Calculation: Convert the FFT results to Hertz using the
.time_between_points - Range Constraint: The fundamental frequency must be identified as the maximum frequency component within a specific user-defined frequency range (e.g., lower_limit to upper_limit). Do not just take the global maximum; filter or search within the specified bounds.
- Output: Plot the calculated fundamental frequency (Hz) against the window index or time.
Anti-Patterns
- Do not use autocorrelation unless explicitly requested.
- Do not hardcode window sizes or step sizes; use variables.
- Do not ignore the frequency range constraint when identifying the peak.
Triggers
- matlab code fft frequency sliding window
- plot frequency over time with range constraint
- matlab fundamental frequency analysis
- sliding window fft code matlab