09-17-2012 05:10 PM - edited 09-17-2012 05:16 PM
Hey,
Currently, I'm working on a little project, where i encounter a nasty bug in my code...
The aim it two produce four (sine) waves, mix them, and pass the resulting signal to DAQ on the audio channels.
The "crackling" occurs, e.g., at an frequency of 502Hz... but not at 500 Hz.
So, how works the program so far?
- I've created two physicals channels for left/right audio outputt
- "Don't allow regeneration" in the property node in "DAQ Write"
- Used "continuos" sampling in "DAQ timing.vi", with a specific sampling info (20k sampling rate, 5k samples)
- Then the resulting wave (after a little procedure, which shouldn't be the problem, i assume) in the DAQ buffer and start the task
I think, the reason for the problem is, that the after one wave packet of 5000 samples is written on DAQ, the next doesn't neatly fit, such that a little "kink" occurs.
So, has anybody an idea??
P.S.: I have attached a zip file with the project and all the sub-vis.
Channel.vi: Just checks, wheter left, right channel, both or none of them is activatet for one of sine waves converts the information into an integer
mix.vi: Actually mixes the four signals, by simply addition of arrays (and therefore has to check, wheter the sin should be left or right)
volt_check: scales the output amplitude, when exceeding |+-1V|
09-17-2012 06:03 PM
Jurgen_D,
It appears that you have the number of samples set at 750. For some frequencies, such as 502 Hz, the generated signal will not contain an integer number of cycles. This means that the packet will start and end at different voltages. That sudden change can be very audible as a click.
From the look of your code it appears that you have very little experience with LabVIEW. Sequence structures, local variables, controls not wired to anything, and multiple nodes with no data dependencies are all signs of someone who has experience with text-based programming languages and has not embraced the LV dataflow paradigm.
I recommend that you look at the on-line tutorials and other materials available to help you to learn to program effectively in LV.
Lynn
09-26-2012 09:38 AM
Hello Jürgen,
it is obvious that you found the right labview example for your application.
"Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi" shows how to output an analog voltage with a hardware clock and continious generation of the data.
Did you try if the signal which is gernerated from the original example produces the "clicking noise" too?
Please make a Demo-VI with as little overhead as possible and minimize the application to the basic problem.
Please try not to use Variables - they are not necessary in your application.
If you want to transfer data with less connections simply use a cluster.
Best regards,
Peter