NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
nferry
Posts: 45
0 Kudos

Re : Signal extrapolation with FFT

 

Any idea or example  to convert FFT Coefficients (z = a + i.b) to Frequency, Amplitude and Phase ?

Member
nferry
Posts: 45
0 Kudos

Re : Signal extrapolation with FFT

up

Member
nferry
Posts: 45
0 Kudos

Re : Signal extrapolation with FFT

[ Edited ]

Ok I found a solution.

 

The VI extrapolate a given periodic signal,

it just seems that amplitude coef may be not exactly the same at reconstruction for some signals.

But demonstrating the concept.

 

Best regards

Knight of NI
altenbach
Posts: 27,054
0 Kudos

Re : Signal extrapolation with FFT

You are kidding yourself!

All you are doing is repeating the fft with a lot of unecessary code. Please read again Darin's first reply.


LabVIEW Champion . Do more with less code and in less time .

Knight of NI
altenbach
Posts: 27,054

Re : Signal extrapolation with FFT

 


altenbach wrote:

You are kidding yourself!


 

For demonstration, compare the result of your code with a simple partial repeat of the original data. The attached  quick modification shows both. (See also this honorary mention :smileyvery-happy:)

 

(Of course the "green version" needs a little bit more code in case the appended size is larger than the input array, but it should still show you the general concept. Modify as needed.)

 

 

 


LabVIEW Champion . Do more with less code and in less time .

Knight of NI
altenbach
Posts: 27,054

Re : Signal extrapolation with FFT

[ Edited ]

 


altenbach wrote:

(Of course the "green version" needs a little bit more code in case the appended size is larger than the input array, but it should still show you the general concept. Modify as needed.) 


 

Here's one possibility that also works if the extrapolated lenght is larger thatn the input. (Make sure y is positive).

 


LabVIEW Champion . Do more with less code and in less time .

Member
nferry
Posts: 45
0 Kudos

Re : Signal extrapolation with FFT

[ Edited ]

 

Hello Altenbach,

 

Think you for your contribution but

the "repeat approach" does not consider a potential change of resolution of the signal,

where FFT coef is a mathematical representation of the signal, so is more resolution independant.

The "fourier extrapolation" can also reduce the signal initial lenght, where the "repeat method" cannot without code adding.

 

Like Lynn says, the "repeat method" have also phases discontinuities at boundaries.

Just try with fixing a signal lenght of 733 for example.

But after verification this true also for the "Fourier extrapolation"...

 

I'm myself a person who looking for the "simplest/best code way",

but please be careful while applying this philosophy to mathematical representation,

because in computer science, we can think with finite discrete elements,

but keep in mind this is an approximation of the reality...

(To my mind mathematical is also an approximation...)

 

Neverthelees, your optimization is quite interesting, thanks.

And at final "fourier extrapolation" sound more effective for purely periodic signal.

 

I try to add "Wavelet decomposition" to handle aperiodic signals,

Decomposing into multiple scales signals and then apply fourier extrapolation at eaxh scale.

But the result appear to be similar to the simple fourier extrapolation way.

 

I provide you some signals (doppler, etc...),

whereas a humain brain can easily apply an extrapolation,

I searching a way to predict these kinds of signals, but not for purely noisy or wall street curves.

 

Best regards

Nicolas

 

PS: Please can you add a link to invite the Rube Goldberg readers to come in this forum post,

they can made there home opinion. Thanks.

 

Knight of NI
altenbach
Posts: 27,054
0 Kudos

Re : Signal extrapolation with FFT

 


nferry wrote:

 

... where FFT coef is a mathematical representation of the signal, so is more resolution independant.

The "fourier extrapolation" can also reduce the signal initial lenght, where the "repeat method" cannot without code adding.


Just throwing more math at it does not add anything new to the data. Adding code for a "shortening" is also trivial. A simple "array subset" or "reshape array" will do. Anything is better than your monster code. :smileyvery-happy:

 

 

 


nferry wrote:

Like Lynn says, the "repeat method" have also phases discontinuities at boundaries.

Just try with fixing a signal lenght of 733 for example.

But after verification this true also for the "Fourier extrapolation"...


Of course it is also true. Both methods are mathematically equivalent! FFTs are not some magical elixier, they have an exactly defined meaning. (You are just getting potentially more rounding errors due to all the extra computations. :smileyvery-happy:)

 

 


nferry wrote:

PS: Please can you add a link to invite the Rube Goldberg readers to come in this forum post,

they can made there home opinion. Thanks.


I thought the RG post has a link. Right? Look on the second line there. :smileywink:

 

 

 

 


LabVIEW Champion . Do more with less code and in less time .

Knight of NI
altenbach
Posts: 27,054

Re : Signal extrapolation with FFT

[ Edited ]

 


nferry wrote:

The "fourier extrapolation" can also reduce the signal initial lenght, where the "repeat method" cannot without code adding.


You don't really need to add much code to support negative y inputs, here's one possibility.

 


LabVIEW Champion . Do more with less code and in less time .

Member
nferry
Posts: 45
0 Kudos

Re : Signal extrapolation with FFT

Hello,

 


nferry wrote :

 

the "repeat approach" does not consider a potential change of resolution of the signal,

where FFT coef is a mathematical representation of the signal, so it is more resolution independant.

 


That's why, FFT can be used for interpolation (see Labview Fourier Interpolation VI)

 

but not for extrapolation because it performs signal repeats in the time domain,

and it suffers from boundaries discontinuities.

 

I credit you for a Kudo for the optimization,

and my initial hypotesis to use Fourier is wrong here.

At final extrapolation cannot be done without signal assumptions.

 

Nicolas