LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate signal using transfer function

I'm using LabView to input acoustic white noise signal into a room, measuring the resulting room noise and generating a transfer function. In LabView, how do I apply the Transfer Function's Magnitude and Phase information to correct any future input signals, example sine, for the system distortions accounted for with the Transfer Function?
0 Kudos
Message 1 of 5
(3,203 Views)
Don't use the Transfer function itself. Take a look at what it's doing.
If you open it up, you'll see it basically divides the spectrum of the response by the spectrum of the stimulus. The rest is housekeeping to make display easier.

So: Xfer = Response / Stimulus (In freq. domain).

If want a given response, turn that equation around and adjust your stimulus:
Response = Stimulus * Xfer.

In other words, take your stimulus signal, and get it's spectrum.
Multiply that spectrum by the Xfer function, and convert back to the time domain, before output to the amplifier.

Keep in mind that your Xfer function is the SYSTEM xfer function, meaning that it measures the xfer function of the whole system (D/A converter, amplifier, speakers, room acoustics, microphone, preamp, A/D converter).

If you want to output a sine wave, you could generate the spectrum directly, without generating a sine wave and taking it's spectrum, but that's another question...
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 5
(3,196 Views)
I can see how this will account for the magnitude, but how do you account for the phase in your procedure?
0 Kudos
Message 3 of 5
(3,196 Views)
Keep in mind that the result of the FFT is a complex number. That means it includes REAL and IMAGINARY components. For display purposes you usually convert REAL and IMAG to MAG and PHASE, but for math purposes, you keep it in REAL and IMAG.

Try this experiment:
Generate a sine wave and graph it.
Take the spectrum of it.
Multiply that spectrum by a single CDB constant: 0+1i
Take the inverse FFT of the result and graph it.

Notice how the result is offset by 90 degrees? The complex number includes the phase info you need.

When you multiply a complex number by a complex number, you shift the phase (unless the imaginary part is zero).
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 5
(3,190 Views)
Keep in mind that the result of the FFT is a complex number.


To be more clear, I should have said:
Keep in mind that the result of the FFT is a set of complex numbers, one for each frequency.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 5
(3,189 Views)