## Fourier transform

Occasional Contributor
Posts: 9

# Fourier transform

I have a time series where I want to do a real Fourier transform

Since the data has missing values, I cannot use a FFT which requires equidistant data.

PROC SPECTRA either use the classical cool-Tukey when data=2**n or a chirp-Z, but since Proc spectra does not require the time information, this is not the way. Anyone with experience of a real FT in SAS?

SAS Employee
Posts: 416

## Re: Fourier transform

Hello -

Not sure I completely understand this question but here are some pointers which may be useful:

Thanks,

Udo

SAS Super FREQ
Posts: 3,752

## Re: Fourier transform

Except that the FFT function in SAS/IML won't work with the missing value. It requires a vector of nonmissing.

You could interpolate or otherwise model the signal at the missing values, and then take an FFT of the interpolated signal.

Posts: 1,301

## Re: Fourier transform

```Rick Wicklin wrote:

You could interpolate or otherwise model the signal at the missing values, and then take an FFT of the interpolated signal.
```

PROC EXPAND is designed to aide with this.

Occasional Contributor
Posts: 9

## Re: Fourier transform

Yes, and it is what I have done. But this is not the best way. The best way is to do a real Fourier transform (not a FFT). With modern computers, computer power does not matter much. Furthermore irregular sampled measures may even break the nyquist limit. However that demands a Fourier transform which also takes the time in account. The FFT in proc spectra does not. It seems that SAS has some limits in its time series analysis. I may have to end up in matlab

SAS Super FREQ
Posts: 3,752

## Re: Fourier transform

I haven't thought about this stuff in many years, but I seem to recall that the real FT is just the integral of f(t)sin(wt)  and f(t)cos(wt). I think you are saying that you want to integrate these functions over nonuniform collection of t values.  There are various numerical integration schemes, depending upon how you want to model the function on the interval [t_i, t_{i+1}].  The simplest model is the piecesise linear model, which is equivalent to integration via the trapezoid rule. See http://blogs.sas.com/content/iml/2011/06/01/the-trapezoidal-rule-of-integration.html  The formula is easy and does not require uniform spacing of the {t_i}.

Occasional Contributor
Posts: 9

## Re: Fourier transform

That may be a solution. Hopefully one day SAS will extend PROC SPECTRA to do that. It will help many doing times series analysis of real data with missing data. Furthermore it has been shown that irregular sampled data may break the nyquist limit so there is many advantages of using a real Fourier transform and not the FFT or some equivalent.

Discussion stats
• 6 replies
• 736 views
• 1 like
• 4 in conversation