Re: Arrays and FFTW

From: Alessandro Baretta <alex(at)baretta(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Arrays and FFTW
Date: 2002-07-19 21:48:59
Message-ID: 3D38894B.70206@baretta.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> You're intending to store each complete signal as a big array in one
> row? That could get a bit ugly if the signals are very large (many
> megabytes). But if you want to do it that way, I think the coding
> would be pretty straightforward. See src/backend/utils/adt/float.c
> for some examples of C functions that process arrays of floats ---
> the "FLOAT AGGREGATE OPERATORS" section is relevant.
> src/include/utils/array.h is relevant reading as well.

Ok. I'll take a look at them.

What is going to be ugly, exactly? To be precise, my
application requires storing samples obtained at random
intervals, and resampling them a 1Hz. My pgsql installation
is already managing 3 months worth of data (1.8 Mrows),
imported from MS/Excel x-( . But power spectra are only
intersting for a moving window about 8-12 hours long (9.1h
yields an array of 2**15 samples, whose FFT can be computed
in about 2ms on an Athlon 1200).

My problem is that I need to know how the arrays are
represented in memory, and how they are passed to my
function. Also, I'll need to define an abstract type for the
execution plan of the dft alorithm--yes, fftw uses execution
plans just like PostgreSQL :-) --and I will need to store
them in the database. This seems a little tricky to me. As I
stated earlier, I have already learned SQL and PL/pgSQL
functions, but I still have to learn how to create a C
function. Anyway, I'm working on it, and I hope to be able
to share my code with you guys, for possible inclusion in
the distribution.

Alex

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-07-19 22:52:42 Re: preserving statistics settings
Previous Message Tony Reina 2002-07-19 21:33:08 Inheritance a burden?