DF_gen - d = 0.4 ff = 400 ww = 2*pi*ff c = 1000/3 lambda =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function [X1,X2,theta] = DF_gen(xx) %DF_GEN generate complex amplitudes at the two receivers % for the Direction Finding Lab % usage [X1,X2,theta] = DF_gen; % % X1 = complex amplitude at Receiver #1 % X2 = complex amplitude at Receiver #2 % theta = the TRUE value of the "direction" in DEGREES % alternate usage: % [X1,X2,theta] = DF_gen(xx); % xx = vector of "x positions" of the vehicle % then X1, X2 and theta are vectors
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: d = 0.4; ff = 400; ww = 2*pi*ff; c = 1000/3; lambda = c/ff; yr = 100; if nargin==0 xx = 2*yr*randn; elseif nargin>1 error('>>>DF_GEN: number of input args can be zero or one') end p1 = 1i*yr - xx; p2 = 1i*yr + d - xx; R1 = abs(p1); R2 = abs(p2); X0 = 1000*exp(1i*2*pi*rand); %--- initial amp & phase X1 = X0*exp(1i*ww*R1/c)./R1; X2 = X0*exp(1i*ww*R2/c)./R2; theta = (180/pi)*angle(1i*yr - xx) - 90; t...
View Full Document

This note was uploaded on 04/15/2010 for the course ECTE 906 taught by Professor Pd during the Three '10 term at University of Wollongong, Australia.

Ask a homework question - tutors are online