LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Noise cancelling headphones

Im demonstrating how noise cancelling headphones work.
Using the NI Elvis II and Labview.

Im using a mic to pick up the noise and use an mp3 player.
I will combine the two sounds and use the adpative filter kit to remove the noise(mic) and the output is played to headphones.
Iv started building the circuit on Labview but have some problems.
I would appretiate any help as my work is due in 2 weeks. 
Thank you.

0 Kudos
Message 1 of 10
(3,548 Views)

PS.  You don't "build circuits in LabVIEW".  LabVIEW isn't an electrical program.  Do you mean you created a block diagram of your program?

 

 

You say you have some problems.  Tell us what the problems are so we can help you.  No one wants to guess.

 

Have you searched the forums for noise cancellation?  It is the kind of project that has certainly been attempted several times before.  Maybe there are other threads that you can read and give you tips.

 

0 Kudos
Message 2 of 10
(3,543 Views)

Sorry.. Block diagram*
Im new to Labview.

I have looked at noise cancellation projects, they all seem to use simulated noise, where im using the DAQ assist which uses an analog data signal.
I first realised that I have to convert the signal- using the dynamic to array function. So that function recieves the correct data type.
But Im still unsure if using the correct adpative filter signal function- should i be using the AFT Filter Signal and Update Coefficients or the AFT Filter Signal?
Also If im connecting the blocks to the correct inputs.
Thanks

 

0 Kudos
Message 3 of 10
(3,537 Views)

http://www.ni.com/example/31218/en/

 

There's help and examples available.  Read your AFT documentation and search NI for tutorials on that toolkit.  You'll also need to dump the DAQ Assistants and learn to write real DAQmx code since you need sample aligned waveforms for decent results.  Also keep in mind that you will not be able to mimic real noise cancelling headphones very well.  Without super fast ADCs and a real-time OS there will be too much phase difference to work for high frequency signals.  There may be expensive DSP-Based products out there but most NC headphones are analog due to the phase issue.

 

 It's a neat project idea though and you should be able to create a cool example of how the technology works.  I can't help much since I don't know the AFT or NI-Elvis but keep us posted on your progress and we'll help where we can (Short of doing your homework for you of course Smiley Wink).

 

You should do a search here for more info on noise cancelling too, I'm sure I remember similar requests in the past.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 4 of 10
(3,499 Views)

I currently get this error:
Error -50103

Possible reason(s):

NI Platform Services: The specified resource is reserved. The operation could not be completed as specified.

Task Name: _unnamedTask<8>

How could I solve it? I assume it is because im using two DAQ assists. 

0 Kudos
Message 5 of 10
(3,463 Views)

I managed to solve my DAQ problem. Now I have new problem

 

Error -42009 occurred at NI_AdaptiveFilter.lvlib:AFT Filter Signal and Update Coefficients (Real, Array).vi:4620001

Possible reason(s):

Adaptive Filter Toolkit: The length of the input signal x(n) does not equal that of the input signal d(n)

0 Kudos
Message 6 of 10
(3,451 Views)

Can any one help me with the buffer error problem?

 

Error -200279 occurred at NCH2Mics.vi:Instance:1:490001


Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem

Thank you

0 Kudos
Message 7 of 10
(3,374 Views)

Hi J-ANT,

 

simply do what the error description says: read your samples more often…

 

Your data analysis took too long and so the DAQmx task has to overwrite samples in its buffer! A producer-consumer scheme is most often an appropriate programming scheme in such tasks…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 10
(3,369 Views)

I found the soultion! Cheers for your input. 

http://www.ni.com/white-paper/5370/en/

0 Kudos
Message 9 of 10
(3,363 Views)

Im no getting a problem with sampling. I have adjusted the sampling rates and number of sample. I get this silent gap if I want better quality( more samples) any way i can solve this?

0 Kudos
Message 10 of 10
(3,342 Views)