LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reconstructing signal from FFT

Hi folks,

 

I am new to labview, and presently working on signal processing and analysis. I have a time domain signal, so i want from a frequency averaged time domain signal, i.e i convert my signal to frequency domain and average it there and do inverse transorm of the averaged signal.

 

 

So using above, i tried to use FFT and Inverse FFT for time being to see whether i get the time domain signal back from the freqency domain signal or not. But what i got was not what i wanted. 

 

Original Time domain ----------(FFT)----------Frequency domain----------(Inverse FFT)-----------Obtained time domain

 

I am attaching my VI here. Please help me figure out this, that why is my original time domain signal and obtained time domain signal are not same

0 Kudos
Message 1 of 12
(4,393 Views)

Use the matching FFT function and it should work.

0 Kudos
Message 2 of 12
(4,377 Views)

This is expected behavior. As you are NOT using the same functions for FFT and inverse FFT (read: the mathematical representation), the signal has to differ.

 

Instead of using the function, which already uses averaging and windowing, you should use the FFT.vi for transform:

fft.PNG

 

This will result in a very close signal as inverse FFT as you fed into the FFT.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 12
(4,376 Views)

 

Thank you Norbert, 

 

       Actually i wanted a Frequency averaged time domain signal sir. So i wanted o use to use this block. Here i didnt wire anything to averaging parameter of the FFT block so, at present by default it is not averaging. 

 

And sir if i use the FFT block u mentioned above how will i have go for frequency averaging.

 

Regards

Rex

0 Kudos
Message 4 of 12
(4,368 Views)

Even if you select No averaging, the output of the FFT Spectrum (Real-Im).vi is not the same as the output of the FFT.vi. It uses FFT.vi internally but also converts the output to a single sided spectrum. It also applies a Hanning window as default. As a result the inverse FFT you calculate will not match the input data.  You can open the block diagram of FFT Spectrum (Real-Im).vi to see how NI does things. 

 

Since you want to use the Inverse FFT to recover the time domain signal after averaging, you will need to maintain the spectral signal in a format compatible with the Inverse FFT.vi. I would probably use FFT.vi (which produces a two-sided complex spectrum), do the averages on the complex data, and then use the complex inverse FFT.

 

Do you have some typical data for which you know what the expected output should be that you can post?

 

Lynn

 

 

0 Kudos
Message 5 of 12
(4,340 Views)

Yeah Johnsold thats right, i saw changing the windows and using a sine signal. I observed that it was single sided spectrum and also that was happening due to the window used. So i replaced it with FFT.vi and Inverse FFT.vi and now am being able to reconstruct the signal with almost a very less error. 

 

I am still in a dilema how shall i do the averaging thing in this case. I would be glad if get a help over that.

 

I am attaching my VI here, that computes fft and then inverse fft. I wanted some help with any logic that could help me do averaging in frequency domain.

0 Kudos
Message 6 of 12
(4,322 Views)

I am not sure what your goal is. Averaging will alter your data, so averaging your frequency domain and THEN using an inverse FFT will ALWAYS result in a very different signal in time domain compared to your original signal.

 

Next question is, what kind of averaging you want to perform. Is it sliding average? A "block" average?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 7 of 12
(4,309 Views)

Do the averaging in the time domain !   There is no difference , since every FFT averaging ingnoring the phase will make your inverse FFT useless .....

 

Sound a bit like: I want a Lockin amp like averaging without having to now the frequency.....   😉

 

 

So what type of signals do you have?

What is the problem?

 

Spoiler
Gib' mal Butter bei die Fische
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 8 of 12
(4,299 Views)

I agree with Norbert and Henrik. You need to tell us what your goal is - what do you expect to accomplish by frequency domain averaging? There might be a better method.

 

Lynn

0 Kudos
Message 9 of 12
(4,284 Views)

First of all, Thanx for responding. Actually i have some acceleration data aquired at 40 kS/s. So i need to take a set of data points over 1 second as a chunk, convert it to Frequency domain and need to average 10 sets of such (1 second) chunks in frequency domain. So its like block average, where i take a block of 1 second data and average 10 such blocks in frequency domain  and convert back that averaged data to obtain a final block of 1 second data.

 

Hope its clear. Smiley Happy

0 Kudos
Message 10 of 12
(4,257 Views)