-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLSS_FMCW_EMD.m
More file actions
62 lines (53 loc) · 2.33 KB
/
Copy pathLSS_FMCW_EMD.m
File metadata and controls
62 lines (53 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% clc
% close all
% clear all
% format long
%
Br=100e6; %调制带宽
PRT=0.3e-3; %调制周期
Fs=500e3; %采样频率
minR=2; %处理起始距离
maxR=15; %处理终止距离
C=3e8; %光速
PRF=1/PRT; %重复频率
load('E:\桌面\LSS2.0数据\大疆悟2(02)\大疆悟2(02)\180\02-2023.11.15-180-0.3-100-8-K (1).mat')
Echo=echoes.channelA;
Nr=size(Echo,1);
Na=size(Echo,2);
Echo_Postive=Echo(1:floor(Nr/2),:); %取正调频数据
Echo_RDC=Echo_Postive-ones(floor(Nr/2),1)*mean(Echo_Postive,1); %去直流
Nfft=2^(nextpow2(floor(Nr/2))+2); %距离维傅里叶变换点数
EchoFFT=fftshift(fft(Echo_RDC.*(hamming(floor(Nr/2))*ones(1,Na)),Nfft),1);%距离维匹配处理
EchoFFT_Eff=EchoFFT(Nfft/2+1:Nfft,:); %FFT正半轴有效数据
minP=round(Br/(PRT/2)*(2*minR/C)/(Fs/Nfft)); %数据起始点(对应最小距离处)
maxP=round(Br/(PRT/2)*(2*maxR/C)/(Fs/Nfft)); %数据结束点(对应最大距离处)
%Nrp=maxP-minP+1; %处理的距离波门数目
Nrp=maxP-minP+1; %距离波门数目
Rr=linspace(minR,maxR,Nrp);
time=Na*PRT;
EchoFFT_Cut=EchoFFT_Eff(minP:maxP,:);
figure;imagesc(1:Na,Rr,abs(EchoFFT_Cut));axis xy;xlabel('周期数');ylabel('距离(m)');
figure;imagesc(0:time,Rr,abs(EchoFFT_Cut));axis xy;xlabel('时间(s)');ylabel('距离(m)');
[EchoFFT_Cut_De] = Remove_trend_all_CH(EchoFFT_Cut,10);
figure;imagesc(abs(EchoFFT_Cut_De));axis xy;colormap(jet);
figure;imagesc(1:Na,Rr,abs(EchoFFT_Cut_De));axis xy;xlabel('周期数');ylabel('距离(m)');
figure;imagesc(0:time,Rr,abs(EchoFFT_Cut_De));axis xy;xlabel('时间(s)');ylabel('距离(m)');
r1=EchoFFT_Cut(28,1:500);
plot(abs(r1));
%
lengthSignal=length(r1);
nFFT=2^nextpow2(lengthSignal);
T=1:lengthSignal;
Tt = linspace(0,0.15,500);
WinSize=13;
Win=gausswin(WinSize+1-mod(WinSize,2));
timeFrequecy = fftshift(tfrstft(r1' ,T,nFFT, Win),1);
% 假设你的数据存储在变量 timeFrequecy 和 Tt 中
data = db(abs(timeFrequecy)/max(max(abs(timeFrequecy))));
colormap(jet);
xlabel('时间(s)');
ylabel('频率(Hz)');
ylim([-1500,1500]); % 设置 Y 轴范围,先大后小实现反转
figure,imagesc([0,Tt],[-1500 1500],db(abs(timeFrequecy)/max (max(abs(timeFrequecy)))), [-30 0]);
colormap (jet);xlabel('时间(s)');ylabel( '频率(Hz)');
set(gca,'YDir','reverse');