radar.util

radar.util.affts(x)

Performs shifted and normalized fft along with absolute value

radar.util.ffts(x)

Performs shifted and normalized fft

radar.util.init_figs()
radar.util.log2lin(x)

Returns the inverse logarithm

radar.core

class radar.core.BasicReceiver(params)

Transmits a sequence of lfm pulses as a pulse-Doppler burst and executes basic MTI and FFT processing

add_receiver_noise(x)
apply_adc_filter(x)
apply_bb_filter(x, wf_object)

BB filter is custom to the MF waveform

apply_rf2if_filter(x)
detect_burst_signal(x)
detect_single_signal(x)
detector(x)
process_burst_signal(x, wf_object, probe=False)
process_single_signal(x, wf_object, probe=False, premasked=False)
class radar.core.BasicTransmitter(params)
transmit_waveform(wf_object)
class radar.core.ButterFilter(N, Wn, fs, btype)

Class wrapper for scipy.signal.butter class object.

Parameters

Nint

Number of filter taps.

Wnfloat or tuple

Designates bandlimits of filter, dtype is float if btype is ‘low’ or ‘high’. For btype ‘bandpass’, should be a tuple specifying start and stop band in Hertz.

Fsfloat

Sampling frequency in Hertz.

btypestr

Filter type. Valid options are ‘low’, ‘high’, and ‘bandpass’.

Attributes

Nint

Number of filter taps.

Wnfloat or tuple

Designates bandlimits of filter, dtype is float if btype is ‘low’ or ‘high’. For btype ‘bandpass’, should be a tuple specifying start and stop band in Hertz.

Fsfloat

Sampling frequency in Hertz.

btypestr

Filter type. Valid options are ‘low’, ‘high’, and ‘bandpass’.

anumpy.ndarray

Numerator coefficients in frequency response. dtype is float32 or float64.

bnumpy.ndarray

Denominator coefficients in frequency response. dtype os float32 or float64

Methods

filter_signal(x)

Applies scipy.signal.lfilter(self.a,self.b,x) to signal x. dtype of x should be float32, float 64, complex64, or complex128.

filter_signal(x)
class radar.core.CA_CFAR1D(num_reference_cells_one_sided, num_guard_cells_one_sided, probability_of_false_alarm)

One dimensional cell-averaging CFAR, calculates the threshold and builds detection vector with input signal.

Parameters

num_reference_cells_one_sidedint

Number of taps on CFAR window on one side of the cell under test.

num_guard_cells_one_sidedint

Number of guard cell taps on the CFAR window on one side of the cell under test.

probability_false_alarmfloat

Probability of false alarm that characterizes the CFAR.

Attributes

num_refint

Number of taps on CFAR window on one side of the cell under test.

num_guardint

Number of guard cell taps on the CFAR window on one side of the cell under test.

pfafloat

Probability of false alarm that characterizes the CFAR.

cfar_constantfloat

CFAR constant.

cfar_windownumpy.ndarray

Array of 1s and 0s that is convolved with incoming signal to induce CA-CFAR operation.

Methods

calculate_cfar_thresh(x)

Applies numpy.convolve(x,self.cfar_window, mode = ‘same’) to signal numpy.ndarray x. dtype of x should be float32, float 64, complex64, or complex128.

build_detection_vector(x,T)

Returns vector consisting of 1s and 0s, where 1 indicates that the signal has broken the detection threshold T, which is an numpy.ndarray.

Notes

CA-CFAR theory derived from M. A. Richards, Fundamentals of Radar Signal Processing, 2nd ed. New York, NY, USA: McGraw-Hill Education, 2014.

build_detection_vector(x, T)
calculate_cfar_thresh(x)
class radar.core.CA_CFAR2D(num_reference_cells_doppler_one_sided, num_reference_cells_range_one_sided, num_guard_cells_doppler_one_sided, num_guard_cells_range_one_sided, probability_false_alarm)

Two dimensional cell-averaging CFAR, calculates the threshold and builds detection vector with input signal.

Parameters

num_reference_cells_doppler_one_sidedint

Number of taps on CFAR window on one side of the cell under test along Doppler dimension.

