Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

WriteWaveform for audio testing makes output transients

I have an app in vb.net VS 2005 & MeasurementStudio S 8.1.2 that measures the distortion from a loudspeaker and adjusts the stimulus to maintain x % THD.

So, I'm doing a frequency sweep (with amplitude changes) from say 20 - 200 Hz, measuring every 2Hz the THD and adjusting the amplitude for x % THD, using a USB-6212's analog output to drive a audio power amplifier and the analog inputs to acquire microphone signal. The input part works fine and the output part works but I get a "pop" from turning off the signal and turning it back on to update the output. The pop is from not being able to turn on or off at the sine wave's zero crossing. 

 

Here is code snippet that updates the waveform at one frequency, inside a frequency sweeping loop

do

---Generate sine waveform using Analysis.SignalGeneration.BasicFunctionGenerator at frequency F and amplitude A

 

OutputTask.AOChannels.All.DacConnectReferenceToGround = True' this eliminated the turn off pop, nice fade out of signal

OutputTask.Stop()' have to stop the output to update the output
Writer.WriteWaveform(True, waveform)' waveform is generated using the MS BasicFunctionGenerator the "True" is autostart, makes no difference from using separate OutputTask.Start

OutputTask.AOChannels.All.DacConnectReferenceToGround = False' signal back on here, likely with transient from not being at zero crossing

 

---acquire input data from microphone, calculate THD, make amplitude adjustments if THD <> target

loop until THD = target %

 

 

 

 

----

 

 

0 Kudos
Message 1 of 2
(4,052 Views)

hey p15218, 

 

Could you clarify the question you have for us? This is a little confusing. Thanks!

--
Peter Rifken - Field Engineer & Business Manager
Boston / North New England & Maine
0 Kudos
Message 2 of 2
(3,999 Views)