# 雷达模糊函数及MATLAB仿真（一）

## 二、Matlab 仿真

### 1、单脉冲模糊函数

#### ①、MATLAB 源码

single_pulse_ambg.m

function x = single_pulse_ambg (taup)
%colormap (gray(1))
eps = 0.000001;
i = 0;
taumax = 1.1 * taup;
taumin = -taumax;
for tau = taumin:.05:taumax
i = i + 1;
j = 0;
for fd = -5/taup:.05:5/taup %-2.5:.05:2.5
j = j + 1;
val1 = 1. - abs(tau) / taup;
val2 = pi * taup * (1.0 - abs(tau) / taup) * fd;
x(j,i) = abs( val1 * sin(val2+eps)/(val2+eps));
end
end


Fig4_2.m

close all
clear all
eps = 0.000001;
taup = 2.;
taumin = -1.1 * taup;
taumax = -taumin;
x = single_pulse_ambg(taup);
taux = taumin:.05:taumax;
fdy = -5/taup:.05:5/taup;
figure(1)
mesh(taux,fdy,x);
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')
zlabel ('Ambiguity function')
%colormap([.5 .5 .5])
%colormap (gray)
figure(2)
contour(taux,fdy,x);
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')
%colormap([.5 .5 .5])
%colormap (gray)
grid
y = x.^2;
figure(3)
mesh(taux,fdy,y);
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')
zlabel ('Ambiguity function')
%colormap([.5 .5 .5])
%colormap (gray)
figure(4)
contour(taux,fdy,y);
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')
%colormap([.5 .5 .5])
%colormap (gray)
grid


### 2、单脉冲多普勒频率轴上的切面

#### ①、MATLAB 源码

fig4_4.m

close all
clear all
eps = 0.0001;
taup = 2.;
fd = -10./taup:.05:10./taup;
uncer = abs( sinc(taup .* fd));
ambg = uncer.^2;
plot(fd, ambg,'k')
xlabel ('Frequency - Hz')
ylabel ('Ambiguity - Volts')
grid
figure(2)
plot (fd, uncer,'k');
xlabel ('Frequency - Hz')
ylabel ('Uncertainty - Volts')
grid


### 3、LFM 信号模糊函数

#### ①、MATLAB 源码

lfm_ambg.m

function x = lfm_ambg(taup, b, up_down)
eps = 0.000001;
i = 0;
mu = up_down * b / 2. / taup;
delt = 2.2*taup/250;
delf = 2*b /250;
for tau = -1.1*taup:.05:1.1*taup
i = i + 1;
j = 0;
for fd = -b:.05:b
j = j + 1;
val1 = 1. - abs(tau) / taup;
val2 = pi * taup * (1.0 - abs(tau) / taup);
val3 = (fd + mu * tau);
val = val2 * val3;
x(j,i) = abs( val1 * (sin(val+eps)/(val+eps))).^2;
end
end


fig4_5.m

close all
clear all
eps = 0.0001;
taup = 1.;
b =10.;
up_down = 1.;
x = lfm_ambg(taup, b, up_down);
taux = -1.1*taup:.05:1.1*taup;
fdy = -b:.05:b;
figure(1)
mesh(taux,fdy,x)
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')
zlabel ('Ambiguity function')
figure(2)
contour(taux,fdy,x)
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')
y = sqrt(x);
figure(3)
mesh(taux,fdy,y)
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')
zlabel ('Uncertainty function')
figure(4)
contour(taux,fdy,y)
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')


|
7天前
|

m基于Q-Learning强化学习的路线规划和避障策略matlab仿真
MATLAB 2022a仿真实现了Q-Learning算法在路线规划与避障中的应用，展示了智能体在动态环境中学习最优路径的过程。Q-Learning通过学习动作价值函数Q(s,a)来最大化长期奖励，状态s和动作a分别代表智能体的位置和移动方向。核心程序包括迭代选择最优动作、更新Q矩阵及奖励机制（正奖励鼓励向目标移动，负奖励避开障碍，探索奖励平衡探索与利用）。最终，智能体能在复杂环境中找到安全高效的路径，体现了强化学习在自主导航的潜力。
13 0
|
1天前
|

16 5
|
2天前
|

14 1
|
5天前
|

m基于BP译码算法的LDPC编译码matlab误码率仿真,对比不同的码长
MATLAB 2022a仿真实现了LDPC码的性能分析，展示了不同码长对纠错能力的影响。短码长LDPC码收敛快但纠错能力有限，长码长则提供更强纠错能力但易陷入局部最优。核心代码通过循环进行误码率仿真，根据EsN0计算误比特率，并保存不同码长（12-768）的结果数据。
26 9
|
8天前
|

17 4
|
9天前
|

18 0
|
9天前
|

18 1
|
9天前

44 1
|
9天前
|

32 0
|
9天前
|

20 1