Capsim Block Documentation
This block inputs an image and computes its forward or inverse FFT. For a forward FFT a real matrix is expected and a complex image is produced. For an inverse FFT a complex image is expected ( possible result of a forward FFT). Complex images store real and imaginary parts as even and odd sample
Port | Type | Name | |
---|---|---|---|
0 | image_t | x |
Port | Type | Name | |
---|---|---|---|
0 | image_t | y |
int no_samples; int i,j,k; int factor; float temp; float tempReal; float tempImag; int fftexp; int fftl; int fftwidth; float norm; int pts; int order; |
---|
window_P=NULL; |
---|
/* * collect the image */ for (no_samples = MIN_AVAIL(); no_samples > 0; --no_samples) { IT_IN(0); img=x(0); pheight=img.height; pwidth=img.width; if(fftType == FORWARD_FFT && pwidth != pheight) { fprintf(stderr,"2-D FFT of Square images only. Sorry!\n"); return(1); } if(fftType == INVERSE_FFT && pwidth != 2*pheight) { fprintf(stderr,"2-D FFT of Square images only. Sorry!\n"); return(1); } /* * round points to next power of 2 */ order = (int) (log((float)pwidth)/log(2.0)+0.5); pts = 1 << order; if (pts > pwidth ) { pts = pts/2; order -= 1; } window_P=(float*)calloc(pts,sizeof(float)); if(window_P == NULL) { fprintf(stderr,"imgfft: could not allocate space\n"); return(3); } for(i=0; i |
---|
/* 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://www.xcad.com XCAD Corporation Raleigh, North Carolina */ |
---|
/* imgfft.s */ /*********************************************************************** imgfft() ************************************************************************ This star inputs an image and computes its forward or inverse FFT. For a forward FFT a real matrix is expected and a complex image is produced. For an inverse FFT a complex image is expected ( possible result of a forward FFT). Complex images store real and imaginary parts as even and odd sample columns. Thus for complex images width =2*height. Programmer: Sasan Ardalan Date: September 10, 1993 */ |
---|