相对传统的重构算法,机器学习的优点在于抗噪性。
%%-------------------------------------------------
%%FRI生成输入输出数据,样本集的大小为Total_sample
%%该数据用于训练神经网络
%%Liuzhenhua HIT-ATCI-53
%%2021.09.05-16:30
%%-------------------------------------------------
clc;clear all;close all;
%% FRI信号-Dirac 脉冲信号的建模
rand('state',1);
dt = 0.001; %
T = 1; %仿真时间
t = 0:dt:T; %时间向量
L = 5; %单位时间内的脉冲个数,2*L即为新息率
Total_sample = 100; %样本总数
ak = rand(Total_sample,L); %脉冲的幅值
tk = rand(Total_sample,L);
ak = fix(ak*1000)/1000;
tk = fix(tk*1000)/1000;
N = length(t);
x = zeros(Total_sample,N);
for i = 1:Total_sample
for j = 1:L
x(i,:) = x(i,:) + ak(i,j)*(t == tk(i,j));
end
end
%% 获取信号的傅里叶系数,直接采集低频的傅里叶系数等价于低通滤波
mid = ceil(N/2);
y = zeros(Total_sample,2*L);
for i = 1:Total_sample
F = fftshift(fft(x(i,:))/N);
y(i,:) = F(mid:mid+2*L-1);%取2*L个傅里叶系数
end