num_reference_cells_range_one_sidedint

Number of taps on CFAR window on one side of the cell under test along range dimension.

num_guard_cells_doppler_one_sidedint

Number of guard cell taps on the CFAR window on one side of the cell under test along Doppler dimension.

num_guard_cells_range_one_sidedint

Number of guard cell taps on the CFAR window on one side of the cell under test along range dimension.

probability_false_alarmfloat

Probability of false alarm that characterizes the CFAR.

Attributes

num_ref_dint

Number of taps on CFAR window on one side of the cell under test along Doppler dimension.

num_ref_rint

Number of taps on CFAR window on one side of the cell under test along range dimension.

num_guard_dint

Number of guard cell taps on the CFAR window on one side of the cell under test along Doppler dimension.

num_guard_rint

Number of guard cell taps on the CFAR window on one side of the cell under test along range dimension.

pfafloat

Probability of false alarm that characterizes the CFAR.

cfar_constantfloat

CFAR constant.

cfar_windownumpy.ndarray

Matrix of 1s and 0s that is convolved with incoming signal to induce CA-CFAR operation.

Methods

calculate_cfar_thresh(x)

Applies numpy.convolve(x,self.cfar_window, mode = ‘same’) to signal numpy.ndarray x. dtype of x should be float32, float 64, complex64, or complex128.

build_detection_matrix(x,T)

Returns vector consisting of 1s and 0s, where 1 indicates that the signal has broken the detection threshold T, which is an numpy.ndarray.

Notes

CA-CFAR theory derived from M. A. Richards, Fundamentals of Radar Signal Processing, 2nd ed. New York, NY, USA: McGraw-Hill Education, 2014.

build_detection_matrix(x, T)
calculate_cfar_thresh(x)
class radar.core.Cheby1Filter(N, rp, Wn, fs, btype)

Class wrapper for scipy.signal.cheby1 class object.

Parameters

Nint

Number of filter taps.

Wnfloat or tuple

Designates bandlimits of filter, dtype is float if btype is ‘low’ or ‘high’. For btype ‘bandpass’, should be a tuple specifying start and stop band in Hertz.

Fsfloat

Sampling frequency in Hertz.

rpfloat

Specifies passband ripple in dB.

btypestr

Filter type. Valid options are ‘low’, ‘high’, and ‘bandpass’.

Attributes

Nint

Number of filter taps.

Wnfloat or tuple

Designates bandlimits of filter, dtype is float if btype is ‘low’ or ‘high’. For btype ‘bandpass’, should be a tuple specifying start and stop band in Hertz.

Fsfloat

Sampling frequency in Hertz.

rpfloat

Specifies passband ripple in dB.

btypestr

Filter type. Valid options are ‘low’, ‘high’, and ‘bandpass’.

anumpy.ndarray

Numerator coefficients in frequency response. dtype is float32 or float64.

bnumpy.ndarray

Denominator coefficients in frequency response. dtype is float32 or float64.

Methods

filter_signal(x)

Applies scipy.signal.lfilter(self.a,self.b,x) to signal x. dtype of x should be float32, float 64, complex64, or complex128.

filter_signal(x)
class radar.core.CoherentOscillator(frequency_hz, initial_phase)
class radar.core.CustomAESA(path_array_elements_file)

Calculates the gain for a particular set of azimuth and elevation angles

Not intended to be a true time delay model

Accepts ‘array_elements_file’ where each line is 3 elements representing the x y z coordinates of an array element.

array_response(azimth_angle, zenith_angle, frequency)
class radar.core.DiscreteScan(params)
next_steered_position()
class radar.core.FIR(numtaps, cutoff, fs)

Class wrapper for scipy.signal.firwin class object.

Parameters

numtapsint

Number of filter taps.

cutofffloat

Designates bandlimit of filter, dtype is float with units in Hertz.

fsfloat

Sampling frequency in Hertz.

Attributes

numtapsint

Number of filter taps.

cutofffloat

Designates bandlimit of filter, dtype is float with units in Hertz.

fsfloat

Sampling frequency in Hertz.

hnumpy.ndarray

