comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: how do you zero-pad FFTs in IDL?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: how do you zero-pad FFTs in IDL? [message #9302] Wed, 25 June 1997 00:00
Amara Graps is currently offline  Amara Graps
Messages: 24
Registered: June 1996
Junior Member
Paul Woodford wrote:
>
> Is there a quick method to zero-pad an FFT in IDL? For example,
> in matlab you can write fft(x,256) to zero-pad the FFT to 256
> elements.

I don't know of a quick way, but this will work to pad an array to
the next 2^n length: (I would be interested in even shorter
ways.. anybody?)

x = findgen(1000) ;want to zero-pad this to 1024 length
n_work=2L^(fix(alog(n_elements(x))/alog(2))+1)
pad=fltarr(n_work-n_elements(x))
x = [x,pad]

Then FFT the x array.

Amara


--

************************************************************ **
Amara Graps amara@quake.stanford.edu
Solar Oscillation Investigations Stanford University
http://quake.stanford.edu/~amara/
************************************************************ **
"Never fight an inanimate object." - P. J. O'Rourke
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to read MJPEG files into IDL
Next Topic: displaying true color tiff

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:19:27 PDT 2025

Total time taken to generate the page: 0.00393 seconds