Sie sind auf Seite 1von 9

UNIVERSIDAD NACIONAL DE INGENIERÍA

FACULTAD DE INGENIERIA ELÉCTRICA Y ELECTRÓNICA

LABORATORIO DE TELECOMUNICACIONES III

EE515M

INFORME FINAL
“SOFTWARE MATLAB RADAR”
Alumnos

MALLQUI TABOADA, Joel 20120130C

SEGUNDO JIMENEZ, Eisntein V. 20124024C


MUÑOZ CHAVARRY, Huber 20132562K

Horario Lunes 18-21 p.m.

2018-II

Lima, lunes 29 de octubre del 2018


Informe Final: SOFTWARE MATLAB RADAR
Mallqui Taboada, Joel

Segundo Jimenez, Einstein V.

Muñoz Chavarry, Huber

Facultad de Ingeniería Eléctrica y Electrónica, Universidad Nacional de Ingeniería

Lima, Perú

I. OBJETIVO %rango de resolucion


rr = c/(2*BW);
max_range = rr*N/2;
Tratar la señal obtenida del radar en
tiempo real y visualizar en el monitor %the input appears to be inverted
trig = -1*Y(:,1);
mediante el software diseñado y obtener s = -1*Y(:,2);
clear Y;
la respuesta en el tiempo de la distancia y
velocidad. %parse the data here by triggering off
rising edge of sync pulse
count = 0;
II. DATOS OBTENIDOS EN LA thresh = 0;
EXPERIENCIA start = (trig > thresh);
for ii = 100:(size(start,1)-N)
if start(ii) == 1 & mean(start(ii-
Código usado en laboratorio, para disminuir el 11:ii-1)) == 0
ruido, en el rango: %start2(ii) = 1;
count = count + 1;
sif(count,:) = s(ii:ii+N-1);
time(count) = ii*1/FS;
clear all; end
close all; end

[Y,FS] = audioread('profe1.wav'); %subtract the average


