├── RCS_Estimation.m ├── README.md ├── Toolbox ├── LDS.m ├── SFCW_Freq.m ├── baseband_phase.m ├── discrete_int.m ├── estimate_sigma.m ├── heaviside.m ├── spektrum.m └── timeToInt.m ├── test.m └── untitled.m /RCS_Estimation.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbmueller/RCS_Estimation/d47ae73b9463b327d062f72b726b2905422675d8/RCS_Estimation.m -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | RCS Radar Simulator for Matlab 2 | ======== 3 | 4 | **About this project** 5 | 6 | This work is part of my bachelor thesis at the [Communications Engineering Lab](http://www.cel.kit.edu/) of the Karlsruhe Institute of Technology. 7 | 8 | The goal of this project is to develop a MATLAB simulation for a stepped frequency continuous wave (SFCW) radar to estimate the radar cross section (RCS) of given objects. Swerling models should be taken into account. 9 | 10 | **Alpha Version** 11 | 12 | The source code is still in development, so most of the functionality is still missing. 13 | 14 | **Hints** 15 | 16 | To start the simulation, execute `RCS_Estimation` in Matlab. Most parameters can be set in the parameters section of the source code (line `14`). 17 | 18 | The following assumptions where taken: 19 | 20 | - The distance of the objects is large in relation to the distance it will move during the measurement (R = const.) 21 | - The target is static (for now v = 0) -------------------------------------------------------------------------------- /Toolbox/LDS.m: -------------------------------------------------------------------------------- 1 | function Hpsd = LDS(y, N, f_a) 2 | %LDS generates the power spectral density and frequency vector for a signal y 3 | % Input: 4 | % y: signal vector 5 | % N: N-point-fft 6 | % f_a: sampling frequency 7 | % Output: 8 | % y_psd: psd vector 9 | % f_psd: frequency vector 10 | 11 | Pxx = abs(fft(y, N)).^2/length(y)/f_a; 12 | Hpsd = dspdata.psd(Pxx(1:length(Pxx)/2), 'f_a', f_a); 13 | end -------------------------------------------------------------------------------- /Toolbox/SFCW_Freq.m: -------------------------------------------------------------------------------- 1 | function [ f ] = SFCW_Freq( t, T, f_0, B, n, N ) 2 | %SFCW_Freq generates frequency vector for SFCW Radar 3 | % Input: 4 | % t: time vector 5 | % T: periodic time 6 | % f_0: center frequency 7 | % B: sweep frequency (symm. around f_0) 8 | % n: steps per flank 9 | % N: measuring intervals 10 | % Output: 11 | % f: frequency vector 12 | % 13 | % Example: SMCW_Freq() 14 | 15 | dt = T/(2*n); % time step 16 | df = B/n; % frequency step 17 | f = f_0 - B/2; % start frequency (minimal freq) 18 | 19 | % measuring intervals loop 20 | for j=0:1:N-1 21 | %% rising flank 22 | 23 | % step loop 24 | for i=j*2*n+1:1:(2*j+1)*n 25 | f = f + df*heaviside(t-i*dt); 26 | end 27 | 28 | %% falling flank 29 | 30 | %step loop 31 | for i=(2*j+1)*n+1:1:(j+1)*2*n 32 | f = f - df*heaviside(t-i*dt); 33 | end 34 | end 35 | %plot(t, f) 36 | 37 | end 38 | 39 | -------------------------------------------------------------------------------- /Toolbox/baseband_phase.m: -------------------------------------------------------------------------------- 1 | function [ f_int ] = baseband_phase( f_0, tau, dt, df, T ) 2 | %baseband_phase creates the phase of the baseband signal with the 3 | %analytical term 4 | % f_0: minimum frequency 5 | % tau: radar time delay 6 | % dt: sweep time 7 | % df: sweep frequency 8 | % T: interval time 9 | 10 | 11 | t_jump = dt:dt:T; % create vector of jump times 12 | 13 | f_intup = tau*(f_0 + t_jump(1:floor(length(t_jump)/2 + 1)) * df/dt); % Integral of rising flank 14 | 15 | f_intdown = tau * (-t_jump(floor(length(t_jump)/2 + 2):length(t_jump)) * df/dt) ... 16 | + 2*f_intup(:, length(f_intup)) - f_0*tau; % Integral of falling flank 17 | 18 | 19 | f_int = 2*pi* [f_intup f_intdown]; % combine both flanks 20 | 21 | %% Upsampling 22 | 23 | % rep_factor = floor(length(t)/length(f_int)); 24 | % % interpolate phase to fit time vector with zero order function 25 | % f_int = repmat(f_int, rep_factor, 1); 26 | % f_int = reshape(f_int, 1, rep_factor*length(t_jump)); 27 | 28 | % % repeat last few samples to fit odd number of timesamples 29 | % for i=1:length(t)-length(f_int) 30 | % f_int = [f_int f_int(:,length(f_int))]; 31 | % end 32 | 33 | % debug plot 34 | % stairs(t_jump, f_int, '-x'); 35 | -------------------------------------------------------------------------------- /Toolbox/discrete_int.m: -------------------------------------------------------------------------------- 1 | function [ int ] = discrete_int( y, f_a, min, max ) 2 | %discrete_int integrate discrete signals by adding up areas from 0 to max 3 | % Input: 4 | % y: function vector 5 | % f_a: sampling frequency 6 | % min: lower bound 7 | % max: upper bound 8 | % Output: 9 | % int: integrated vector 10 | 11 | %% Using for loop (previous version, does not work anymore) 12 | % int = zeros(1, floor(max)-floor(min)); 13 | % temp = 0; 14 | % for i=floor(min):1:floor(max-1) 15 | % temp = temp + y(:,i)*dx; 16 | % int(:,i-floor(min)+1) = temp; 17 | % end 18 | 19 | %% Using cumtrapz() function (better) 20 | 21 | % convert time parameters to index parameters 22 | min = timeToInt(min, f_a)+1; 23 | max = timeToInt(max, f_a); 24 | 25 | int = cumtrapz(y(min:max))/f_a; % see cumtrapz documentation 26 | 27 | end 28 | 29 | -------------------------------------------------------------------------------- /Toolbox/estimate_sigma.m: -------------------------------------------------------------------------------- 1 | function [ sigma_est ] = estimate_sigma( q, P_s, param, R_est ) 2 | %estimate_sigma Core function of the RCS estimation 3 | % Estimates RCS via received power and estimated R 4 | % q: baseband signal 5 | % P_s: trasmit power 6 | % param: constant eqals (4*pi)^3/(G_R*G_T*lambda^2) 7 | % R_est: estimated R 8 | % sigma_est: estimated RCS 9 | 10 | 11 | % FFT is the best way to estimate amplitude of signal (kay) 12 | q_fft =2* fft(q, 4096)/length(q); 13 | 14 | 15 | [P_e, loc] = findpeaks(abs(q_fft), 'NPEAKS', 1, 'SORTSTR', 'descend'); % find peak of fft 16 | 17 | q_fft = abs(q_fft(loc-4:loc+4)); % get 9 values next to peak 18 | 19 | f_low = 0:8; 20 | f_high = 0:9/256:8; % create interpolation vectors 21 | 22 | q_fft = interp1(f_low, q_fft, f_high, 'PCHIP'); % interpolate fft from 9 to 256 samples 23 | 24 | P_e = findpeaks(q_fft, 'NPEAKS', 1, 'SORTSTR', 'descend')^2/P_s; % Find peak wich equals amplitude of baseband signal sqrt(P_s)*sqrt(P_e) 25 | 26 | sigma_est = P_e/P_s *param * R_est^4; % Use radar equation to estimate RCS 27 | 28 | end -------------------------------------------------------------------------------- /Toolbox/heaviside.m: -------------------------------------------------------------------------------- 1 | function [ y ] = heaviside( x ) 2 | %heaviside Implementation of heaviside step function 3 | % Defined as 0 for x < 0 4 | % 1 for x >= 0 5 | y = (x >= 0); 6 | 7 | 8 | end 9 | 10 | -------------------------------------------------------------------------------- /Toolbox/spektrum.m: -------------------------------------------------------------------------------- 1 | function [y_fft, f_fft] = spektrum(y, N, f_a) 2 | %spektrum generates the spectrum and frequency vector of signal y 3 | % Input: 4 | % y: signal vector 5 | % N: N-point-fft 6 | % f_a: sampling frequency 7 | % Output: 8 | % y_fft: fft vector of signal 9 | % f_fft: frequency vector 10 | 11 | % do fft 12 | 13 | df = f_a/N; 14 | fn = f_a/2; 15 | x_fa = 0 : df : f_a-df; 16 | 17 | H = fft(y, N); 18 | amplH = abs(H); 19 | amplitudengang = fftshift(amplH/N); 20 | 21 | y_fft = amplitudengang; % assign fft vector 22 | f_fft = x_fa-fn; 23 | 24 | % plot(f_fft, y_fft); 25 | end -------------------------------------------------------------------------------- /Toolbox/timeToInt.m: -------------------------------------------------------------------------------- 1 | function [ i ] = timeToInt( t, f_a ) 2 | %timeToInt convert time value to corresponding index value in time vector 3 | % Input: 4 | % t: time value 5 | % f_a: sampling frequency 6 | % Output: 7 | % i: index value 8 | 9 | i = round(f_a * t); -------------------------------------------------------------------------------- /test.m: -------------------------------------------------------------------------------- 1 | clear; 2 | t = linspace(0,1,1000); 3 | q = exp(1i * 2*pi* 100 .*t); 4 | 5 | q_fft = fft(q); 6 | 7 | plot(abs(fft(q))); -------------------------------------------------------------------------------- /untitled.m: -------------------------------------------------------------------------------- 1 | x = pdf('exp', 0:99, 10); 2 | plot(x) --------------------------------------------------------------------------------