[Radar communication] Doppler continuous wave velocity measurement based on matlab [including Matlab source code 642]

1. Introduction

1 Doppler effect
There are many Doppler effects in our daily lives. For example, when an ambulance comes oncoming, the sound is higher than the original; when the car leaves, the pitch of the sound is lower than the original.
This effect is named in honor of the Austrian physicist and mathematician Christian Johann Doppler (Christian Johann Doppler), who first proposed this theory in 1842. It is said that once a train passed by him, he found that the whistle became louder and the pitch became sharper when the train was approaching, and the siren sound became weaker and the pitch became lower when the train approached. He found it very interesting, so he went to in-depth study of this phenomenon, and thus proposed the Doppler effect.
The main content of the Doppler effect is that the wavelength of the object radiation changes due to the relative motion of the wave source and the observer. In front of the moving wave source, the wave is compressed, the wavelength becomes shorter, and the frequency becomes higher (blue shift); behind the moving wave source, the opposite effect will be produced. The wavelength becomes longer and the frequency becomes lower (red shift); the higher the speed of the wave source, the greater the effect. According to the degree of wave red (blue) shift, the speed at which the wave source moves along the observation direction can be calculated.

2 Doppler effect in satellite navigation
Insert picture description here
3 Doppler fixed speed
Insert picture description here
Insert picture description here
Insert picture description here

Second, the source code


AI = ('winsound');   
%2. Add channels - Add one channel to AI. chan = addchannel(AI,1);   
%3. Configure property values - Assign values to the basic setup properties, and  
%create the variables blocksize and Fs, which are used for subsequent analysis.  
%The actual sampling rate is retrieved since it may be set by the engine to a  
%value that differs from the specified value.  
%set(AI,'SampleRate',8000)                             
% 设置采样速率为8000Hz 
ActualRate = get(AI,'SampleRate');                    
% 从AI中获取实际采样速率 
set(AI,'TriggerChannel',chan)                         
% 设置触发通道 
set(AI,'TriggerType','software');                    
% 设置触发类型  
set(AI,'Triggercondition','rising');                  
% 设置为电压上升至某值后触发 
set(AI,'TriggerConditionValue',0.013);                
% 设置触发电压值 
set(AI, 'TriggerDelay', -1);                          
% 设置触发时延  
set(AI, 'TriggerDelayUnits', 'seconds');              
% 设置触发时延的单位 
set(AI,'timeout',2)                                   
% 定义超时值 
Fs = ActualRate;                                      
% 设置采样速率   
clear data1;  
start(AI)                                             
% 开始采样 
try       
[data1,time]=getdata(AI);                         
% 将采样得到的数据保存到data1,采样时间保存到time  
catch time=0;data1=0;      
disp('A timeout occurred.'); 
end
subplot(2,1,1)                                       
% 绘制21列的第1张子图 
plot(time,data1)                                      
% 以时间为横轴,数据为纵轴作图 
xlabel('Time (sec.)')                                 
% 标注横坐标 
ylabel('Signal Level (Volts)')                       
% 标注纵坐标 
grid on                                               
% 添加网格
% 对滤波处理后的数据作FFT频谱分析,并将结果在第二张子图上作图表示,加上横纵坐标和标题  
[f,mag] = daqdocfft(data1,Fs,blocksize);              % 此函数为MATLAB自带   
%MIT IAP Radar Course 2011
%Resource: Build a Small Radar System Capable of Sensing Range, Doppler, 
%and Synthetic Aperture Radar Imaging 
%
%Gregory L. Charvat

%Process Doppler vs. Time Intensity (DTI) plot

%NOTE: set Vtune to 3.2V to stay within ISM band and change fc to frequency
%below

clear all;
close all;

%read the raw data .wave file here
[Y,FS] = audioread('Off of Newton Exit 17.wav');
%constants
c = 3E8; %(m/s) speed of light

%radar parameters
 Tp= 0.250; %(s) pulse time
N = Tp*FS; %# of samples per pulse / Fs 是采样率,N表示在一个脉冲时间采了多少个点
fc = 2544.2E6; %(Hz)  Center frequency (connected VCO Vtune to +5 for example)
%fc = 2495E6; %(Hz) Center frequency within ISM band (VCO Vtune to +3.2V)

%the input appears to be inverted
s = -1*Y(:,2); % 矩阵Y的第二列都乘-1,得到的结果只有Y的第二列乘以-1,s是个列矩阵
%clear Y;

%figure;
%subplot(1,2,2)
%plot(Y(:,2));


%creat doppler vs. time plot data set here
%Temp1 = round(size(s,1)/N)-1;       % 除以 N 计算需要多少个脉冲时间
for ii = 1:round(size(s,1)/N)-1     % size(s,1)返回s的行数,round四舍五入,s的行数除以N之后,四舍五入再减1
    sif(ii,:) = s(1+(ii-1)*N:ii*N); % 将 s 中的 1+(ii-1*N 到 ii*N 行第一个元素(s为列向量),放到 sif 的第ii行 ,一个脉冲时间的数据放一行
end

%subtract the average DC term here
sif = sif - mean(s);

zpad = 8*N/2;% ifft的计算长度

%doppler vs. time plot:
v = dbv(fft(sif,zpad,2));% 按行进行ifft,列数变成了sif的4%Temp2 = v;
v = v(:,1:size(v,2)/2);   % size(v,2)返回 v 的列数,v 的列数除以2, v 的122050(size(v,2)/2)列,构成新的 v
mmax = max(max(v));    % 取出 v 里面最大的元素,第一次行最大元素,第二次所有元素中最大的元素
%calculate velocity
 
subplot(1,2,1)
imagesc(velocity,time,v-mmax,[-35, 0]);  %四个参数??
colorbar;
xlim([0 40]); %limit velocity axis
 
ylabel('time (sec)');

Three, running results

Insert picture description here

Four, remarks

Complete code or write on behalf of adding QQ 1564658423

Guess you like

Origin blog.csdn.net/TIQCmatlab/article/details/115292689