ave = mean(sif,1);
%constantes for ii = 1:size(sif,1);
c = 3E8; %(m/s) velocidad de la luz sif(ii,:) = sif(ii,:) - ave;
end
%parametros del radar
Tp = 20E-3; %(s) time de puslo zpad = 8*N/2;
N = Tp*FS; %#de muestras por pulso
fstart = 2260E6; %(Hz) LFM start frequency %RTI plot
for example figure(10);
fstop = 2590E6; %(Hz) LFM stop frequency v = dbv(ifft(sif,zpad,2));
for example S = v(:,1:size(v,2)/2);
%fstart = 2402E6; %(Hz) LFM start m = max(max(v));
frequency for ISM band imagesc(linspace(0,max_range,zpad),time,S-
%fstop = 2495E6; %(Hz) LFM stop frequency m,[-80, 0]);
for ISM band colorbar;
BW = fstop-fstart; %(Hz) transmti ylabel('time (s)');
bandwidth xlabel('range (m)');
f = linspace(fstart, fstop, N/2); title('RTI without clutter rejection');
%instantaneous transmit frequency
%2 pulse cancelor RTI plot
figure(20); c = 3E8; %(m/s) speed of light
sif2 = sif(2:size(sif,1),:)- %radar parameters
sif(1:size(sif,1)-1,:); Tp = 20E-3; %(s) pulse time
v = ifft(sif2,zpad,2); N = Tp*FS; %# of samples per pulse
S=v; fstart = 2260E6; %(Hz) LFM start frequency
R = linspace(0,max_range,zpad); for example
for ii = 1:size(S,1) fstop = 2590E6; %(Hz) LFM stop frequency
%S(ii,:) = S(ii,:).*R.^(3/2); for example
%Optional: magnitude scale to range %fstart = 2402E6; %(Hz) LFM start
end frequency for ISM band
S = dbv(S(:,1:size(v,2)/2)); %fstop = 2495E6; %(Hz) LFM stop frequency
m = max(max(S)); for ISM band
imagesc(R,time,S-m,[0.5*min(min(S-m)), BW = fstop-fstart; %(Hz) transmti
0]); bandwidth
colorbar; f = linspace(fstart, fstop, N/2);
ylabel('time (s)'); %instantaneous transmit frequency
xlabel('range (m)'); %range resolution
title('RTI with 2-pulse cancelor clutter rr = c/(2*BW);
rejection'); max_range = rr*N/2;

y se obtuvieron las siguientes graficas: while 1


clear s;
clear v;
clear Y1;
y1= audiorecorder(44100, 16, 2, 1);
FS=44100;
recordblocking(y1,1);
get(y1);
Y = getaudiodata(y1);
%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;
Figura 1: Grafica del Rango con ruido 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;
Figura 2: Grafica del Rango sin ruido %subtract the average
ave = mean(sif,1);
Código usado en laboratorio, para tratar de for ii = 1:size(sif,1);
sif(ii,:) = sif(ii,:) - ave;
implementar un procesamiento del radar en end
tiempo real:
zpad = 8*N/2;
1. Para el rango usando audio por externo
%RTI plot
clear all; figure(10);
v = dbv(ifft(sif,zpad,2));
close all; S = v(:,1:size(v,2)/2);
m = max(max(v));
%read the raw data .wave file here
%constants imagesc(linspace(0,max_range,zpad),time,S-
FS=44100; m,[-80, 0]);
colorbar;
ylabel('time (s)');
Stop = 1;
xlabel('range (m)');
title('RTI without clutter uicontrol('Style','pushbutton','Strin
rejection'); g','Stop',...
'Callback','Stop = 0;')
%2 pulse cancelor RTI plot
figure(20); %constants
sif2 = sif(2:size(sif,1),:)- c = 3E8; %(m/s) speed of light
sif(1:size(sif,1)-1,:);
v = ifft(sif2,zpad,2);
S=v; %radar parameters
R = linspace(0,max_range,zpad); Tp = 0.250; %(s) pulse time //
tiempo de puslo
for ii = 1:size(S,1) N = Tp*Fs; %# of samples per
%S(ii,:) = S(ii,:).*R.^(3/2); pulse // numero de muestras por pulso
%Optional: magnitude scale to range fc = 2590E6; %(Hz) Center
frequency (connected VCO Vtune to +5
end for example)
%fc = 2495E6; %(Hz) Center
S = dbv(S(:,1:size(v,2)/2)); frequency within ISM band (VCO Vtune
to +3.2V)
m = max(max(S));
while 1
imagesc(R,time,S-m,[-100, 0]); clear s;
clear sif;
colorbar; clear v;
y1= audiorecorder(44100, 16, 2,
ylabel('time (s)'); 1);
xlabel('range (m)');
FS=44100;
title('RTI with 2-pulse cancelor clutter
rejection'); recordblocking(y1,5);
end get(y1);
Y = getaudiodata(y1);
%the input appears to be inverted
// la entrada aparce invertida
s = -1*Y(:,2);
clear Y;

%creat doppler vs. time plot


data set here(establece los datos
aqui)
for i = 1:round(size(s,1)/N)-1 %
i=1 hasta el numero de pulsos
sif(i,:) = s(1+(i-1)*N:i*N); % se
crea la matrix sif ,
end
figura 3: grafica de rango en tiempo real
%subtract the average DC term
here // restamos el DC a sif
2. Para la Velocidad audio externo sif = sif - mean(s); %% mean saca
promedio de los valores de s
clear all;
close all;
zpad = 8*N/2;
%doppler vs. time plot:
clear all; v = dbv(ifft(sif,zpad,2)); % se
close all; llama a la funcion dbv
v = v(:,1:size(v,2)/2); %% gg por
%read the raw data .wave file here que hace esto :(
%[Y,FS] =audioread('Off of Newton mmax = max(max(v));
Exit 17.wav'); % FS= frecuencia de %calculate velocity
muestreo delta_f = linspace(0, Fs/2,
size(v,2)); %(Hz)
lambda=c/fc;
%Y1= audiorecorder(44100, 16, 2, 1); velocity = delta_f*lambda/2;
Fs=44100; %calculate time
time = fstart = 2260E6; %(Hz) LFM start
linspace(1,Tp*size(v,1),size(v,1)); frequency for example
%(sec) fstop = 2590E6; %(Hz) LFM stop
%plot frequency for example
imagesc(velocity,time,v-mmax,[-
35, 0])
%fstart = 2402E6; %(Hz) LFM start
colorbar frequency for ISM bandpl
xlim([0 40]); %limit velocity %fstop = 2495E6; %(Hz) LFM stop
axis frequency for ISM band
xlabel('Velocity (m/sec)') BW = fstop-fstart; %(Hz) transmti
ylabel('time (sec)') bandwidth
f = linspace(fstart, fstop, N/2);
end %instantaneous transmit frequency

Stop = 1;
uicontrol('Style','pushbutton','S
tring','Stop',...
'Callback','Stop = 0;')
%while Stop
%range resolution
rr = c/(2*BW);
max_range = rr*N/2;

for i = 1:81
Figura 4: La grafica se ve afectada por el ruido Ys = Y([((i-
1)*FS+1):1:(i+4)*FS],:);
trig = -1*Ys(:,1);
s = -1*Ys(:,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)
Figura 5: Graficas afectada por el ruido
if start(ii) == 1 &
mean(start(ii-11:ii-1)) == 0
3. Rango Simulando en tiempo real en %start2(ii) = 1;
Matlab count = count + 1;
sif(count,:) =
clc;clear ;close all; s(ii:ii+N-1);
%FS = 44100; time(count) =
%y1= audiorecorder(FS, 16, 2, 1); ii*1/FS;
%%%%%%%%% end
[Y,FS] = audioread('profe1.wav'); end
%constants
c = 3E8; %(m/s) speed of light %subtract the average
L = 44100; ave = mean(sif,1);
%radar parameters for ii = 1:size(sif,1);
Tp = 20E-3; %(s) pulse time sif(ii,:) = sif(ii,:) -
N = Tp*FS; %# of samples per ave;
pulse end
zpad = 8*N/2; c = 3E8; %(m/s) speed of light

%2 pulse cancelor RTI plot %radar parameters on Doppler


sif2 = sif(2:size(sif,1),:)- Td = 0.250; %(s) pulse time
ND = Td*FSD; %# of samples per pulse
sif(1:size(sif,1)-1,:); fc = 2590E6; %(Hz) Center frequency
sif3 = (connected VCO Vtune to +5 for
sif2(2:size(sif2,1),:)- example)
sif2(1:size(sif2,1)-1,:);
sif4 = %radar parameter on Range
sif3(2:size(sif3,1),:)- Tr = 20E-3; %(s) pulse time
sif3(1:size(sif3,1)-1,:); NR = Tr*FSR; %# of samples per pulse
sif5 = fstart = 2260E6; %(Hz) LFM start
sif4(2:size(sif4,1),:)- frequency for example
sif4(1:size(sif4,1)-1,:); fstop = 2590E6; %(Hz) LFM stop
v = ifft(sif2,zpad,2); frequency for example
BW = fstop-fstart; %(Hz) transmti
S=v; bandwidth
R = f = linspace(fstart, fstop, NR/2);
linspace(0,max_range,zpad); %instantaneous transmit frequency
S =
dbv(S(:,1:size(v,2)/2)); %%% DOPPLER
m = max(max(S)); %the input appears to be inverted
A = S-m; sD = -1*Doppler(:,2);
J= A(:,(1:500)); clear Doppler;
k=find(J>-
5,(size(J,1)*size(J,2))); %creat doppler vs. time plot data set
X = zeros(size(A)); here
X(k) = A(k)+10; for ii = 1:round(size(sD,1)/ND)-1
A = A-20; sifD(ii,:) = sD(1+(ii-
1)*ND:ii*ND);
A(k) = X(k); end
imagesc(R,time,A,[-80,
0]); %subtract the average DC term here
colorbar; sifD = sifD - mean(sD);
ylabel('time (s)');
xlabel('range (m)'); zpadD = 8*ND/2;
title('RTI with 2-pulse
cancelor clutter rejection'); %doppler vs. time plot:
pause(1) v1D = dbv(ifft(sifD,zpadD,2));
end vD = v1D(:,1:size(v1D,2)/2);
mmaxD = max(max(vD));
if(Stop < 0.5) %calculate velocity
close all; delta_fD = linspace(0, FSD/2,
size(vD,2)); %(Hz)
end lambda_D=c/fc;
velocity_D = delta_fD*lambda_D/2;
Graficas de Velocidad y rango en una %calculate time
time_D =
misma ventana linspace(1,Td*size(vD,1),size(vD,1));
%(sec)
clear all; %%% END DOPLER
%close all;
clc;
%%% RANGE
%range resolution
%Read DATA rr_R = c/(2*BW);
[Doppler,FSD] = audioread('Off of max_range_R = rr_R*NR/2;
Newton Exit 17.wav');
[Range,FSR] =
%the input appears to be inverted
audioread('profe1.wav');
trig = -1*Range(:,1);
s = -1*Range(:,2);
%constants
clear Range;

%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)-ND)
if start(ii) == 1 &
mean(start(ii-11:ii-1)) == 0
count = count + 1;
sif(count,:) = s(ii:ii+ND-1);
time(count) = ii*1/FSD; Figura 6: Grafica de velocidad y rango en misma ventana
end
end

%subtract the average


ave = mean(sif,1);
for ii = 1:size(sif,1); Velocidad vs Rango
sif(ii,:) = sif(ii,:) - ave;
end clear all;
close all;
zpad = 8*ND/2;
%read the raw data .wave file here
%%% END RANGE [Y,FS] = audioread('Off of Newton
%plot Exit 17.wav');
figure(2)
% PLOT DOPPLER %constants
subplot(1,2,1) c = 3E8; %(m/s) speed of light
imagesc(velocity_D,time_D,vD-mmaxD,[-
35, 0]);
%radar parameters
colorbar;
Tp = 0.250; %(s) pulse time
xlabel('Velocity (m/sec)');
N = Tp*FS; %# of samples per pulse
ylabel('time (sec)');
fc = 2590E6; %(Hz) Center frequency
title('Doppler');
(connected VCO Vtune to +5 for
xlim([0 40]); %limit velocity axis
example)
%PLOT RANGE
%fc = 2495E6; %(Hz) Center frequency
subplot(1,2,2)
within ISM band (VCO Vtune to +3.2V)
sif2 = sif(2:size(sif,1),:)-
sif(1:size(sif,1)-1,:);
v = ifft(sif2,zpad,2); %the input appears to be inverted
S=v; s = -1*Y(:,2);
R = linspace(0,max_range_R,zpad); clear Y;
S = dbv(S(:,1:size(v,2)/2));
m = max(max(S)); %creat doppler vs. time plot data set
imagesc(R,time,S-m,[-80, 0]); here
colorbar; for ii = 1:round(size(s,1)/N)-1
ylabel('time (s)'); sif(ii,:) = s(1+(ii-1)*N:ii*N);
xlabel('range (m)'); end
title('Range');
%subtract the average DC term here
sif = sif - mean(s);

zpad = 8*N/2;

%doppler vs. time plot:


v = dbv(ifft(sif,zpad,2));
v = v(:,1:size(v,2)/2);
mmax = max(max(v));
%calculate velocity
delta_f = linspace(0, FS/2,
size(v,2)); %(Hz)
lambda=c/fc; time(count) = ii*1/FS;
velocity = delta_f*lambda/2; end
%calculate time end
time = %check to see if triggering works
linspace(1,Tp*size(v,1),size(v,1)); % plot(trig,'.b');
%(sec) % hold on;si
%plot % plot(start2,'.r');
imagesc(velocity,time,v-mmax,[-35, % hold off;
0]); % grid on;
colorbar;
xlim([0 40]); %limit velocity axis %subtract the average
xlabel('Velocity (m/sec)'); ave = mean(sif,1);
ylabel('time (sec)'); for ii = 1:size(sif,1);
Do=v-mmax; sif(ii,:) = sif(ii,:) - ave;
clear s; end
clear sif;
clear zpad;
zpad = 8*N/2;

%read the raw data .wave file here


[Y,FS] =
audioread('running_outside_20ms.wav')
; %2 pulse cancelor RTI plot
figure(20);
%constants sif2 = sif(2:size(sif,1),:)-
c = 3E8; %(m/s) speed of light sif(1:size(sif,1)-1,:);
v1 = ifft(sif2,zpad,2);
S=v1;
%radar parameters
R = linspace(0,max_range,zpad);
Tp = 20E-3; %(s) pulse time
for ii = 1:size(S,1)
N = Tp*FS; %# of samples per pulse
%S(ii,:) = S(ii,:).*R.^(3/2);
fstart = 2260E6; %(Hz) LFM start
%Optional: magnitude scale to range
frequency for example
end
fstop = 2590E6; %(Hz) LFM stop
S = dbv(S(:,1:size(v1,2)/2));
frequency for example
m = max(max(S));
%fstart = 2402E6; %(Hz) LFM start
imagesc(R,time,S-m,[-80, 0]);
frequency for ISM band colorbar;
%fstop = 2495E6; %(Hz) LFM stop ylabel('time (s)');
frequency for ISM band xlabel('range (m)');
BW = fstop-fstart; %(Hz) transmti title('RTI with 2-pulse cancelor
bandwidth clutter rejection');
f = linspace(fstart, fstop, N/2);
%instantaneous transmit frequency
%%distancia- velocidad
d=max((S-m)');
%range resolution
v=max((Do)');
rr = c/(2*BW);
max_range = rr*N/2;
for i=1:size(v,2)
[x1(i),y1(i)]=find(S-m==d(i));
%the input appears to be inverted
P(i)=y1(i);
trig = -1*Y(:,1);
end
s = -1*Y(:,2);
clear Y;
for i=1:size(v,2)
[x2(i),y2(i)]=find(Do==v(i));
%parse the data here by triggering end
off rising edge of sync pulse y3=round(y2./11);
count = 0; for i=1:size(v,2)
thresh = 0; for j=1:size(v,2)
start = (trig > thresh); for k=1:size(v,2)
for ii = 100:(size(start,1)-N) if (i==y1(k) && j==y3(k))
if start(ii) == 1 &
a(i,j)=0;
mean(start(ii-11:ii-1)) == 0
a(i+1,j)=-5;
%start2(ii) = 1;
a(i,j+1)=-5;
count = count + 1;
a(i+1,j+1)=-5;
sif(count,:) = s(ii:ii+N-1);
if(i~=1 && j~=1)
a(i-1,j-1)=-5;
a(i+1,j-1)=-5;
a(i-1,j+1)=-5;
a(i-1,j)=-5;
a(i,j-1)=-5;
end
end
end
end
end

velocity = delta_f*lambda/2;
%calculate time
R = linspace(0,max_range,zpad);
%(sec)
%plot
figure Figura 8: Grafica de los puntos de la figura 7 usando potencia
imagesc(velocity,R,a,[-35, 0]);
colorbar;
xlim([0 40]); %limit velocity axis
xlabel('Velocity (m/sec)');
ylabel('Distancia (m)');

figure
plot(y3,y1,'*b')

Observaciones:

-Notamos que al tomar datos de los objetos


en corta distancia del radar se perturba
demasiado, por ende, se recomienda tomar
datos a distancias mayores de 20 metros.

Conclusiones:
Figura 7: Grafica de los puntos Velocidad vs Rango
-Se logró visualizar la distancia recorrida por
el objeto con mayor nitidez a una distancia de
40 metros.

Das könnte Ihnen auch gefallen