{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": {}, "source": [ "# Exercise on Fundamentals\n", "This notebook reproduces several textbook radar problems, solved with functions from `radarx.fundamentals`.\n", "These probelms are taken from \n", " - Rahman, H. (2019). Fundamental principles of radar. CRC Press." ] }, { "cell_type": "code", "execution_count": null, "id": "1", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "from radarx.fundamentals import constants, doppler, principles, timing, power, system" ] }, { "cell_type": "markdown", "id": "2", "metadata": {}, "source": [ "### Example 2.8 — S‑Band Pulsed Radar\n", "\n", "> **Problem** \n", "> Consider an **S‑band** pulsed radar transmitting **250 kW** of peak power with a pulse width of **1.5 µs** and a PRF of **500 pps**. \n", "> The radar operates at a frequency of **3000 MHz**. \n", "> 1. **(a)** Determine the maximum *unambiguous range*, *range resolution*, and *duty factor*. \n", "> 2. **(b)** Compute the *average transmitted power* and the *energy radiated in the first 10 ms*. \n", "> 3. **(c)** Calculate the *Doppler shift* for a target approaching with a radial velocity of **30 m s⁻¹**.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "3", "metadata": {}, "outputs": [], "source": [ "# Given values\n", "P_peak = 250e3 # W\n", "PRF = 500 # Hz\n", "tau = 1.5e-6 # s\n", "f0 = 3.0e9 # Hz\n", "lam = constants.C / f0\n", "v_r = 30 # m/s\n", "t_interval = 10e-3 # 10 ms\n", "\n", "# (a)\n", "R_unamb = doppler.unambiguous_range(PRF)\n", "R_res = principles.compute_range_resolution(tau)\n", "duty = timing.compute_duty_cycle(tau, PRF)\n", "duty_factor = tau * PRF\n", "\n", "# (b)\n", "P_avg = power.compute_average_power(P_peak, duty)\n", "E_10ms = P_avg * t_interval\n", "\n", "# (c)\n", "f_d = doppler.doppler_frequency_shift(f0, v_r)\n", "\n", "print(f\"Unambiguous range : {R_unamb:,.0f} m\")\n", "print(f\"Range resolution : {R_res:,.2f} m\")\n", "print(f\"Duty cycle : {duty:.4f} (fraction)\")\n", "print(f\"Duty factor (τ·PRF) : {duty_factor:.4f}\")\n", "print(f\"Average power : {P_avg:,.1f} W\")\n", "print(f\"Energy in first 10 ms : {E_10ms:.4f} J\")\n", "print(f\"Doppler shift (30 m/s) : {f_d:.2f} Hz\")" ] }, { "cell_type": "markdown", "id": "4", "metadata": {}, "source": [ "### Example 3.1 — X‑Band Antenna Gain\n", "\n", "> **Problem** \n", "> Calculate the maximum gain of an **X‑band** antenna operating at **8 GHz** with a diameter of **1 m**. \n", "> Repeat for diameters **1.5 m** and **2.0 m**. \n", "> Assume aperture efficiency ρₐ = 1 so Aₑ = A.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "5", "metadata": {}, "outputs": [], "source": [ "f_x = 8e9\n", "lam_x = constants.C / f_x\n", "for D in [1.0, 1.5, 2.0]:\n", " Ae = np.pi * (D / 2) ** 2\n", " G = 4 * np.pi * Ae / lam_x**2 # linear\n", " G_dB = 10 * np.log10(G)\n", " print(f\"Diameter {D:>3.1f} m → Gain = {G_dB:.2f} dB\")" ] }, { "cell_type": "markdown", "id": "6", "metadata": {}, "source": [ "### Example 3.9 — Required Peak Power\n", "\n", "> **Problem** \n", "> An X‑band radar uses the same 3 m circular antenna (efficiency **0.8**) for Tx/Rx at **8 GHz**. \n", "> The system should yield an average received power of **3 × 10⁻¹⁴ W** from a **1 m²** target at **100 km**. \n", "> Total system loss is **3 dB**. Determine the required **transmitter peak power**.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "7", "metadata": {}, "outputs": [], "source": [ "f = 8e9\n", "lam = constants.C / f\n", "D = 3.0\n", "rho = 0.8\n", "R = 100e3\n", "sigma = 1.0\n", "P_rx = 3e-14\n", "L_lin = 10 ** (3 / 10) # 3 dB loss\n", "\n", "Ae = rho * np.pi * (D / 2) ** 2\n", "G = 4 * np.pi * Ae / lam**2\n", "\n", "P_tx = system.solve_peak_power(P_rx, G, lam, sigma, R, L_lin)\n", "P_tx\n", "# print(f\"Required peak power ≈ {P_tx/1e6:.2f} MW\")" ] }, { "cell_type": "markdown", "id": "8", "metadata": {}, "source": [ "### Multipath Propagation Example\n", "\n", "> **Problem** \n", "> A radar at **30 m** height tracks a target at **50 m**, range **40 km**, RCS **4 m²**. \n", "> Antenna gain **34.77 dB**, peak power **1 MW**, frequency **5.4 GHz**. \n", "> Above a smooth plane, estimate: \n", "> 1. **(a)** Multipath propagation factor (two‑ray). \n", "> 2. **(b)** Received signal power.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "9", "metadata": {}, "outputs": [], "source": [ "ht, hr, R = 30.0, 50.0, 40e3\n", "sigma = 4.0\n", "P_t = 1e6\n", "f_c = 5.4e9\n", "lam_c = constants.C / f_c\n", "G_lin = 10 ** (34.77 / 10)\n", "\n", "delta_r = 2 * ht * hr / R\n", "delta_phi = 4 * np.pi * delta_r / lam_c\n", "F = 2 * np.abs(np.cos(delta_phi / 2))\n", "print(f\"Propagation factor |F| ≈ {F:.2f}\")\n", "\n", "P_r = system.radar_equation(P_t, G_lin, lam_c, sigma, R, 1.0) * F**2\n", "print(f\"Received power ≈ {P_r:.2e} W\")" ] }, { "cell_type": "markdown", "id": "10", "metadata": {}, "source": [ "### Missile Doppler Shift\n", "\n", "> **Problem** \n", "> A missile closing at **300 m s⁻¹** is illuminated by a **12 GHz** radar. \n", "> 1. Compute the **exact** Doppler frequency. \n", "> 2. Compute the **approximate** Doppler frequency (v ≪ c).\n" ] }, { "cell_type": "code", "execution_count": null, "id": "11", "metadata": {}, "outputs": [], "source": [ "f0 = 12e9\n", "v = 300\n", "f_d_exact = doppler.doppler_frequency_shift(f0, v, exact=True)\n", "f_d_approx = doppler.doppler_frequency_shift(f0, v, exact=False)\n", "print(f\"Exact Doppler : {f_d_exact:.2f} Hz\")\n", "print(f\"Approx Doppler : {f_d_approx:.2f} Hz\")" ] }, { "cell_type": "code", "execution_count": null, "id": "12", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.6" } }, "nbformat": 4, "nbformat_minor": 5 }