I have my measurement data stored into the following structure:

```
CREATE TABLE measurements(
measured_at TIMESTAMPTZ,
val INTEGER
);

```

I **already** know that using 

(a) `date_trunc('hour',measured_at)` 

AND

(b) `generate_series`

I would be able to aggregate my data by: 

```
microseconds,
milliseconds
.
.
.

```

But is it possible to aggregate the data by 5 minutes or let's say an arbitrary amount of seconds? Is it possible to aggregate measured data by an arbitrary multiple of seconds?

I need the data aggregated by different time resolutions to feed them into a FFT or an AR-Model in order to see possible seasonalities.