Homemade synthetic aperture radar (4) range code interpretation

I didn't understand the range code at the beginning. I don't know why the range code looks similar to the previous Doppler velocity measurement code. It seems to be looking for ifft, that is, calculating the frequency difference. Why can the frequency difference be able to measure the distance? Didn’t it measure speed before?

Later, I looked for the information of XX2206 first, because the PPT stated that the measurement result should be compared with an output of XX2206. This output pin is a signal similar to a square wave.

XX2206 signal generator:

This is the corresponding development board: http://www.saxmcu.com/XR2206.htm 

I found the development board first, but I can’t understand why pin 3 looks like an input port to adjust the output, but the introduction says it’s an output port, but this board can be bought later and played with it. Oscilloscope output and the like.

这是datasheet:https://pdf1.alldatasheetcn.com/datasheet-pdf/view/80496/EXAR/XR2206.html

Then I looked at the chip data and found that the schematic diagram of this radar is basically an example of a datasheet. Although the datasheet also says that this is an output port, the circuit is similar.

The chip information finally gave the equivalent circuit diagram inside the chip, which is composed of a stack of diode triodes.

Later, I read the following article and I basically know why.

http://www.docin.com/p-2048157065.html

There is also an article with pictures, which is more detailed.

https://www.sohu.com/a/203541554_695278

 

If it is a chirp signal, due to the time difference between transmission and reception, the two chirp signals have different frequencies in the mixer. The output result is a single tone signal. The frequency corresponds to the frequency difference between the two chirps, which can reflect the difference between them. What a delay. But this calculation result assumes that the reflective object is forbidden to move, that is, there is no Doppler shift. If the reflecting object is in motion, another frequency difference will indeed be generated, so that the speed and distance measurement will be coupled, which means there will be problems.

So this is why the previous speed measurement experiment, whether it is SDR or hardware radar, the signal source is a fixed frequency cosine wave (CW), not a chrip.

 

Of course, speed measurement and distance measurement can be achieved at the same time in some way. At this time, triangle wave is used, because the frequency change of the triangle wave is opposite during the rising and falling process, but the frequency change of Doppler shift is constant. The two frequency changes can be separated in this way.

But in our experiment, it is only a ramp signal, a sawtooth wave, not a triangle wave, so now we can only measure distance. Moreover, it is necessary to find the place where the sawtooth wave starts when measuring distance, which is why the 11-pin synchronization signal is needed.

By measuring the frequency of the mixed output signal of the two chirp signals, you can know how much the two chirp signals are offset, and you can calculate the distance. The distance is also obtained by measuring the frequency, so it can be achieved by using ifft.

clear all;
close all;

%read the raw data .wave file here
[Y,FS,NBITS] = wavread('running_outside_20ms.wav');

%constants
c = 3E8; %(m/s) speed of light

%radar parameters
Tp = 20E-3; %(s) pulse time
N = Tp*FS; %# of samples per pulse
fstart = 2260E6; %(Hz) LFM start frequency for example
fstop = 2590E6; %(Hz) LFM stop frequency for example
%fstart = 2402E6; %(Hz) LFM start frequency for ISM band
%fstop = 2495E6; %(Hz) LFM stop frequency for ISM band
BW = fstop-fstart; %(Hz) transmti bandwidth
f = linspace(fstart, fstop, N/2); %instantaneous transmit frequency

%range resolution
rr = c/(2*BW);
max_range = rr*N/2;

%the input appears to be inverted
trig = -1*Y(:,1);
s = -1*Y(:,2);
clear Y;

%parse the data here by triggering off rising edge of sync pulse
count = 0;
thresh = 0;
start = (trig > thresh);
for ii = 100:(size(start,1)-N)
    if start(ii) == 1 & mean(start(ii-11:ii-1)) == 0
        %start2(ii) = 1;
        count = count + 1;
        sif(count,:) = s(ii:ii+N-1);
        time(count) = ii*1/FS;
    end
