LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fourier Transform of a CSV type data

Solved!
Go to solution

Hi,

 

I have a power spectrum ( intensity vs wavelength) and I want to calculate corresponding graph in the time domain. I have already done this in MATLAB. But now in LabVIEW I have two issues: 1- the graph in time domain is upside down 2-  the FWHM in time domain is 2 orders of magnitude bigger it should be. 

 

Thanks for your help

Download All
0 Kudos
Message 1 of 25
(3,159 Views)

I'm confused.  Your CSV file contains data in a spectrum format already.  Intensity vs. wavelength.  (Or actually the reverse of that since a longer wavelength would mean a lower frequency.)

 

Then you want to do an FFT on that?  So you want the spectrum of a spectrum?

 

It doesn't make sense.

0 Kudos
Message 2 of 25
(3,135 Views)

He wants to convert his frequency domain data back to time domain, so he needs an inverse FFT.

 

OP, could you save your VI in 2018 or earlier? I don't have 2019 yet.

 

Edit: Apparently you can use forward FFT algorithms to do inverse FFT transformations, maybe this is what the OP was going for (still haven't seen the code though): https://www.dsprelated.com/showarticle/800.php

0 Kudos
Message 3 of 25
(3,128 Views)

Thanks for quick response, 

 

I need to be careful about the word choice. In frequency/wavelength domain we call that spectrum and in the time domain we call the graph the intensity. 

 

So, I have the spectrum ( which is a pulse) in the wavelength/freq domain and I want to obtain the pulse in the time domain which usually is called temporal intensity. 

0 Kudos
Message 4 of 25
(3,126 Views)

Thanks , 2019 is the one our schools offers us to use. I'll see whether I can get that.

0 Kudos
Message 5 of 25
(3,123 Views)

You can back-save in any older version, just use File-Save for Previous.

0 Kudos
Message 6 of 25
(3,119 Views)

Thanks much, please find the attached file. 

0 Kudos
Message 7 of 25
(3,112 Views)

@Alias110 wrote:

Hi,

 

I have a power spectrum ( intensity vs wavelength) and I want to calculate corresponding graph in the time domain. I have already done this in MATLAB. But now in LabVIEW I have two issues: 1- the graph in time domain is upside down 2-  the FWHM in time domain is 2 orders of magnitude bigger it should be. 

 

Thanks for your help


I think there are some language issues here.

  1. Your CSV file looks like wavelengths (or frequencies) and a 2nd column of all 0s. I don't think this is correct.
  2. If you really have a power spectrum, that will not work. To invert a FFT, you need Mag and Phase or Re and Im, two pieces of information. The power spectrum is an amplitude spectrum roughly speaking.
  3. From your VI it looks like you are trying to do a 2d FFT, you should use a 1D Complex iFFT and hopefully your columns have Re and Im or Mag and Phase. Use the complex math palette to get the correct form.

mcduff

0 Kudos
Message 8 of 25
(3,079 Views)

Thanks for your comments.

 

1- about the CSV file, I think maybe you have not seen the whole values. It starts with zeros as I subtracted background but at the middle you can see the non-zero values. So in the tails you have zero but not everywhere. 

 

2- That's exactly what I  want to figure out and if you look I have used Complex to r & theta. 

 

3- Thanks for suggestion. I have use FTT, and seperately tried to inverted wavelength into time with another for loop as you can see. But I will try your suggestion (IFFT) and will update the result here. 

 

Thanks again, 

0 Kudos
Message 9 of 25
(3,074 Views)

Something like this:

 

snip.png

 

mcduff

0 Kudos
Message 10 of 25
(3,058 Views)