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?
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}.
Hello -
Not sure I completely understand this question but here are some pointers which may be useful:
Thanks,
Udo
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.
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.
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
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}.
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.