
% POLICE_RADAR

function [va] = POLICE_RADAR(rfo)

% CALCULATES THE SPEED OF A MOVING OBJECT USING THE DOPPLER EFFECT

%--------------------------------------------------------------------------

% where:
% va = velocity of target in km/h
% fr = reflected frequency offset in Hz - applies an offset of between
% 1000-7000Hz to the transmitted frequency to keep the reflected frequency within a realistic range

%--------------------------------------------------------------------------

% Input Data

fr   = 10*10^9 + rfo;  % reflected frequency in Hz
ft   = (10*10^9);      % transmitted frequency in Hz
fb   = fr - ft;        % beat frequency in Hz
c    = 3*10^8;         % speed of light in m/s

%--------------------------------------------------------------------------

% Output Data

% fb = (2*vt/c)*ft
% therefore:

vt = (fb*c)/(2*ft);    % velocity of target in m/s
va = vt/1000*60*60     % velocity of target in km/h

%--------------------------------------------------------------------------

end











