BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jkanters
Fluorite | Level 6

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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}.

View solution in original post

6 REPLIES 6
udo_sas
SAS Employee

Hello -

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

Thanks,

Udo

Rick_SAS
SAS Super FREQ

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.

FriedEgg
SAS Employee

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.

jkanters
Fluorite | Level 6

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

Rick_SAS
SAS Super FREQ

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}.

jkanters
Fluorite | Level 6

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

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