[comp.sys.next] Help needed getting 4096 pt. FFT to work on DSP

zazula@uazhe0.physics.arizona.edu (RALPH ZAZULA) (03/08/91)

I'm trying to do a 4096 pt. FFT on the DSP using the program
/NextDeveloper/Examples/DSP/ArrayProcessing/fft/fft.c 
as a template.  All I did was to take out the test arrays, 
put in my own function for timeReal,timeImag and change POINTS.

A couple of interesting things are happening.  First, the signal
I'm putting in is two sine waves of different frequency in the timeReal
array and leaving timeImag all zeros.  I find that I have to scale the
timeReal array *way* down (the signal is sin(99)+sin(100) and I'm
dividing by 10).  I think this has to do with the fact that the DSP
uses numbers between 0-1 (right?).  

I can run this program for 1024 data-points.  2048 kills it (it just
sits there).  Is 2048 points too many for the data space of the DSP?
Could I reduce the size of the sinTab and cosTab arrays?  How can I
get up to 4096 data points?  (I'd like to take my 2048 points and 
zero pad out to 4096...).

Thanks,
Ralph


   |----------------------------------------------------------------------|
   | Ralph Zazula                               "Computer Addict!"        |
   | University of Arizona                 ---  Department of Physics     |
   |   UAZHEP::ZAZULA                            (DecNet/HEPNet)          |
   |   zazula@uazhe0.physics.arizona.edu         (Internet)               |
   |----------------------------------------------------------------------|
   |   "You can twist perceptions, reality won't budge."  - Neil Peart    |
   |----------------------------------------------------------------------|

cpenrose@sdcc13.ucsd.edu (Christopher Penrose) (03/09/91)

In article <7MAR91221326@uazhe0.physics.arizona.edu> zazula@uazhe0.physics.arizona.edu writes:
>
>I can run this program for 1024 data-points.  2048 kills it (it just
>sits there).  Is 2048 points too many for the data space of the DSP?
>Could I reduce the size of the sinTab and cosTab arrays?  How can I
>get up to 4096 data points?  (I'd like to take my 2048 points and 
>zero pad out to 4096...).

Sorry, there just isn't enough data space for a FFT with a size greater
than 1024 elements.  You can add more memory dsp ram however.  I am not
sure if they managed to get dma working with the NeXT 2.0 software or 
not.  With the 68040, floating point FFTs do not need to be scaled down
to 24-bit integers; hence, if you are converting floating point data, a
generic C FFT is not only faster than a dsp 56001 FFT, but it also provides
better amplitude resolution, and is much easier to code and interface.  Also,
you have the facility of larger N sizes.  If the dsp chip were a 96000, 
I gather that I would have to take all of this back.  If you are willing to
brave assembly code, you could hand-optimize a floating point FFT algorithm 
for the 68040.  Wow, if you did this, I would definitely be your friend :)

Christopher Penrose
jesus!penrose

 

pbiron@weber.ucsd.edu (Paul Biron) (03/10/91)

In article <7MAR91221326@uazhe0.physics.arizona.edu> zazula@uazhe0.physics.arizona.edu writes:
>I'm trying to do a 4096 pt. FFT on the DSP using the program
>/NextDeveloper/Examples/DSP/ArrayProcessing/fft/fft.c 
>as a template.  All I did was to take out the test arrays, 
>put in my own function for timeReal,timeImag and change POINTS.

>A couple of interesting things are happening.  First, the signal
>I'm putting in is two sine waves of different frequency in the timeReal
>array and leaving timeImag all zeros.  I find that I have to scale the
>timeReal array *way* down (the signal is sin(99)+sin(100) and I'm
>dividing by 10).  I think this has to do with the fact that the DSP
>uses numbers between 0-1 (right?).  

Actually, its -1.0 <= n < +1.0 .

>I can run this program for 1024 data-points.  2048 kills it (it just
>sits there).  Is 2048 points too many for the data space of the DSP?
>Could I reduce the size of the sinTab and cosTab arrays?  How can I
>get up to 4096 data points?  (I'd like to take my 2048 points and 
>zero pad out to 4096...).

>Thanks,
>Ralph

Glad to hear someone else is having a similar problem.  I'm not trying
to do fft's, but I am running into that ~2K data limit.  Would adding
more DSP memory "solve" this problem?

I've been playing with the AP/matrix demo.  One of the things I haven't
figured out is why the machine just hangs when a larger dataset is
downloaded to the DSP.  Isn't there someway of detecting an overload,
and aborting the download?  I know very little about DSP (I'm still
waiting for docs to arrive from Moto.).

One think I have discovered, however, is that there is *no* exact
limit which will hang the machine.  I've done some tests like the
following (where doit is the name of the test program, and the
argument is the size of the matrices to work on):

% doit 1024      (succeeds)
% doit 2048      (fails)
% doit 3096      (succeeds)
% doit 3096      (fails)

This doesn't make sense to me.  Can anyone enlighten me?


-- 
Paul Biron      pbiron@ucsd.edu        (619) 534-5758
Central University Library, Mail Code C-075-R
Social Sciences DataBase Project
University of California, San Diego, La Jolla, Ca. 92093