FFT Segmentation Fault

prakash narayanan prakashnm07 at gmail.com
Thu Oct 11 06:23:00 UTC 2007


Hi Everyone,

I am new to VSIPL & VSIPL++.  I recently installed the following on me link
64 bit AMD machine (dual core).
VSIPL                tvcpp0p86
VSIPL++              sourceryvsipl++-1.3


I have compiled and installed VSIPL++ using the following configuration
command ...................
./configure --with-fft=none --disable-mpi --enable-sse --enable-sse2
--disable-mpi --prefix=/usr/local host=IA64 --enable-cpu-mhz=2000
--enable-cvsip



After this a simple example program for FFT is taken and compiled.
When I am running the program a Segmentation fault occurs in the following
line.

Fft<const_Vector, cscalar_f, cscalar_f, fft_fwd, by_reference>
fft_forward(Domain<1>(fftLen), static_cast<scalar_f>(1.0));

before this variables and vectors are declared as follows.
// variables
int numSamples = (32 * 1024);
int fftLen     = (numSamples/2);
int invFftLen  = (numSamples/2);

// vectors
Vector <cscalar_f> signal(fftLen);
Vector <cscalar_f> Result(invFftLen);

if numSamples =  16 of less the program runs..........

Instead of Fft() if I use Fftm() it works with matrices of size more than
32K also.


I am attaching below the entire program. Can anyone suggest how to go about?

Thanks in advance......

Regards
PNM

#include <iostream>
#include <vsip/vector.hpp>
#include <vsip/dense.hpp>
#include <vsip/domain.hpp>
#include <vsip/complex.hpp>
#include <vsip/initfin.hpp>
#include <vsip/support.hpp>
#include <vsip/signal.hpp>
#include <vsip/math.hpp>

namespace vsip
{
  typedef vsip_scalar_d scalar_d;
  typedef std::complex<vsip_scalar_d> cscalar_d;
}

using namespace std;
using namespace vsip;

typedef cscalar_f complex_type;
typedef cscalar_d dbl_complx;
typedef scalar_f  real_type;

int main()
{
// variables
int numSamples = (32 * 1024);
int fftLen     = (numSamples/2);
int invFftLen  = (numSamples/2);

// vectors
Vector <cscalar_f> signal(fftLen);
Vector <cscalar_f> Result(invFftLen);


std::cout << "Initialising FFT forward" << endl;
// set up forward fft
Fft<const_Vector, cscalar_f, cscalar_f, fft_fwd, by_reference>
    fft_forward(Domain<1>(fftLen), static_cast<scalar_f>(1.0));

std::cout << "Initialising FFT inverse" << endl;
// set up inverse fft
Fft<const_Vector, cscalar_f, cscalar_f, fft_inv, by_reference>
    fft_inverse((Domain<1>(invFftLen)), static_cast<scalar_f>(1.0
/invFftLen));

std::cout << "Calling FFT forward" << endl;
// take forward fft
fft_forward(signal);

std::cout << "Calling FFT inverse" << endl;
// take inverse fft
fft_inverse(signal, Result);

std::cout << "Finished sucessfully" << endl;

return 0;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20071011/9fc8ff08/attachment.html>


More information about the vsipl++ mailing list