MATLAB Framework for Bistatic Spaceborne Radar Coordinate Transformations
Accurate coordinate system transformations are crucial for simulating bistatic spaceborne radar systems. These systems, by definition, have separate transmitter and receiver platforms, necessitating a robust framework for managing different spatial reference frames.
Common Coordinate Systems in Bistatic Radar Simulation
During simulation, several coordinate systems are commonly employed:
- Earth-Centered Inertial (ECI): Originates at Earth's center, fixed with respect to distant stars.
- Earth-Centered, Earth-Fixed (ECEF): Originates at Earth's center and rotates with the Earth.
- Local Tangent Plane (NED - North-East-Down): A local frame aligned with navigation axes.
- Radar Platform Body Frame: Fixed to the radar's physical platform (transmitter or receiver).
- General Cartesian Frame: Allows for arbitrary axis alignment, often used to optimize tracking models.
Core Transformation Principles and MATLAB Implementation
1. Geodetic (LLA) to ECEF Conversion
This conversion utilizes the WGS84 ellipsoid model.
function [x, y, z] = lla2ecef(lat, lon, alt)
% Converts Latitude, Longitude, Altitude (degrees, meters) to ECEF coordinates (meters).
a = 6378137.0; % WGS84 semi-major axis (meters)
f = 1/298.257223563; % WGS84 flattening
e2 = 2*f - f*f; % Square of first eccentricity
lat_rad = deg2rad(lat);
lon_rad = deg2rad(lon);
N = a / sqrt(1 - e2 * sin(lat_rad)^2); % Radius of curvature in the prime vertical
x = (N + alt) * cos(lat_rad) * cos(lon_rad);
y = (N + alt) * cos(lat_rad) * sin(lon_rad);
z = (N*(1 - e2) + alt) * sin(lat_rad);
end
2. ECEF to Local East-North-Up (ENU) Conversion
This transformation requires the latitude and longitude of a reference point.
function [east, north, up] = ecef2enu(x, y, z, ref_lat, ref_lon, ref_alt)
% Converts ECEF coordinates to local ENU coordinates.
% Inputs: target ECEF (x,y,z), reference point LLA (ref_lat, ref_lon, ref_alt).
% Outputs: ENU coordinates (east, north, up).
% Convert reference point from LLA to ECEF
[ref_x, ref_y, ref_z] = lla2ecef(ref_lat, ref_lon, ref_alt);
% Calculate ECEF difference vector
dx = x - ref_x;
dy = y - ref_y;
dz = z - ref_z;
lat_rad = deg2rad(ref_lat);
lon_rad = deg2rad(ref_lon);
% Construct the rotation matrix (ECEF to ENU)
% For ENU: East = -sin(lon)*dx + cos(lon)*dy
% North = -sin(lat)*cos(lon)*dx - sin(lat)*sin(lon)*dy + cos(lat)*dz
% Up = cos(lat)*cos(lon)*dx + cos(lat)*sin(lon)*dy + sin(lat)*dz
rot_matrix = [-sin(lon_rad), cos(lon_rad), 0;...
-sin(lat_rad)*cos(lon_rad), -sin(lat_rad)*sin(lon_rad), cos(lat_rad);...
cos(lat_rad)*cos(lon_rad), cos(lat_rad)*sin(lon_rad), sin(lat_rad)];
% Apply rotation
enu_coords = rot_matrix * [dx; dy; dz];
east = enu_coords(1);
north = enu_coords(2);
up = enu_coords(3);
end
3. Cartesian Coordinate System Transformations via Direction Cosine Matrix
Rtoations between arbitrary Cartesian frames can be achieved using a direction cosine matrix (DCM).
function DCM = buildDCM(angles_rad, rotation_sequence)
% Builds a Direction Cosine Matrix based on Euler angles.
% Inputs: angles_rad = [angle1, angle2, angle3] in radians, rotation_sequence e.g., 'ZYX'.
% Output: DCM matrix.
% Example for 'ZYX' sequence (Yaw, Pitch, Roll)
yaw = angles_rad(1); % psi
pitch = angles_rad(2); % theta
roll = angles_rad(3); % phi
% Z-rotation (Yaw)
Rz = [cos(yaw), -sin(yaw), 0;
sin(yaw), cos(yaw), 0;
0, 0, 1];
% Y-rotation (Pitch)
Ry = [ cos(pitch), 0, sin(pitch);
0, 1, 0;
-sin(pitch), 0, cos(pitch)];
% X-rotation (Roll)
Rx = [1, 0, 0;
0, cos(roll), -sin(roll);
0, sin(roll), cos(roll)];
% Combine rotations according to sequence (e.g., ZYX means Rx * Ry * Rz)
% For a sequence like 'ZYX', the transformation is Rz applied first, then Ry, then Rx.
% So, DCM = Rx * Ry * Rz for transforming from the body frame to the reference frame.
% For transforming from reference to body frame, it's the inverse/transpose.
% Assuming we want to transform a vector from Frame B to Frame A, where Frame B is rotated by 'angles' w.r.t Frame A.
% If sequence is 'ZYX', the rotation matrix from B to A is Rx*Ry*Rz.
% Let's assume 'ZYX' means Yaw, Pitch, Roll are rotations from the reference frame to the body frame.
% Then DCM = Rz * Ry * Rx for transforming from reference frame to body frame.
% For simplicity and common usage in aerospace, let's use ZYX convention where angles are applied in that order.
% DCM = Rz * Ry * Rx; % This is commonly used for fixed-axis rotations.
% For body-fixed rotations, the order is often reversed and depends on convention.
% Let's stick to a ZYX intrinsic rotation sequence for demonstration:
DCM = Rz * Ry * Rx;
end
function transformed_vector = rotateVector(original_vector, DCM)
% Rotates a vector using a Direction Cosine Matrix.
% Inputs: original_vector (column vector), DCM (matrix transforming from original frame to new frame).
% Output: transformed_vector (column vector in the new frame).
transformed_vector = DCM * original_vector;
end
4. Bistatic Radar Target Localization and Transformation Framework
A MATLAB class to encapsulate the simulation and transformation logic.
classdef BistaticRadarSim < handle
properties
transmitterLla; % Transmitter position [lat, lon, alt] (degrees, meters)
receiverLla; % Receiver position [lat, lon, alt] (degrees, meters)
end
methods
function obj = BistaticRadarSim(tx_lla, rx_lla)
% Constructor
obj.transmitterLla = tx_lla;
obj.receiverLla = rx_lla;
end
function [tx_dist, rx_dist, bistatic_dist] = calcBistaticRanges(obj, target_lla)
% Calculates bistatic ranges for a target.
% Input: target_lla [lat, lon, alt]
% Outputs: tx_dist (target-to-tx distance), rx_dist (target-to-rx distance), bistatic_dist (sum).
% Convert all positions to ECEF
target_ecef = lla2ecef(target_lla(1), target_lla(2), target_lla(3));
tx_ecef = lla2ecef(obj.transmitterLla(1), obj.transmitterLla(2), obj.transmitterLla(3));
rx_ecef = lla2ecef(obj.receiverLla(1), obj.receiverLla(2), obj.receiverLla(3));
% Calculate Euclidean distances
tx_dist = norm(target_ecef - tx_ecef);
rx_dist = norm(target_ecef - rx_ecef);
bistatic_dist = tx_dist + rx_dist;
end
function [tx_enu_pos, rx_enu_pos] = targetToLocalFrames(obj, target_lla)
% Transforms target position into the local ENU frames of both platforms.
% Input: target_lla [lat, lon, alt]
% Outputs: tx_enu_pos (target position in TX ENU frame), rx_enu_pos (target position in RX ENU frame).
target_ecef = lla2ecef(target_lla(1), target_lla(2), target_lla(3));
% Convert to TX ENU frame
tx_enu_pos = ecef2enu(target_ecef(1), target_ecef(2), target_ecef(3), ...
obj.transmitterLla(1), obj.transmitterLla(2), obj.transmitterLla(3));
% Convert to RX ENU frame
rx_enu_pos = ecef2enu(target_ecef(1), target_ecef(2), target_ecef(3), ...
obj.receiverLla(1), obj.receiverLla(2), obj.receiverLla(3));
end
end
end
5. Example Usage and Verification
Demonstrates the practical aplication of the developed framework.
% Bistatic Spaceborne Radar Coordinate Transformation Example
clear; clc;
% Define transmitter and receiver locations (example values)
tx_lla_pos = [39.9, 116.4, 500000]; % Transmitter: Lat, Lon (deg), Alt (m)
rx_lla_pos = [34.7, 113.6, 500000]; % Receiver: Lat, Lon (deg), Alt (m)
% Initialize the bistatic radar simulator
radar_system = BistaticRadarSim(tx_lla_pos, rx_lla_pos);
% Define target geodetic coordinates
target_lla_pos = [36.5, 115.0, 10000]; % Target: Lat, Lon (deg), Alt (m)
% Calculate bistatic ranges
[tx_distance, rx_distance, total_bistatic_range] = radar_system.calcBistaticRanges(target_lla_pos);
fprintf('Distance to Transmitter: %.2f km\n', tx_distance/1000);
fprintf('Distance to Receiver: %.2f km\n', rx_distance/1000);
fprintf('Total Bistatic Range Sum: %.2f km\n', total_bistatic_range/1000);
% Transform target position to local ENU frames of TX and RX
[tx_enu_coords, rx_enu_coords] = radar_system.targetToLocalFrames(target_lla_pos);
fprintf('Target position in TX ENU frame: E=%.2f km, N=%.2f km, U=%.2f km\n', ...
tx_enu_coords(1)/1000, tx_enu_coords(2)/1000, tx_enu_coords(3)/1000);
fprintf('Target position in RX ENU frame: E=%.2f km, N=%.2f km, U=%.2f km\n', ...
rx_enu_coords(1)/1000, rx_enu_coords(2)/1000, rx_enu_coords(3)/1000);
% Verification: Convert ECEF back to LLA to check for errors
% Note: A separate ecef2lla function would be needed for this check.
% For demonstration, we'll assume a hypothetical ecef2lla function exists.
% [target_x_ecef, target_y_ecef, target_z_ecef] = lla2ecef(target_lla_pos(1), target_lla_pos(2), target_lla_pos(3));
% [lat_recovered, lon_recovered, alt_recovered] = ecef2lla(target_x_ecef, target_y_ecef, target_z_ecef); % Assumed function
% fprintf('Coordinate Recovery Error: Lat=%.6f°, Lon=%.6f°, Alt=%.2f m\n', ...
% abs(target_lla_pos(1)-lat_recovered), abs(target_lla_pos(2)-lon_recovered), abs(target_lla_pos(3)-alt_recovered));