LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can i get a continuous signal from iterated iFFTs?

Hello,

 

I'm looking to use national instruments equipment software and/or hardware to filter a sound according to a frequency transfer function. The catch is that the frequency transfer function has to be selected in near realtime. My sounds can be pre-rendered, or played with a separate device, but the frequency domain of the sound has to be filtered like an equalizer would.

 

In regard to the math, after:

1. simulating a white noise signal, or import a .wav file

 

i would then have to:

2. transform the signal to the frequency domain (with FFT)

 

then... contingent on an input variable, select a predefined frequency transfer function and:

3. in the frequency domain, mutliply the signal by the selected frequency transfer function

 

then take the new frequency domain signal and:

4. tranform the frequency-modified signal back to the time domain (iFFT)

 

and finally:

5. play the signal as continuous audio output

 

Since the original signal (unfiltered sound) can be pre-rendered, the computation problem lies in developing an algorithm to apply changing frequency transfer functions while retaining continuity of the signal. The frequency transfer function used in #3 is selected from a set of previously defined data. I have a set of frequency domain signals, and one is selected based on an input... for the sake of simplicity, let's say that the frequency transfer function is selected based on a simple list box point-and-click type selection in the labview front panel.

 

My problem is generating an output sound that has continuity.

 

In regard to a solution using a PC, I understand that a minimum amount of samples has to be written to the soundcard at a given time. My PC's minimal buffering limit seems to be able to write 2205 samples to the soundcard's buffer at a time (@44.1KHz, this is 50ms of sound) without any popping or clicking sounds.

 

This is a great first step... but each set of 2205 samples is not continuous from #4, so there are inherent pops every 50ms when discontinuous sound samples are being concatenated...

 

I have tried the iFFTptbypt.vi... but, when runnin on point by point data.. the function does not come even close to keeping up with rate at which an output signal needs to be rendered.

 

What is the best way to do this? My VI is ugly and plagued with various loops to load the frequency transfer functions from files, etc.. so I don't want to post the VI...

 

Is software via PC the best way to do what I want... or do i need some sort of NI hardware to filter a sound in near realtime? 50ms resolution on updating the frequency transfer function is probably the longest latency my application can handle... so PC solution is likely viable if the "signal>FFT> * transfer function>iFFT" process can keep up with producing data fast enough for sending to the sound card.. but how do i keep the signal continuous?

 

Thanks in advance

 

Brian

 

 

 

 

 

0 Kudos
Message 1 of 2
(2,647 Views)

Hi Brian,

 

Would it be possible to use an impulse response function (IRF) instead of a transfer function? With the IRF you would eliminate the steps of doing the FFT and the iFFT. This would save time in your computations. LabVIEW has an Impulse Response Function PtByPt VI that could be used for this.

 

You could also use the Producer/Consumer architecture to streamline your code. With this architecture you could separate your acquisition from your processing such that they could run in parallel, or you could separate your processing from your output. You can open a Producer/Consumer template in LabVIEW by going to File»New... then in the folder structure choose VI»From Template»Frameworks»Design Patterns»Producer/Consumer Design Pattern (Data).

 

If you want to stick with the FFT method, you should look into using windowing. With the windowing VIs in LabVIEW (Functions palette»Signal Processing»Windows) you can apply different types of windows to your data, which should eliminate discontinuities.

 

Take care!

Tanya Visser
National Instruments
LabVIEW Group Manager
0 Kudos
Message 2 of 2
(2,623 Views)