Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 140679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:39:16+00:00 2026-05-11T07:39:16+00:00

On my 64-bit Debian/Lenny system (4GByte RAM + 4GByte swap partition) I can successfully

  • 0

On my 64-bit Debian/Lenny system (4GByte RAM + 4GByte swap partition) I can successfully do:

v=array(10000*random([512,512,512]),dtype=np.int16) f=fftn(v) 

but with f being a np.complex128 the memory consumption is shocking, and I can’t do much more with the result (e.g modulate the coefficients and then f=ifftn(f) ) without a MemoryError traceback.

Rather than installing some more RAM and/or expanding my swap partitions, is there some way of controlling the scipy/numpy ‘default precision’ and have it compute a complex64 array instead ?

I know I can just reduce it afterwards with f=array(f,dtype=np.complex64); I’m looking to have it actually do the FFT work in 32-bit precision and half the memory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:39:17+00:00Added an answer on May 11, 2026 at 7:39 am

    It doesn’t look like there’s any function to do this in scipy’s fft functions ( see http://www.astro.rug.nl/efidad/scipy.fftpack.basic.html ).

    Unless you’re able to find a fixed point FFT library for python, it’s unlikely that the function you want exists, since your native hardware floating point format is 128 bits. It does look like you could use the rfft method to get just the real-valued components (no phase) of the FFT, and that would save half your RAM.

    I ran the following in interactive python:

    >>> from numpy import * >>>  v = array(10000*random.random([512,512,512]),dtype=int16) >>> shape(v) (512, 512, 512) >>> type(v[0,0,0]) <type 'numpy.int16'> 

    At this point the RSS (Resident Set Size) of python was 265MB.

    f = fft.fft(v) 

    And at this point the RSS of python 2.3GB.

    >>> type(f) <type 'numpy.ndarray'> >>> type(f[0,0,0])  <type 'numpy.complex128'> >>> v = [] 

    And at this point the RSS goes down to 2.0GB, since I’ve free’d up v.

    Using ‘fft.rfft(v)’ to compute real-values only results in a 1.3GB RSS. (almost half, as expected)

    Doing:

    >>> f = complex64(fft.fft(v)) 

    Is the worst of both worlds, since it first computes the complex128 version (2.3GB) and then copies that into the complex64 version (1.3GB) which means the peak RSS on my machine was 3.6GB, and then it settled down to 1.3GB again.

    I think that if you’ve got 4GB RAM, this should all work just fine (as it does for me). What’s the issue?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to replace MySQL 5.1 on my Debian Lenny 32-bit server to
i am using a named pipe for IPC on a Debian system. I will
XML::Parser fails to build on a quite fresh 64-bit Debian box. After issuing cpan
I have 2 different web servers on a Debian Lenny machine. One is running
Bit of a strange one here, i have a CCTV system and contacted the
I have Apache running on a public-facing Debian server, and am a bit worried
We're running a Debian with a 2.6.16 kernel, with iptables enabled. The system is
On 64-bit Debian Linux 6: Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5]
I'm running this scala code on a 32-bit quad-core Core2 system: def job(i:Int,s:Int):Long =
I need to check whether certain Debian packages are installed on a system in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.