🌊 水声时变信道估计仿真平台
LMS/RLS/SFTF 三优化器统一框架 · delay tracking 可切换 · 批量回归与批量绘图双链路
📌 为什么选择本平台?
水声通信时变信道估计常见难点不是"公式有没有",而是"工程链路是否完整、结果是否可复核、批量比较是否公平"。本平台以统一配置与统一评估口径把这三件事一次做完整。
| 常见痛点 | 本平台实现 |
|---|---|
| 🔴 单次脚本能跑,但不同优化器难公平比较 | ✅ 固定随机种子逐 case 复位,统一 LMS/RLS/SFTF × delay_tracking 六组合 |
| 🔴 结果只有图,没有结构化指标 | ✅ 输出 regression_report.md + regression_results.mat,含稳态误差与收敛速度指标 |
| 🔴 批量绘图易卡顿或中断 | ✅ 批量绘图默认 print 后端 + 失败隔离,单 case 异常不阻塞全流程 |
| 🔴 图形结果分散,难检索复查 | ✅ 时间戳运行目录 + case 子目录,主图/子图/演示图命名统一 |
| 🔴 文档和代码脱节 | ✅README + 算法文档 + 代码文档 + 本项目文档 四层协同,定位清晰 |
🎯 核心价值
🔬 算法研究价值
- 完整覆盖时变信道估计主链:训练信号生成、接收合成、同步重采样、估计更新、相位与时延跟踪。
- 统一优化器入口:
optim=1/2/3对应 LMS/RLS/SFTF,便于同口径对比。 - 统一评估指标:稳态误差、收敛样本、收敛符号数、运行耗时四维量化。
- 统一可视化结果:主图、子图、三张演示图同一风格导出。
💼 工程落地价值
- 配置集中:
build_config.m一处管理general/signal/scene/estimation/plot/regression/plot_suite。 - 入口清晰:单次入口 + 数值回归入口 + 图集批量入口三分职责。
- 产物可追溯:按时间戳目录落盘,报告与 MAT 汇总可直接归档。
- 稳定性机制:失败隔离、阶段耗时记录、导出后端可控。
⚡ 技术亮点
- 发射端:BPSK 训练 + 升采样 + 调制 + 保护间隔;
- 信道端:线性时延多径 + 比例多普勒 + 归一化 + 高斯噪声;
- 估计端:统一误差框架下的 LMS / RLS / SFTF;
- 跟踪端:二阶 PLL + 分数时延插值;
- 评估端:稳态误差、收敛速度与运行时长的多目标排序。
🏗️ 完整模块架构
estimate-main/
├── main.m
├── run_regression_suite.m
├── run_optimizer_plot_suite.m
├── src/
│ ├── common/
│ │ ├── build_config.m
│ │ ├── print_stage.m
│ │ └── format_latex_number.m
│ ├── signal/
│ │ ├── generate_training_signal.m
│ │ └── synthesize_multipath_receive.m
│ ├── estimate/
│ │ ├── build_estimation_params.m
│ │ ├── validate_estimation_input.m
│ │ ├── estimate_time_varying_channel.m
│ │ └── evaluate_regression_metrics.m
│ ├── io/
│ │ ├── build_output_structs.m
│ │ ├── save_estimation_result.m
│ │ ├── export_figures_png.m
│ │ ├── write_regression_markdown.m
│ │ └── write_optimizer_plot_index.m
│ └── visualize/
│ └── plot_channel_results.m
└── docs/
├── 算法文档.md
├── 代码文档.md
└── 项目文档.md
🔁 批量链路能力
- 数值回归链路:
- 入口:
run_regression_suite("quick"|"standard") - 组合:
optim_list=[1,2,3]×delay_tracking_list=[false,true] - 输出:
regression_report.md、regression_results.mat
- 入口:
- 图集批处理链路:
- 入口:
run_optimizer_plot_suite("quick"|"standard") - 每个成功 case 输出 8 张 PNG(主图 + 子图/演示图)
- 输出:
optimizer_plot_index.md、optimizer_plot_summary.mat
- 入口:
🖼️ 导出稳定性
- 单次流程使用
plot.export_backend="auto"。 - 批量绘图默认
plot_suite.export_backend="print",规避图形握手阻塞。 - 全流程仅导出 PNG,新产物不生成 PDF。
📊 性能实测
运行配置摘要:
- 模式:
standard - 训练长度:
131071 - 成功率:
6/6 - 子图导出:
开
| case_id | 优化器 | 跟踪 | 总耗时(s) |
|---|---|---|---|
| lms_tracking_off | LMS | 关 | 17.135 |
| rls_tracking_off | RLS | 关 | 230.670 |
| sftf_tracking_off | SFTF | 关 | 15.355 |
| lms_tracking_on | LMS | 开 | 11.804 |
| rls_tracking_on | RLS | 开 | 286.892 |
| sftf_tracking_on | SFTF | 开 | 14.289 |
💻 核心代码展示
🔥 片段 1:单次入口六阶段调度(main.m)
cfg = build_config();
[data_in, scene_info] = generate_training_signal(cfg.general, cfg.signal, cfg.scene);
data_in.r = synthesize_multipath_receive(data_in, cfg.signal, scene_info);
est_params = build_estimation_params(data_in, cfg);
[h_hat, phase_track, err_track] = estimate_time_varying_channel(data_in, est_params);
[params, meta] = build_output_structs(cfg.general, cfg.signal, scene_info, est_params);
save_estimation_result(save_path_no_ext, h_hat, phase_track, params, meta, est_params, cfg.general.version);
figs = plot_channel_results(h_hat, phase_track, err_track, params, meta, plot_cfg);
export_figures_png(figs, save_path_no_ext, cfg.general.export_resolution, cfg.general.show_log, cfg.plot);
说明:主入口只做流程编排,不承载算法细节,模块职责边界清晰。
🚀 片段 2:估计核心主循环骨架(estimate_time_varying_channel.m)
for n = K_2 * nsd : length(d_all) - K_1 * nsd
window = -K_2 * nsd + (L:-1:1) + n;
x = d_all(window);
v_hat = h_hat' * x;
if ~delay_tracking
v_tilde = v(n, :).' .* exp(-1j * theta_hat(:, n));
else
% 分数时延插值路径
...
end
err = v_tilde - v_hat;
if optim == 1
h_hat = h_hat + update_lms(x, err, mu);
elseif optim == 2
[W, P] = update_rls(inputs_rls, errors_rls, lambda, P);
h_hat = h_hat + W;
else
% SFTF 递推更新
...
end
end
说明:同一主循环容纳三类优化器,保证比较口径一致。
🧩 片段 3:PNG 导出后端选择(export_figures_png.m)
selected_backend = resolve_export_backend(plot_cfg);
for k = 1:numel(fig_names)
if selected_backend == "print"
print_png(fig_handle, export_file, resolution_dpi);
else
try
exportgraphics(fig_handle, export_file, "Resolution", resolution_dpi);
catch
print_png(fig_handle, export_file, resolution_dpi);
end
end
end
说明:批量绘图默认 print,单次流程按 auto 选择,兼顾稳定性与展示效果。
🎬 一键运行
% 进入工程目录后
main
% 批量回归(推荐先 quick)
run_regression_suite("quick")
run_regression_suite("standard")
% 多优化器批量图集
run_optimizer_plot_suite("quick")
run_optimizer_plot_suite("standard")
🖼️ 输出预览





🛒 获取方式
本文代码仅为核心片段,完整版工程已整理好。
🖥️ 运行环境
- MATLAB:R2025b(当前工程运行环境)
- 主要依赖:MATLAB 基础函数与信号处理相关函数(
resample、xcorr、findpeaks、pagemtimes等) - 输出格式:MAT + PNG + Markdown
📚 参考文献
1\] J. G. Proakis and M. Salehi, *Digital Communications* , 5th ed., McGraw-Hill, 2008. \[2\] S. Haykin, *Adaptive Filter Theory* , 5th ed., Pearson, 2013. \[3\] M. Stojanovic and J. Preisig, "Underwater acoustic communication channels: Propagation models and statistical characterization," *IEEE Communications Magazine* , 2009. \[4\] H. Meyr, M. Moeneclaey, and S. Fechtel, *Digital Communication Receivers: Synchronization, Channel Estimation, and Signal Processing*, Wiley, 1997.