LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Signal extrapolation with FFT

Solved!
Go to solution

Hello,

 

I want to extrapolate (generate some dots outter a given signal).

My approach is to use a FFT to acquire the signal spectrum,

and then to return to time-domain by the iFFT to generate the new signal.

 

But there is no option (in iFFT) to precise the size of the generated signal.

 

For example, if i have a 1 Hz signal, with Fourier, i must be able to generate a signal with an arbitrary lenght.

Is there a function in LV that generate a variable sized signal for each Fourier Coef gived in input (by the FFT) ??

 

Best regards

Nicolas

 

0 Kudos
Message 1 of 24
(7,811 Views)

Test Reply

0 Kudos
Message 2 of 24
(7,796 Views)

Nicolas,

 

I am not sure I understand what you are trying to do.

 

Are you acquiring a signal for 1 second and then trying to create a new signal with the same spectral characteristics but lasting 5 or 10 seconds?

 

Can you give an example showing what your typical input looks like and what you want the output to be (without worrying about how to do it)?

 

Lynn

0 Kudos
Message 3 of 24
(7,790 Views)

A fundamental assumption of the FFT is that the time-domain signal is periodic, so you just need to view the points you get from the iFFT as one period.  To extrapolate, you just keep repeating the same points.  If your original time series is 1 sec and you want to generate a 5 sec signal, just repeat 5 times.

Message 4 of 24
(7,782 Views)

Darin,

 

If your signal does not have an integral number of periods in the original time series, repeating like that will cause phase discontinuities at each repeat.

 

Lynn

0 Kudos
Message 5 of 24
(7,775 Views)

 


@johnsold wrote:

Darin,

 

If your signal does not have an integral number of periods in the original time series, repeating like that will cause phase discontinuities at each repeat.

 

Lynn


 

Likewise, if the sampling interval is not commensurate with the "real" signal period, then the FFT spectrum will show bin leakage due to aliasing.  The FFT is an approximation, and a fundamental assumption is that the real signal is bandwidth limited and periodic in the sampling interval.  If either assumption is bad than the approximation is bad, and the extension of the iFFT time series will show jumps among other things.  It is a fact of life.  Without more information, I see no reasonable assumption to make for extrapolating the time series other than the fundamental assumption made by the FFT, the signal is periodically repeating.

 

Now, when I see such behavior (jumps or bin leakage) I can try various tricks such as filtering, binning, windowing, or trimming the time series, but that involves additional assumptions about the input signal and differing trade-offs.  I'll wait and see what the OP is looking for.

Message 6 of 24
(7,764 Views)

Hello,

 

"Lynn> Are you acquiring a signal for 1 second and then trying to create a new signal with the same spectral characteristics but lasting 5 or 10 seconds?"

Yes it is exactly that: variable size generation.

I make the assumption that the signal spectrum can "regenerate" the signal but for a variable length,

since I well understand Fourier...

Actually, we can provide the FFT size in a FFT input, then the iFFT reverse and generate the signal (but same size).

 

"Lynn> Can you give an example showing what your typical input looks like and what you want the output to be (without worrying about how to do it)?"

Actually, i'm using 1D seatemperature example provided by Labview.

In future, I want to use it on weather phenomena like Solar intensity on a PV cell to predict energy availability.

I'm working on wireless sensor networks and energy power management, this kind of prediction can help making DPM /energy policy choices.

I make assumption that the signal is periodic or near-periodic because tighly coupled with natural phenomens. (This probably not exactly true but mathematically i think it can be true to extrapolate/generate variable length signal.)

 

"Darin> To extrapolate, you just keep repeating the same points.  If your original time series is 1 sec and you want to generate a 5 sec signal, just repeat 5 times."

The ouput will be the same shape signal repeated but not copied in the time-domain.

 

"Darin> Likewise, if the sampling interval is not commensurate with the "real" signal period, then the FFT spectrum will show bin leakage due to aliasing.  The FFT is an approximation, and a fundamental assumption is that the real signal is bandwidth limited and periodic in the sampling interval.  If either assumption is bad than the approximation is bad, and the extension of the iFFT time series will show jumps among other things.  It is a fact of life.  Without more information, I see no reasonable assumption to make for extrapolating the time series other than the fundamental assumption made by the FFT, the signal is periodically repeating."

Yes, you both right, may be i'm wrong with the true periodicity of my input signal so approximation will be wrong too.

But i must be able to regenerate a variable length signal in the time-domain from an arbitrary spectrum !?

 

I think it is not possible by using the iFFT transform is that form,

i found NI_AALBase.Tones and Noise.vi can generate a signal base on its tones.

My problem is here to provide the tones from the FFT coef.

 

 

I provide you my experiments (don't bother about the wavelets elements).

 

Thanks for your replies.

Nicolas

 

 

0 Kudos
Message 7 of 24
(7,733 Views)

I have converted FFT Coef (Re + Img) to Frequence, Amplitude, and Phase to create tones.

But I have something wrong with Frequency may be ??

 

Nicolas

0 Kudos
Message 8 of 24
(7,718 Views)

I don't have all of the subVIs so I can't test, it appears to be a brute force implementation of the Inverse FFT.  One thing you should track down is that the phase output of Complex to Mag/Phase is in radians while the Multitone uses degrees (if memory serves).

0 Kudos
Message 9 of 24
(7,713 Views)

Here the new Vi,

I change the code for you can run the test without special VI requirements.

The data file is provided too as an attached file.

 

In this code, i use the traditional iFFT approach where I cannot change the regenerated signal size.

If I try to insert zero fourier coef, the rebuild signal is good size but the signal is the same shape with more dots:

its like the Fourier Interpolation VI.

 

So, i try a second approach. Its just like a signal generator we can find in some sound generator example.

I added the Rad to Degree conversion but I have still a problem again to transform Fourier Coef into (Freq, Ampl, Phase) couples.

 

Any ideas !?

 

Nicolas

Download All
0 Kudos
Message 10 of 24
(7,695 Views)