12-28-2015 06:53 AM - edited 12-28-2015 06:55 AM
Hello there,
I am using NI myRIO 1900 for Active Noise Cancellation project.
Initially I am trying to demonstrate the principle with sinusoidal noise source.
My source noise is a sine wave with 40kHz Sampling rate, 1000 samples,2 kHz frequency,1 amplitude.
From myRIO 1900(page 21-22), The Audio IN is Aggregate sample rate is 500kHz i.e if I am using 2 channels (Left and Right), I will get 250 kHz each.
The Audio Out is having sampling rate of 345 kHz again for two channels it will become 172.5 kHz.
Now if I am connecting like this
I should ideally get (2/250 + 2/172.5) msec i.e 19.6 micro sec. But I am getting 8.475 micro sec.
I am getting 16 micro seconds for some processed version also (for fxp llms error.png). This is about what I am concerned !
Still My question is how this optimization is done actually?? And at what rate my Audio IN and Audio Out are actually sampling ??
Additional : When I used just Audio IN left and right and Audio Out left , I got 5.95 micro seconds.
If I use just Audio IN left and Audio Out left , I am getting 3.925 micro seconds.
-- Please check a very useful discussion happened here before on similar topic.
12-28-2015 08:15 AM
I'm left to assume this is in the FPGA. You really should have a wait in your loop to set your acquisition rate.
12-28-2015 11:33 AM
Yes this is in the FPGA. Can you be little elaborate ? I want to know the Audio IN and OUT sampling rates !!!
Thank YOu
01-04-2016 06:39 PM
Anybody has a clue as to how to decide the sampling rate ?
Thank you.
01-05-2016 03:49 AM
To decide the sampling rate - use timing in your loop!
If on the other hand you want to know why the sampling rate is what it is...
I would try to measure the delay of the individual operations - put a sequence structure around your read/write and add in a tick count before and after the read/write. It may also be that the time it takes for the myRIO to write to the DAC and for it to actually update the value are different and/or there might be some optimisation under the hood that allows you to get faster rates.
I would also try a simpler example of just having the read in a loop on it's own and measuring the loop time and doing the same for the write.
In any case - if you have an output sampling rate of 40Khz, then you should time your loop to 40kHz.