Message Boards Message Boards

1
|
378 Views
|
3 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Why doesn't Fourier work properly with NumericArray?

Posted 2 days ago

I use Wolfram to process simulation data which is usually some kind of multidimensional array with dimensions like [Nt, Nz, Ny, Nx, Nd]. I load the data from files in binary format, so it is already efficiently packed from the start.

I need to apply discrete Fourier transform along time axis only. Since Wolfram does not support it by default (which is a separate question), I have to do Transpose, then Map the Fourier onto the lowest level.

To save some RAM (and hopefully improve performance), I tried to convert my data into NumericArray. However, despite NumericArray being all real numbers neatly packed, Fourier cannot be applied to NumericArray at all! I also tried with PackedArray and it works (albeit with some other issues).

data = Table[RandomReal[], {i, 8}, {y, 16}];
dataNum = NumericArray[data, "Real32"];

f1 = Fourier[data]; (* does work *)
f2 = Fourier[dataNum]  (* does not work *)
POSTED BY: Anton Lutsenko
3 Replies
Posted 2 days ago

NumericalArray[] returns an object, not a matrix. Use Normal[], e.g., f2=Fourier[Normal[dataNum]]

POSTED BY: Sangdon Lee

If OP uses: Normal[] command then no improved performance to be ?

POSTED BY: Mariusz Iwaniuk

For Me this is a big oversight !

Can you write to WRI and and explain what you need.

Regards M.I.

POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract