matlab学习之路

for循环

复制代码
for i = 1:10



end

加载文件

Matlab 复制代码
si = load("E:\xilinx_fpga\lfm_test\matlab\LFM_r_out.dat");

画图的操作

横坐标的量化(pw是时基)

Matlab 复制代码
t = linspace(-pw/2,pw/2,3000);

打开文件

Matlab 复制代码
hi_coefile = fopen('hi_B50M_10us.coe','w');

写文件

Matlab 复制代码
fprintf(hi_coefile,'radix=10;\n');
Matlab 复制代码
fprintf(hi_coefile,'%d;\n',hiw(length(hiw)));

关闭文件(操作完一定要关闭才能刷新):

Matlab 复制代码
fclose all;

序列长度 用于for循环 或者补0操作等

Matlab 复制代码
for coen = 1:length(hqw)-1


end

抽取(其实隔点采样):

Matlab 复制代码
hiw = hiw(1:chouqu:end); 

雷达信号经典生成

Matlab 复制代码
fclk = 300e6;% FPGA时钟
Ts = 1/fclk;
pw = 10e-6;
B = 50e6;
u = B/pw;%调频斜率

t = linspace(-pw/2,pw/2,3000);
h_base = exp(-j*pi*u*t.^2);
hi = real(h_base);
hq = imag(h_base);

stft时频做法

Matlab 复制代码
clc;
clear;
close all;
st_sin = load("E:\xilinx_fpga\lfm_test\matlab\LFM_r_out.dat");
st_cos = load("E:\xilinx_fpga\lfm_test\matlab\LFM_i_out.dat");
st = (st_cos+1i*st_sin)';
fs = 125e6;
window = 80;
[s,f,t] = stft(st(1,:),fs,'Window',hamming(window),'OverlapLength',window-1,'FFTLength',2048);

figure;
imagesc(t*1e6,f*1e-6,abs(s));
xlabel("t/us");ylabel("f/MHz");
set(gca,'YDir','normal');
set(gca,'Fontsize',12);set(gca,'FontWeight','bold');

读取文件

Matlab 复制代码
fid_re1 = fopen('LFM_r_out.dat','r');
x_re1 = fscanf(fid_re1,'%d',[2400,1]);

生成0序列 用于补0 或者生成模板

Matlab 复制代码
a=zeros(1,ChNum);

取序列的最尾数

Matlab 复制代码
dataout1(1:4:end)

向下取整函数

Matlab 复制代码
dataout1(1:4:end)

fft

Matlab 复制代码
fftshift(fft(x_im)
#如果要做2的整数倍 自己加个逗号后面写点数
相关推荐
执笔论英雄6 小时前
【大模型学习cuda】入们第一个例子-向量和
学习
wdfk_prog6 小时前
[Linux]学习笔记系列 -- [drivers][input]input
linux·笔记·学习
Gary Studio8 小时前
rk芯片驱动编写
linux·学习
mango_mangojuice8 小时前
Linux学习笔记(make/Makefile)1.23
java·linux·前端·笔记·学习
lingggggaaaa8 小时前
安全工具篇&动态绕过&DumpLsass凭据&Certutil下载&变异替换&打乱源头特征
学习·安全·web安全·免杀对抗
PP东9 小时前
Flowable学习(二)——Flowable概念学习
java·后端·学习·flowable
学电子她就能回来吗9 小时前
深度学习速成:损失函数与反向传播
人工智能·深度学习·学习·计算机视觉·github
AI视觉网奇10 小时前
ue 角色驱动衣服 绑定衣服
笔记·学习·ue5
wdfk_prog12 小时前
[Linux]学习笔记系列 -- [drivers][input]serio
linux·笔记·学习
ZH154558913113 小时前
Flutter for OpenHarmony Python学习助手实战:GUI桌面应用开发的实现
python·学习·flutter