end
%check to see if triggering works
% plot(trig,'.b');
% hold on;si
% plot(start2,'.r');
% hold off;
% grid on;

%subtract the average
ave = mean(sif,1);
for ii = 1:size(sif,1);
    sif(ii,:) = sif(ii,:) - ave;
end

zpad = 8*N/2;

%RTI plot
figure(10);
v = dbv(ifft(sif,zpad,2));
S = v(:,1:size(v,2)/2);
m = max(max(v));
imagesc(linspace(0,max_range,zpad),time,S-m,[-80, 0]);
colorbar;
ylabel('time (s)');
xlabel('range (m)');
title('RTI without clutter rejection');

%2 pulse cancelor RTI plot
figure(20);
sif2 = sif(2:size(sif,1),:)-sif(1:size(sif,1)-1,:);
v = ifft(sif2,zpad,2);
S=v;
R = linspace(0,max_range,zpad);
for ii = 1:size(S,1)
    %S(ii,:) = S(ii,:).*R.^(3/2); %Optional: magnitude scale to range
end
S = dbv(S(:,1:size(v,2)/2));
m = max(max(S));
imagesc(R,time,S-m,[-80, 0]);
colorbar;
ylabel('time (s)');
xlabel('range (m)');
title('RTI with 2-pulse cancelor clutter rejection');

% %2 pulse mag only cancelor
% figure(30);
% clear v;
% for ii = 1:size(sif,1)-1
%     v1 = abs(ifft(sif(ii,:),zpad));
%     v2 = abs(ifft(sif(ii+1,:),zpad));
%     v(ii,:) = v2-v1;
% end
% S=v;
% R = linspace(0,max_range,zpad);
% for ii = 1:size(S,1)
%     S(ii,:) = S(ii,:).*R.^(3/2); %Optional: magnitude scale to range
% end
% S = dbv(S(:,1:size(v,2)/2));
% m = max(max(S));
% imagesc(R,time,S-m,[-20, 0]);
% colorbar;
% ylabel('time (s)');
% xlabel('range (m)');
% title('RTI with 2-pulse mag only cancelor clutter rejection');

Now look at the code. It can be seen that the bandwidth is about 300MHz (2590-2260), and the bandwidth is inversely proportional to the range resolution. If we use LimeSDR as a radar, the resolution will be reduced by 5 times.

This time the left channel data collected by the sound card is also used, named trig, and the right channel is stored in s.

start = (trig> thresh);
I didn't understand this sentence at first, but later I learned that it is actually a function. That is to say, compare each trig (the value of the left channel). If it is greater than thresh, it is greater than 0, and start is 1, otherwise start is 0. In this way, when the square wave is above the horizontal axis, start is all 1, and below the horizontal axis is all 0.

The following loop is looking for the position of ii. The 11 values ​​of start before this position are all 0, and after ii, the start is 1, which means that the square wave in front of this position is below the horizontal axis, and the square wave is above the horizontal axis at this position. , Then this ii value is the beginning position of the waveform we want to save, and the waveform length is fixed at N=20ms. Cut it from the corresponding position of the s array and store it in sif.

Because several pieces of data that meet the requirements may be intercepted, each piece is stored in a row, and the row number is count.

This sif is the signal after chirp mixing. Next, remove the dc component of sif, and then do an ifft transformation on sif to find the frequency of the signal after chirp mixing, which corresponds to the distance.

The following 2 pulse canceler takes into account the result of the mixed output signals of the adjacent two segments, and the output image is clearer.

I think I can actually use gnuradio instead of matlab to do it, and gnuradio can directly input and read data from the sound card line. In this way, the data processing of the hardware radar can also be in gnuradio. But if it is an SDR radar, although the chirp can be generated, the square wave does not know how to make it better. I don’t know the relationship between XR2206's square wave and ramp, and it seems that when the square wave is below the horizontal axis, the mixed output image is similar to that on the top of the horizontal axis, but is it reversed?

Guess you like

Origin blog.csdn.net/shukebeta008/article/details/108388059