target

Capsim Block Documentation

Short Description

This simulates target range measurements from a track-while-scan radar

Top
Parameters
Num Description Type Name Default Value
0 closing velocity (knots) float cv -600.0
1 initial range (nautical miles) float initial_range 1.0
2 standard deviation (feet) float sdf 1.0
3 number of samples int num_of_samples 128
4 interval (msec) float ts 10.0
5 data probability float pd 1.0
6 random number seed int seed 1287
7 pace rate to determine how many samples to output float pace_rate 1.0
8 number of samples on the first call if paced int samples_first_time 128
Top
States
Num Type Name Initial Value Description
0 int samples_out 0
1 double pace_in_total 0
2 int output_target NUMBER_SAMPLES_PER_VISIT
3 int no_inbuf
4 int no_outbuf
5 int pass 0
6 float xm[10000]
7 char rand_state[256]
8 double max
Top

Declarations


 

	int i,j,k;
	float tdel;
	double sd,yn,zn,ynr,znc,zns,u,sqrt(),log();



Top

Initialization Code



 

	if((no_outbuf = NO_OUTPUT_BUFFERS() ) <= 0)  {
		fprintf(stderr,"target: no output buffers\n");
		return(1); /* no output buffers */
	}
	no_inbuf = NO_INPUT_BUFFERS();
	if(no_inbuf == 1)
		output_target = samples_first_time;
	else
		output_target = num_of_samples;
	if(output_target > num_of_samples)
		output_target = num_of_samples;
	if(pace_rate < 0) pace_rate = -pace_rate;
	tdel = ts*0.001;
	xm[0] = initial_range;
	sd = sdf/6076.0;
	srandom(seed);
	max = m;
	for(k=1; k pd)  xm[k] = 0.0;
	}




Top

Main Code



 

	if(no_inbuf == 1)  {
		while(IT_IN(0))
			pace_in_total += 1.0;
		if(pass == 1)  {
			output_target = samples_first_time + (int) (pace_rate *
					pace_in_total + 0.5);
			if(output_target > num_of_samples && num_of_samples > 0)
				output_target = num_of_samples;
		}
	}
	pass = 1;
	i = 0;

	while(samples_out < output_target)  {

		if(++i > NUMBER_SAMPLES_PER_VISIT) return(0);

		for(j=0; j
    
Top

Wrapup Code



 





Top

License



/*  Capsim (r) Text Mode Kernel (TMK) Star Library (Blocks)
    Copyright (C) 1989-2017  Silicon DSP Corporation

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    http://www.silicondsp.com
    Silicon DSP  Corporation
    Las Vegas, Nevada
*/


Top

Description



 

/*
 	target.s:	this simulates target range measurements
 			from a track-while-scan radar 
 	parameters:	cv - closing velocity in knots
 			initial_range - initial range in nautical miles
 			sdf - standard deviation in feet
 			num_of_samples - number of samples
 			ts - sampling interval in milliseconds
 			pd - data probability
			seed - random number seed
 	inputs:		none
 	outputs:	range measurements
 	description:	This star generates range measurements from
 			a track-while-scan radar with measurement
 			uncertainty.  If there is a missed range
 			value a "0" is output.
 			written by Ray Kassel
			August 13, 1990 

target


This star generates range measurements from
 			a track-while-scan radar with measurement
 			uncertainty.  If there is a missed range
 			value a "0" is output.


			written by Ray Kassel
			August 13, 1990 

 */