img_sar_azimuth_compress

Capsim Block Documentation

Short Description

Azimuth compression SAR Image Formation

Top
Input Connections
Port Type Name
0 image_t x
Top
Parameters
Num Description Type Name Default Value
0 Carrier Frequency, MHz float fc 1275
1 Pulse Chirp Rate, MHz/microsecond float Kr 0.5621
2 Pulse Duration Microseconds float tau 33.8
3 Pulse Bandwidth, MHz float Br 19.0
4 Center Frequency (IF) MHz float fIF 11.38
5 Pulse Repition Rate, Hz float prf 1645.0
6 Sampling Rate, MHz float fs 45.03
7 Doppler Frequency, Hz float fDc 1150.0
8 Doppler Rate of Change , Hz float Kaz 501.27
9 Platform Velocity, Km/s float v 7.0
10 Integration Time, s float total 2.0
11 Azimuth Sample Time float tazs 0.0
12 tc seconds float tc 1.0
13 Reference Point Range rp, kM float rp 840.0
14 Reference Point Azimuth tp in index units int tpi 1000
15 Output Control 0:real compressed, 1: complex compressed int control 0
16 T center (0.5 halfway) float frac 0.5
Top
States
Num Type Name Initial Value Description
0 float phase 0.
1 float t 0.
2 float dt
3 float dtaz
4 float tp
5 int done 0
6 int maxRangeIndex
7 int k
8 float lamda
9 float t0
10 int obufs
11 float** mat_PP
12 float** matCompressed_PP
13 cap_fft_cpx* ref_P
14 cap_fft_cpx* azimuth_P
15 cap_fft_cpx* refFFT_P
16 cap_fft_cpx* azimuthFFT_P
17 cap_fft_cfg cfg
18 int rangeFFTLength
19 int azimuthFFTLength
Top

Declarations


 

	int no_samples;
	int i,j;
	float taz;
	float range;
	float arg;
	float a,b,c;
	float rx;
	image_t		img;
	int width,height;
	int order,pts;
	cap_fft_cpx x,y;
	float fmax,fmin;



Top

Initialization Code



 

	if( (obufs = NO_OUTPUT_BUFFERS()) < 1 ) {
		fprintf(stderr,"img_sar_azimuth_compress: no output buffers\n");
		CsInfo("img_sar_create: no output buffers");
		return(2);
	}
    dt=(1.0/fs)*0.000001;
	t0=2.0*rp*1000.0/C;
    maxRangeIndex=(int)tau*0.000001/dt;
	dtaz=(1.0/prf);
    tp=tpi*(1.0/prf);
    done=0;
    t=0;
    k=0;
    lamda=C/(fc*1000000.0);
// 	fprintf(stderr,"img_sar_azimuth_compress: width=%d height=%d\n",maxRangeIndex,maxAzimuthIndex); 
    for(j=0; j
    
Top

Main Code



 


for (no_samples = MIN_AVAIL(); no_samples > 0; --no_samples) {
	IT_IN(0);
	img=x(0);
	height=img.height;
	width=img.width;
	/*
	 * round height to next power of 2
	 * Note we are dealing with Azimuth
	 * Also height is already a power of 2 (should be)
	 */
	order = (int) (log((float)height)/log(2.0)+0.5);
	pts = 1 << order;
	if (pts < height ) {
        	pts = pts*2;
        	order += 1;
	}
	rangeFFTLength=width;
	azimuthFFTLength=pts;
	fprintf(stderr,"img_sar_azimuth_compress: rangeFFTLength=%d height=%d azimuthFFTLength=%d\n",width,height,azimuthFFTLength); 

	ref_P=(cap_fft_cpx *)calloc(azimuthFFTLength,sizeof(cap_fft_cpx));
	azimuth_P=(cap_fft_cpx *)calloc(azimuthFFTLength,sizeof(cap_fft_cpx));
	refFFT_P=(cap_fft_cpx *)calloc(azimuthFFTLength,sizeof(cap_fft_cpx));
	azimuthFFT_P=(cap_fft_cpx *)calloc(azimuthFFTLength,sizeof(cap_fft_cpx));

	if(ref_P == NULL || azimuth_P== NULL || azimuthFFT_P== NULL || refFFT_P== NULL) {
		fprintf(stderr,"img_sar_azimuth_compress: could not allocate space \n");
		CsInfo("img_sar_azimuth_compress: could not allocate space");
		return(7);
	}

	mat_PP = (float**)calloc(azimuthFFTLength,sizeof(float*));
	if(mat_PP == NULL) {
		fprintf(stderr,"img_sar_azimuth_compress: could not allocate space \n");
		CsInfo("img_sar_azimuth_compress: could not allocate space");
		return(5);
	}
    for(i=0; ia ) fmin=a;
            
			mat_PP[j][i]=a;
	     }
#endif 

#if 000
         for(j=0; ja ) fmin=a;
            
			mat_PP[j][i]=a;
	     }
#endif 
	
 
	}
	fprintf(stderr,"img_sar_azimuth_compress: fmin=%f fmax=%f \n",fmin,fmax); 

    for(j=0; j
    
Top

Wrapup Code



 

if(azimuth_P) free(azimuth_P);
if(azimuthFFT_P) free(azimuthFFT_P);
if(refFFT_P) free(refFFT_P);
if(ref_P) free(ref_P);




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



 

/************************************************************************
 *
 * Azimuth compression
 * SAR Image Formation
 * 
 * (c) 1990-2002 XCAD Corporation
 *									
 *		

img_sar_azimuth_compress


Azimuth compression SAR Image Formation


Sasan Ardalan
 
 ************************************************************************/