LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Experimenting active noise cancellation

Hi,
I am currently experimenting active noise cancellation using labview RT 8.0. Is it possible to use pentimum 4 PC desktop as RT target together with NI-PCI-4472(acquire signals) and multi-channel sound card(output signal) to perform the experiment?
0 Kudos
Message 1 of 25
(8,214 Views)
Hi Qz,

That is a cool application!

Although you can install RT on Desktop PC, a PCI Sound Card will not be supported, so Windows may be a better choice even though you will lose determinism.

Depending on your approach to cancellation, another consideration will be the maximum loop rate you can acheive in software.  For a point-by-point cancellation, the delay between input and ouput will need to be as small as possible to be effective.  On my PC (3.2GHz P4), the DAQmx Read function takes about 100microseconds, so the maximum single-point loop rate I can acheive is around 10kHz.  This rate will be decreased further by the time it takes to write to your soundcard.  Based on this benchmark, a safe guess for a range of frequencies you could cancel with a point-by-point method would be <1kHz, in order to ensure a low phase offset between input and output.  Although very limited, this solution would be quick to setup and easy to test.

If you are working on an algorithm that doesn't require point-by-point control, then you can acquire many points every time the DAQmx Read function is called, and you can sample continuously at very high rates.

If you need to implement a point-by-point algorithm and cancel the full range of audio frequencies up to 20kHz, then you may need to go with an FPGA based solution.  Let me know if this is required, and we can continue the conversation in that direction.

Have a great day!
Travis W




Message Edited by Travis W on 10-06-2006 11:50 AM

0 Kudos
Message 2 of 25
(8,180 Views)
Hi Travis,
I am new in this field. I am actually planning to do a cancellation of noise of 500 to 1000Hz using adaptive filter.
May i know what hardware or DAQ card you are using to perform the cancellation?
 
Currently i am performing noise cancellation without real-time environment. When i set my DAQ timing to continuous sampling clock of 4kHz and reading at 32 samples with DAQ read function, i encounter a buffer overwrite error. Will using RT environment help to solve this problem?
 
By the way, do you have any VI regarding noise cancellation that i can refer to ? Your help will be greatly appreciated.
 
Have a nice day,
Qz
0 Kudos
Message 3 of 25
(8,117 Views)
Hi Qz,

Right now, I'm not working with active cancellation.  Instead, I'm continously reading values on my PCI-4461 DSA card into LabVIEW and playing them back out through my PCs sound card with some basic processing and manipulation inbetween.

Are you programming your NI 4472 with Traditional NI-DAQ or NI DAQmx?  Are you reading 1 sample at a time or N samples?

In either case, there should be no problem with countinous acquisition at 4kHz.  Can you attach the code that is causing the problem so I can take a look?  In general, using RT will add determinism but not speed to your application.  Unless the cause of the error you're seeing is another application in Windows taking too much CPU usage, RT should not be a factor.

Thanks again for working with me.  I'm not an expert at active cancellation, but I can definitely help out with your DAQ problems and offer some suggestions as you move forward.

Have a great day!
Travis W

Message Edited by Travis W on 10-16-2006 05:39 PM

Message 4 of 25
(8,079 Views)

Hi Travis,

Currently i am trying read 60 samples to do computation. However, i face a buffer overwrite error at the DAQmx read function. Have i attached my VIs. I would prefer a continous point to point aquisition. How can i do that? Can you give me some guidance? Thank you.

Best Regards,
Qz

Download All
0 Kudos
Message 5 of 25
(8,056 Views)

Hi Travis,

Sorry, I have attached the wrong files just now.

These are the correct files.

Regards,
Qz

Download All
0 Kudos
Message 6 of 25
(8,053 Views)
Hi Qz,

This is interesting...
I do not receive the same buffer overflow error when I run that same code on my machine (DELL P4, 3GHz, 1GB RAM).  What kind of computer are you running this program on?

It is possible that the processing on your machine is taking longer, resulting in this buffer overflow.  Do you still see the error if you remove the LMS-v3.vi from your code and run only the acquisition loop without any extra processing?  If you STILL see the error, open up Windows Task Manager and make sure that you are not low on RAM, and having to write to virtual memory, as this will slow things down significantly.

To do a single point acquisition loop, you would just need to decrease the number of samples requested by the DAQmx Read.vi.  I actually tested your code with 1 sample to read specified, and my computer was able to keep up without any problems.

Have a great day!
Travis W

Message Edited by Travis W on 10-17-2006 04:58 PM

0 Kudos
Message 7 of 25
(8,032 Views)

Hi Travis,

I am using NEC P4, 3GHz, 512MB RAM(400MHz).

I still see the error when i remove the LMS-v3.vi from your code and run only the acquisition loop without any extra processing.

When you did the single point acquisition loop, did you remove the LMS-v3.vi from the code?

By the way, when i run the code without using the "highlight execution" function, it does not show the error.  It just ignores the error and continues running. However, when i debug using "highlight execution" function, the error occurs. Did you encounter the error when running using the "highlight execution" function?

Sorry to trouble with so much questions. Hope you can help me out. Thank you.

Have a nice day,
Paul

0 Kudos
Message 8 of 25
(8,017 Views)
Hi Qz,

That makes sense.  Using highlight execution will slow things down significantly, and your input buffer will overflow, resulting in the error you are seeing.  You shuold test without using highlight execution, and there should be no error.  Again, the reason the error was occuring was because LabVIEW wasn't reading values out of the buffer fast enough to keep it from overflowing.  Without highlight execution, LabVIEW should be able to keep up without any problems.

A great way to monitor the status of your acquisition (without using highlight execution) is to unbundle the error cluster inside your while loop and stop the while loop if the stop button is hit OR there is an error.



When I tested with 1 point at time, I left the subVI in my code, and everything ran without an error.  Let me know if you see the same behavior.  Best of luck.

Have a great day!
Travis W

Message Edited by Travis W on 10-18-2006 04:46 PM

0 Kudos
Message 9 of 25
(8,000 Views)

Hi Travis,

Yup. You are right. The highlight execution really slows down the process. When i run the code with 1 point at time and without highlight execution, no error exists.

Thank you so much for helping me. You are really a great help to me..

Have a nice day,
Qz

0 Kudos
Message 10 of 25
(7,970 Views)