Capsim Block Documentation
Compress SAR image in range
Port | Type | Name | |
---|---|---|---|
0 | float | x |
int no_samples; int i,j,jj; float taz; float range; float arg; float a,b,c; float rx; image_t img; int order,pts; cap_fft_cpx x,y; float fmax,fmin; float sample; |
---|
if( (obufs = NO_OUTPUT_BUFFERS()) < 1 ) { fprintf(stderr,"sar_range_compress: no output buffers\n"); CsInfo("sar_range_compress: 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,"sar_range_compress: width=%d height=%d\n",maxRangeIndex,maxAzimuthIndex); /* * round maxRangeIndex to next power of 2 */ order = (int) (log((float)maxRangeIndex)/log(2.0)+0.5); pts = 1 << order; if (pts < maxRangeIndex ) { pts = pts*2; order += 1; } rangeFFTLength=pts; // fprintf(stderr,"sar_range_compress: width=%d height=%d FFTWidth=%d\n",width,height,rangeFFTLength); ref_P=(cap_fft_cpx *)calloc(rangeFFTLength,sizeof(cap_fft_cpx)); range_P=(cap_fft_cpx *)calloc(rangeFFTLength,sizeof(cap_fft_cpx)); refFFT_P=(cap_fft_cpx *)calloc(rangeFFTLength,sizeof(cap_fft_cpx)); rangeFFT_P=(cap_fft_cpx *)calloc(rangeFFTLength,sizeof(cap_fft_cpx)); if(ref_P == NULL || range_P== NULL || rangeFFT_P== NULL || refFFT_P== NULL) { fprintf(stderr,"sar_range_compress: could not allocate space \n"); CsInfo("sar_range_compress: could not allocate space"); return(7); } cfgi=cap_fft_alloc(rangeFFTLength,1,NULL,NULL); cfg=cap_fft_alloc(rangeFFTLength,0,NULL,NULL); /* * generate reference */ for(j=0; j |
---|
for (no_samples = MIN_AVAIL(); no_samples > 0; --no_samples) { IT_IN(0); sample=x(0); range_P[k].r=sample; range_P[k].i=0.0; k++; if(k==maxRangeIndex) { for(j=maxRangeIndex; j |
---|
if(range_P) free(range_P); if(rangeFFT_P) free(rangeFFT_P); if(refFFT_P) free(refFFT_P); if(ref_P) free(ref_P); |
---|
/* Capsim (r) Text Mode Kernel (TMK) Star Library (Blocks) Copyright (C) 1989-2002 XCAD 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://capsimtmk.sourceforge.net XCAD Corporation Raleigh, North Carolina */ |
---|
/************************************************************************ * * (c) 1989-2002 XCAD Corporation |
---|