LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Signal extrapolation with FFT

Solved!
Go to solution

 

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

0 Kudos
Message 11 of 24
(2,357 Views)

up

0 Kudos
Message 12 of 24
(2,334 Views)
Solution
Accepted by topic author nferry

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

0 Kudos
Message 13 of 24
(2,303 Views)

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.

0 Kudos
Message 14 of 24
(2,288 Views)

 


@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 :D)

 

(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.)

 

 

 

Message 15 of 24
(2,273 Views)

 


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

 

Download All
Message 16 of 24
(2,261 Views)

 

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.

 

Download All
0 Kudos
Message 17 of 24
(2,219 Views)

 


@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. 😄

 

 

 


@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. :D)

 

 


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

 

 

 

 

0 Kudos
Message 18 of 24
(2,194 Views)

 


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.

 

Message 19 of 24
(2,182 Views)

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

 

0 Kudos
Message 20 of 24
(2,167 Views)