12-25-2013 10:51 AM
Actually I have project to cancel noise ( active noise control using loudspeaker ) and my signal processing is labeled and am using labeled 2011 I want to squire signal from speaker that is connected to signal generator and the parameters of this signal want to send it out to loudspeaker connected to the laptop so it can cancel eachother and no sound detected >>> i have used DAQ to eliminate the delay as I worked before without DAQ and there was delay >>> now when the signal came out to the canceling speaker isn't match with the signal that is generated >>>>>I want to make the signal out of phase 180 so that it can cancel >>>>> I hope if u can help me i will appreciate this very very much thanks again
Solved! Go to Solution.
12-25-2013 11:45 AM
Please do not post the same message to multiple threads. The other threads were for similar but not identical questions and are several years old, so please keep this discussion here.
It is not clear from your post what particular problems you have. Please be as specific as possible.
What is the frequency of the signal you want to cancel?
What is the DAQ sampling rate? How many samples do you acquire with each read?
How are you measuring the delay you mention? What is the timing reference?
How are you generating the output signal? How are you trying to create the phase inversion?
How are you determining the effectiveness of the cancellation?
What is the physical configuration of the speakers and microphones?
Lynn
12-25-2013 12:54 PM
Thanks a lot and I will keep the discussion in here
my aim is to cancel frequency less than KHz and my experiment I use 300 hz
my daq sample rate is Thousand samples per second
the samples I a quire is 10000
I tried to measure the time delay between signal input and output by autocorrelation ( timing reference I don't used I hope if I know)
I am generating output signal through DAQ output that is connected to speaker
i am trying to make the phase inversion but i donot know how this is one of the problems that i want to solve and asking about it I just tried by getting the same parameters from the input signal and send it to the speaker and play with phase by slider
effectiveness of the cancellation I know by the delay in output and no sound reduced between input and output
The speaker and microphone configurations( the microphone is between the two speakers ( one speaker as input connected to signal generator(getting signal input ) and another speaker connected to the PC as the output device )
I have attached the code that I am trying and I hope u can help me because I amount that professional in labeled am in learning time
thanks million in advance
12-25-2013 12:56 PM
this is correction lyn i apologize
my frequency is less than 1 khz
my daq sample rate is 120000 samples per second
12-25-2013 02:19 PM
You have several problems.
The Acquire Sound VI collect 10 seconds of sound before it returns to the main VI. Thus, you have at least a 10 second delay between the sound produced by the external signal generator and the beginning of the processing in your VI. That will absolutely prevent any realistic cancellation.
The sound acquisition rate is 48 kHz. The Simulate Signal sample rate is 10 kHz. The DAQ Assistant for the output appears to have a 10 kHz sample rate although you posted a correction saying it is 120 kHz. While not absolutely necessary, it makes things easier if all the sampling rates are the same.
Array to Cluster -> Unbundle -> Bundle -> Unbundle ??? A simple Index Array expanded to two elements would give the same result. The first two elements of the Power Spectrum array coming out of the Power Spectrum VI represent the power at DC and the power at frequency df, where df = fs/N. If fs = 48000 Hz and N = 10 seconds*48 kHz, then df = 0.1 Hz. (Read the Detailed Help for the Power Spectrum.vi). Most sound cards are AC coupled so it is likely that the values of the first two elements are very close to zero. The frequency should be set to Index of first PEAK (not first element)*df and the amplitude to the amplitude of the first peak. EXCEPT that the spectral peaks may not be exactly at the frequency of the signal due to spectral leakage and other effects. Try the Extract Single Tone Information.vi. It finds the frequency and amplitude of the dominant tone.
To get effective cancellation the time delay between the input signal and the output signal must be minimized. To get effective frequency estimation, the number of cycles of the input signal should be large. Any program running under Windows (since you are using the DAQ Assistant, you must be using Windows) will experience unpredictable delays on the order of milliseconds to tens of milliseconds. Such delays are much larger than 180 degrees of phase shift at frequences of a few hundred hertz. So you may be able to demonstrate proof of concept but you will not get really good, consistent cancellation.
Lynn
12-26-2013 01:35 AM
thank you very very much lynn
firstly i got all ur useful information and i will take advantage of it >>>
second thing i am afraid that my concept is not that clear so can u tell me by edittting my programm attatched so i can know more and if u can add or remove any fucntion that u can see it is useful i will apperciate that .... lynn i amnot in engineeing sound feild rather i am in mechatronics so i donot have background for things like this thats why i m stcuk in my project .... i have searched and i couldnot find certain guide that can guide me to zoom in the idea in my mind ....
12-27-2013 08:32 AM
lynn firstly i would like to thank u and i want to say that i need ur help hope u can reply me
""""To get effective cancellation the time delay between the input signal and the output signal must be minimized. To get effective frequency estimation, the number of cycles of the input signal should be large."" how i could do that
12-27-2013 01:22 PM
That is what engineering is all about - choosing the compromise between conflicting requirements which best matches the needs of the customer!
The VI attached simulates cancellation in two ways. I hope this will help you understand some of the issues involved.
It generates a sine wave of frequency 10.1 Hz with amplitude 1 and phase 0. This is displayed on the graph Sine phase 0. It uses the Tones and Noise.vi. Although I used only one tone and no noise, this VI was chosen so that a more complicated simulation could be added if desired. Note that reset phase is True on all the Tones and Noise VIs.
A second copy of the Tone and Noise.vi generates another sine with the same frequency and amplitude but with the phase controlled by the phase control on the front panel. The phase is in degrees. It is displayed on Sine plus phase. Odd multiples of 180 degrees should give cancellation. The two sine waves are added and displayed on Sum of sines.
The second method is a model of what you are trying to do with your microphone, speakers, and DAQ system. It takes a subset of the original sine wave (displayed on Subset) and uses the Extract Single Tone Information.vi to get the frequency, phase, and amplitude of the subset. The use of the subset is to show the effects of trying to measure the frequency quickly. The outputs of the Extract Single Tone Information VI are used as inputs to another Tones and Noise VI (with 180 degrees added to the phase). It is displayed on Sim sine. This represents the cancellation signal you are trying to generate. It is added to the original sine and the sum is displayed on sim sum.
Run the VI with various values of phase and length to see the effects. Notice that the cancellation is not perfect and not identical at 180, 540, and 900 degrees. This is due to round off effects related to the finite size of the representation of numbers in the computer. Notice that the sim sum "cancellation" is orders of magnitude worse although still quite good until the length gets below 200 which results in 2 full cycles of the sine wave going to the Extract Single Tone Information.vi.
Now consider that noise, sampling effects, and the phase shift due to the time the sound takes to travel from speaker to microphone will all add more uncertainty to the inputs to the cancellation sine generator.
Lynn
12-27-2013 02:00 PM
thanks alot and i really i am thankful for u
by the way how can i merge this code with my old code as i am confusing and i don't get the whole idea about the code so i can try and see
it is required that i aquire the signal and send the output to the daq that is connected to the speaker >>>> my question is how i match my old code with the new file u send me ???? hope u got my question
thanks in advance and i have to no way to express my grateful to appreciate ur help
12-31-2013 11:37 AM
hello lynn
hope i donot disturbe u but i really need ur help i got ur useful porgam that u sent to me but i couldnot use it as i donot understand it well
can i use this ( as i explained to u my project ) >>>> how please ?
thanks alot
regards