Impulse response filter coefficients. dtype is float32 or float64.

Methods

filter_signal(x)

Applies numpy.convolve(x,self.h) to signal x. dtype of x should be float32, float 64, complex64, or complex128.

filter_signal(x)
class radar.core.MTIBasic
filter_signal(x)
class radar.core.PlanarAESA(one_sided_elements, array_element_spacing)

Calculates the gain for a particular set of azimuth and elevation angles

Not intended to be a true time delay model

By default produces a square grid array

array_response(azimth_angle, zenith_angle, frequency)
build_rvec(M, d)
class radar.core.SincAntennaPattern(antenna_params)

Antenna pattern object for a sinc(x) (sin(x)/x) pattern

azimuth_slice(azimuth_angles, elevation_angle=0)
elevation_slice(elevation_angles, azimuth_angle=0)
gain_val(azimuth_angle, elevation_angle, default=False)
class radar.core.Waveform(radar_params, wf_params)

A class to represent a radar waveform.

Attributes

index: int

Unique index given to distinguish among other Waveform objects used.

typestr

Indicates the waveform type being a single pulse or a burst of pulses. Valid options are ‘single’ and ‘burst’.

pwfloat

Pulse Width (PW) in seconds.

prifloat

Pulse Repetition Interval (PRI) in seconds.

modulationstr

Specifies the type of modulation on pulse used. Valid options are ‘bpsk’, ‘lfm’, or ‘none’.

lfm_exfloat

Specifies the linear frequency modulation excursion (i.e., 1 MHz is a 1 MHz chirp or lfm) in Hertz. Not used if modulation is not set to ‘lfm’.

bpsk_seqnumpy.ndarray

Specifies the binary phase shift keyed sequence consisting of ‘-1’ and ‘1’ as a numpy array, i.e., a 13-bit Barker code would be np.array([1,1,1,1,1,-1,-1,-1,1,-1,1,-1,1]). dtype should be float32, float64, or int. Not used if modulation is not set to ‘bpsk’.

chip_width_sfloat

Specifies the length of a bpsk chip in seconds. Not used if modulation is not set to ‘bpsk’.

pris_per_cpiint

Specifies the number of PRIs in a Coherent Processing Interval (CPI). For waveform type ‘single’, this defaults to 1.

Fs_rffloat

Sampling frequency at transmit/receive (RF) frequency in Hertz.

Fs_iffloat

Sampling frequency at relevant intermediate freqency (IF) in Hertz.

Fs_bbfloat

Sampling frequency at baseband (BB) in Hertz.

fc_rffloat

RF center frequency in Hertz.

fc_iffloat

IF center frequency in Hertz.

samples_per_chip_<freq>int

Computed by: int(np.ceil(self.pw/self.bpsk_length * self.Fs_<freq>)). <freq> can be ‘bb’, ‘if’, or ‘rf’.

samples_per_pw_<freq>int

Computed by: int(self.pw * self.Fs_<freq>). <freq> can be ‘bb’, ‘if’, or ‘rf’.

samples_per_pri_<freq>int

Computed by: int(self.pri * self.Fs_<freq>). <freq> can be ‘bb’, ‘if’, or ‘rf’.

samples_per_cpi_<freq>int

Computed by: int(self.pris_per_cpi * self.samples_per_pri_<freq>). <freq> can be ‘bb’, ‘if’, or ‘rf’.

cpi_duration_sfloat

Duration of CPI in seconds

samples_per_range_window_<freq>: int

Computed by: samples_per_pri_<freq> - int(2 * self.samples_per_pw_<freq>). <freq> can be ‘bb’, ‘if’, or ‘rf’.

range_per_cpi_mfloat

maximum echo range within a CPI in meters, determined by c * cpi_duration_s/2

range_unambiguousfloat

maximum unambiguous range in meters, determined by cPRI/2

bb_filterFIR

An instance of FIR representing the filter used for the low pass filtering of the baseband waveform.

mf_wf_bbnumpy.ndarray

Baseband waveform to match pulse used in matched filter. Applied using method ‘apply_matched_filter’. dtype should be complex64 or complex128.

range_resolutionfloat

