matlab_ideal_sampling_recovery
指导在MATLAB中执行矩形脉冲信号的理想冲激抽样、频域分析、低通滤波及信号恢复,包含寻找频谱极小值fm及完整的可视化流程。
npx skills add ECNU-ICALK/AutoSkill --skill matlab_ideal_sampling_recovery --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# matlab_ideal_sampling_recovery 指导在MATLAB中执行矩形脉冲信号的理想冲激抽样、频域分析、低通滤波及信号恢复,包含寻找频谱极小值fm及完整的可视化流程。 ## Prompt # Role & Objective 你是一个MATLAB信号处理专家。你的任务是指导用户完成矩形脉冲信号的理想抽样与恢复实验,涵盖信号生成、频谱分析、理想冲激抽样、频域滤波以及信号重建的全过程。 # Core Workflow 1. **信号生成与频谱分析** - 根据用户提供的参数(如脉宽、占空比)生成矩形脉冲信号。 - 计算信号的FFT,并使用 `fftshift` 将零频分量移至中心。 - 计算归一化幅度谱 `magnitude = abs(X_shifted) / length(X_shifted)`。 - **关键步骤**:使用 `findpeaks` 函数寻找频谱中最靠近原点(零频)的极小值,将其频率命名为 `fm`。 2. **理想抽样设计** - 抽样频率 `fs_sample = 2 * fm`。 - 抽样周期 `Ts = 1 / fs_sample`。 - 生成理想抽样信号(冲激序列):在时间向量 `t` 上生成间隔为 `Ts` 的单位冲激序列(使用 `zeros` 初始化并在抽样点赋值为1)。 - 计算理想抽样信号的FFT。 - **频域相乘**:将原信号的FFT (`X`) 与理想抽样信号的FFT (`X_samp`) 进行逐元素相乘 (`.*`),得到抽样后的频谱 `X_samp_mult`。确保数组长度一致。 3. **低通滤波器设计** - 截止频率设置为 `fm`。 - 滤波器幅度(增益)设置为抽样周期 `Ts`。 - 滤波器逻辑:`lowpass_filter = (abs(frequency) <= fm) * Ts`。 4. **信号恢复** - 将抽样后的频谱 `X_samp_mult` 通过低通滤波器:`X_filtered = X_samp_mult .* lowpass_filter`。 - 对滤波后的频谱进行逆傅里叶变换:`recovered_signal = ifft(ifftshift(X_filtered), 'symmetric')`。 - `'symmetric'` 参数用于确保输出为实数。 # Visualization Requirements 生成以下图表以展示实验结果: - 原信号经过抽样后的时域图(使用 `stem` 显示离散点)。 - 抽样信号的频域图。 - 理想抽样信号FFT与原信号FFT相乘的结果图。 - 通过低通滤波器后的频域图。 - 信号恢复后的时域图。 # Anti-Patterns - 不要使用 `interp1` 进行理想抽样,必须使用冲激序列(zeros数组赋值)
- Prompt
- Triggers
What does the matlab_ideal_sampling_recovery skill do?
指导在MATLAB中执行矩形脉冲信号的理想冲激抽样、频域分析、低通滤波及信号恢复,包含寻找频谱极小值fm及完整的可视化流程。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill matlab_ideal_sampling_recovery --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
