LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fourier Transform of a CSV type data

Solved!
Go to solution

Thank you so much, I will try this and update you. 

0 Kudos
Message 11 of 25
(1,111 Views)

Hi ,

 

Using r/theta to complex now I don't get anything in time domain.

Download All
0 Kudos
Message 12 of 25
(1,083 Views)

@Alias110 wrote:

Hi ,

 

Using r/theta to complex now I don't get anything in time domain.


As I said earlier, your data is incomplete. Your CSV has wavelength and magnitude, to invert a FFT you need two pieces of information. Look at the example below, read up on the FFT.

 

mcduff

 

snip.png

0 Kudos
Message 13 of 25
(1,066 Views)

Thanks, but that's all I can get from a spectrometer. 

 

So, let's say I assume my spectrum is close enough to Fourier Transform limit. Since the constant or even linear phase does not change the pulse and only shift it in time domain, to perform the program, how about adding a linear phase in the 3rd coloumn of the CSV file ?

 

I added that, but the out put (in time domain) was range of 3 pulses. 

 

The spectrometer does not produce any information about the phase. I like to know your thought for this.

Thanks, 

0 Kudos
Message 14 of 25
(1,054 Views)

This is out of my knowledge.

 

You can make some assumptions, but the spectrum you obtain will not be unique. For example assume you have two sinusoids in the time domain. The power spectrum gives two delta functions at their respective frequencies. Without knowing the phase between them, the time series I construct may not look anything like the original signal.

 

I suggest looking for algorithms that make clever assumptions in order to better guess your real signal.

 

mcduff

0 Kudos
Message 15 of 25
(1,046 Views)

I haven't found solution yer. Does anybody has other suggestion? Should I make an extra third column in my data? In Matlab I have done this and the solution consistent with mathematical models. 

0 Kudos
Message 16 of 25
(1,018 Views)

Look at the example below.

 

Snap18.png

 

Look at the difference between the original signal and the one where the phase is set to 0. The one where the phase is set to 0 STILL shows two sinusoids but the exact relationship between them is different than the original signal. You need to decide if you are willing to live with that. Without a complete transform you can only guess.

 

2019 version attached, play around with it to see what you are willing to live with. What you are asking is impossible to determine. You are asking to put something back together without having all of the pieces or even knowing what the missing pieces look like.

 

mcduff

Message 17 of 25
(1,010 Views)

Before accepting this as solution, I just have a quick question: I do not want to underestimate the power of  Lab View, but isn't this a weak spot? I mean if I have a spectrum including only amplitude vs frequency, I can get its FT in Matlab, for example, which shows the graph in time domain. There, I do not need to come up with making some extra column just for technical reason. But here I have to do so...

 

Again, this is just to further explore as I am very new beginner in LabVIEW.  

0 Kudos
Message 18 of 25
(980 Views)

I am not sure what you are doing in Matlab because you haven't posted the code.

 

This is NOT a LabVIEW problem, please read up on the FFT and its properties.

  1. A FFT has two parts, Re and Im or Mag and Phase. Both are really the same thing just different representations of the data.
  2. To correctly invert a FFT, then you need to have both pieces of information. This is a math fact, not a software problem.

Maybe your original Matlab program has both pieces of information, maybe you are doing the FFT, not iFFT, of a series and you only need one column, BUT this is not a LabVIEW problem.

 

The FFT and iFFT are not the same thing in Matlab; make sure you are using the correct function. See this link

 

mcduff

Message 19 of 25
(972 Views)

Can you tell us more about the spectrometer you're using to collect the data? I find it extremely hard to believe a spectrometer wouldn't give you phase data.

0 Kudos
Message 20 of 25
(965 Views)