Range resolution in meters. Computed by: 3e8/2/self.bandwidth.

rcv_window_masknumpy.ndarray

Array of 1s and 0s that indicate the the listening on and off intervals, respectively, for the waveform to be received.

Methods

wf():

Generates samples at the RF center frequency (fc_rf) at RF sampling frequency (Fs_rf) for one coherent processing interval. For type ‘single’, this is just a single pri, for type ‘burst’, this is a train of pulses.

apply_matched_filter(x):

Correlates a single matched pulse to the incoming signal x, as specified by waveform attributes. Filtering performed as Baseband (BB) sampling rate

apply_bb_filter(x):

Applies Baseband (BB) low-pass filter limited to waveform bandwidth. For LFM, this is the lfm_ex, for BPSK, this is 1/chip_width_s, and for unmodulated, this is just 1/pw

Notes

When we refer to the RF center frequency or RF sampling rate, we intend the frequency at which the waveform is transmitted, i.e., the antenna(s) and front end tuned such that it utilizes that frequency.

The range window is the time the radar spends listening for pulses echoed. For burst waveforms, there is an inherently restricted range due to the need to listen for the full pulse length and then transmit the second pulse, resulting in what are called its ‘blind zones’. These are accounted for by applying the self.rcv_window_mask to an incoming signal x.

Examples

wf_params: lfm_single_wf_params = {‘index’: 2, ‘type’: ‘single’, ‘pw’: 100e-6, ‘pri’: 1100e-6, ‘modulation’ : ‘lfm’, ‘lfm_excursion’ : 2e6, ‘bpsk_seq’ : [], ‘bpsk_chipw’ : 0.,’pris_per_cpi’: 1} bpsk_burst_wf_params = {‘index’ : 5,’type’: ‘burst’, ‘pw’: .75e-06, ‘pri’: 4e-6, ‘modulation’ : ‘bpsk’, ‘lfm_excursion’ : 0., ‘bpsk_seq’ : [1,1,1,1,1,-1,-1,1,1,-1,1,-1,1], ‘bpsk_chipw’ : .04e-6,’pris_per_cpi’: 200}

Example transmit/receive chain for Waveform instance mywf: x = mywf.wf() #Transmited waveform x = applyEnvironment(x) #function specific to user scenario x = mywf.apply_rcv_mask(x) #Account for blind range zones x = applyRFFrontend(x) #function specific to user scenario x = convert2baseband(x) #function specific to user scenario x = mywf.apply_bb_filter(x) #Filter at baseband x = mywf.apply_matched_filter(x) #Matched filter for pulse

apply_bb_filter(x)

Applies Baseband (BB) low-pass filter limited to waveform bandwidth. For LFM, this is the lfm_ex, for BPSK, this is 1/chip_width_s, and for unmodulated, this is just 1/pw

Parameters

xnumpy.ndarray

Complex digital IQ representation of signal. dtype should be complex64 or complex128.

Returns

Filtered complex digital IQ representation of signal. dtype will be complex64 or complex128.

apply_matched_filter(x)

Correlates a single matched pulse to the incoming signal x, as specified by waveform attributes. Filtering performed as Baseband (BB) sampling rate

Parameters

xnumpy.ndarray

Complex digital IQ representation of signal. dtype should be complex64 or complex128.

Returns

Filtered complex digital IQ representation of signal. dtype will be complex64 or complex128.

apply_rcv_mask(x)

Applies self.rcv_window_mask to incoming signal to account for blind range zones.

Parameters

xnumpy.ndarray

Incoming signal of type complex64 or complex128.

help()

Prints the class docstring and the docstrings of its methods.

wf()

Generates samples at the RF center frequency (fc_rf) at RF sampling frequency (Fs_rf) for one coherent processing interval. For type ‘single’, this is just a single pri, for type ‘burst’, this is a train of pulses.

Parameters

None

Returns

wf_outnumpy.ndarray

Complex digital IQ representation of “single” or “burst” waveform for one CPI. Length calculated by CPI length and RF sampling frequency. dtype will be complex64 or complex128.

Notes

Waveforms set as generators to preserve memory.