Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling Rate and SINAD

I am seeing some odd behavior related to the SINAD and the sampling rate.

I created a very small application to measure the SINAD.  Right now, I simply have a BNC connecting AO to AI1 (loopback test).  This was supposed to be my baseline test but the results caused me to stop before I even got to my real test.

I am generating a 500Hz sine wave and outputting that on AO0.  I am sampling AI1 and running an FFT and measuring the SINAD.  (The digital otuputs are unnecessary for the loopback test, I am only leaving them in for my subsequent tests that will require the control of a multiplexer).

Running the attached VI, if I set my FFT size to 8192 and my sampling rate to 50KHz or 100KHz then I am able to achieve a SINAD of 70+dB with nearly any output frequency (obviously below Nyquist) and voltage.  However, as soon as I deviate from one of these two frequency values (even 1Hz), the SINAD drops to 30-40dB.

I would like to sample as fast as possibly given my hardware (NI-6281 with a BNC-2110) at 250ksps.

I've had all kinds of hypothesis, but none have seemed to work out.  I initally thought that it had something to do with integer multiples of my DAC output frequency, but if I sample at 150k, 200k, or 250k I am still only able to achieve 30-40dB.

I also thought that maybe the SINAD control need a window, so I added a windowing VI in front of it but that seemed to only make things REALLY bad (SINAD of 2.4 tells me that the SINAD VI doesn't want the data to be windowed).

I'm wondering if anyone else can offser some advice.

Thanks in advance,
Drew

0 Kudos
Message 1 of 7
(4,156 Views)

Hi Drew,

Thank you for posting on the National Instruments forums.

What you are seeing is a combination of a few factors.  First, what the SINAD does is take the frequency it is looking at and the takes the next highest frequency it sees and uses that to compare to.  So when you sample at 150k, you have that signal at 50k which the SINAD is using to compare to.  That is why you are seeing 30-40dB.  The reason the window is so bad is shown if you zoom in on the power spectrum, you’ll see that there is a peak at the frequency, but there are other signals that are pretty close a frequency or two above and below the frequency of the sine wave.  That causes the SINAD of about 2dB that you are seeing when using a window. Another factor is when you sample at frequencies that are not multiples of the signal, then you are aliasing the signal which creates harmonics which the SINAD again is reading and comparing the signal frequency to. 

Filtering might help out with your issue.  It might be possible to use a lowpass filter to filter out the high frequency harmonics. You will also want to make sure and use a sampling rate that is a multiple of the signal.

As a last resort, you could get one of our DSA cards which have built in delta-sigma filtering that will make your signal cleaner and give you a more accurate SINAD.

Thank You,

Nick F.
Applications Engineer
0 Kudos
Message 2 of 7
(4,138 Views)
Nick,

Thank you for your reply.  I figured that it was a sampling issue, but I am not sure that I understand everything here. 

First off, where is this 50KHz signal coming from?  I am outputting a 500Hz sine wave at 100ksps.  The signal generator is set to output an integer number of cycles, so I would expect that there to not be a huge harmonic distortion at 50KHz from this.

I am confused by your explanation of SINAD.  Just to make sure that we are on the same page, SINAD is the same thing as SNDR  = Fundamental Power / (Noise Power + Distortion Power).  From your explanation it sounds like you are explaining SFDR which is the Power of the Fundamental - second highest tone.

I agree with you on the windowing reasoning.  The window smears the tone and then the SINAD measures this distortion.

As for filtering, I added a single pole RC filter at 2KHz to the system with minimal results (2dB improvement).

I think that I am missing a subtlety here regarding the two sampling rates coming into play.  What would be the optimal setup for the DAC and the ADC?

I am trying to maximize the SINAD under the following constraints:
Analog Output: 500Hz Sine Wave (Sampling Rate unconstrained)
Analog Input: 250KHz/32 (Maximum that I can sample at divided by the number of sensors that I need to sample)

- Drew


0 Kudos
Message 3 of 7
(4,135 Views)
Hi, Drew. Allow me to throw in my $0.02 here.

First of all, if you're indeed using the 6281 board, you should be able to scan at 2usec/channel, and you only have 16 channels, not 32.

It looks to me like the SINAD vi windows the data already, so you shouldn't have to add your own. Not sure why it hurt, though.

The 50kHz that Nick was referring to comes from the DAC update rate (100kHz) aliased to 50k since your AI sample rate was 150k. An ideal DAC won't produce any energy exactly at its sample rate, but real ones do a little, and even ideal ones produce energy at the sample rate +/- the signal frequency. So you should have energy at 99.5k and 100.5k, which would alias to 50.5k and 49.5k respectively.

As Nick suggested, the best solution to this would be filtering, and our DSA boards have built in filtering. Those boards are much more expensive per channel than M-series, though. I was able to get decent results setting my AO update rate equal to my AI sample rate. For example if my sample interval were 32x2usec = 64usec (15.625 kS/s), I'd set my AO update rate to the same. In fact, you could probably configure the board to use the exact same clock, so that the phase relationship between the two clocks would be fixed. Try to arrange things so that you sample just before you update, so as to ignore update glitches to the greatest possible degree.

Another approach that kinda works is to maximize the AO update rate. The magnitude of the images at f(update) ± f(signal) is roughly proportional to f(signal)/f(update).

I'd be interested in knowing more about your application. What exactly are you trying to accomplish?

Chris
0 Kudos
Message 4 of 7
(4,109 Views)

Chris,

Thanks for your inpuit.  I understand where the 50KHz is coming from now.  I did change the DAC update rate last night to 1Msps as well as tried to lock it in at my analog sampling rate.  I however did not clock them the same since I have a very complicated clocking scheme (not shown in the VI that I sent you).  Essentially I use two counters to generate a digital output clock (for a MUX) and the second clock for an analog input.  The MUX clock is 8x faster to allow for setting, setup, and selecting the two channels.

I actually do have 32 channels, I use 2 MUX's and 2 AI.  Each channel has 16 sensors attached to it.

Filtering is very difficult to do in my application.  It is a TDM signal so the AAF must settle to 16-18bits within 2us, ideally a little less.  This means that the filter cannot be very agressive.  I have attempted to add a filter on every sensor (just an RC low pass) since I am only interested in a 1KHz BW of the sensor.  This still wasn't a huge benefit unfortunately.

I don't want to get too in-depth into the application, but essentially what we have is a resistive sensor that acts like a mixer with an external excitation.  I excite this sensor with a 500Hz sine wave and then I am interested in measuring a 700Hz tone (the external field is 200Hz so it mixes into a 700Hz tone).

The signal path consists of a non-inverting amplifier (the sensor is in the feedback path), a differential MUX (one half for sensors and the other half for reference sensors), then an instrumentation amplifer that does the differencing and converts the signal to a differential signal for the ADC.

I woild be more than happy to share my complete VI with you if you would like.

- Drew

 

0 Kudos
Message 5 of 7
(4,105 Views)
It seems that if you're just interested in what happens at 700Hz, then some narrowband detection scheme should be able to extract the information you need without being bothered by images and aliases and so on. Unfortunately, I'm experiencing technical difficulties at the moment, so I can't experiment, but there must be a reasonable combination of update rate and sample rate that keeps all undesirable tones away from your region of interest (700 Hz). Let us know if you're unsuccessful in finding one, or if the situation is more complicated than that.

Chris
0 Kudos
Message 6 of 7
(4,098 Views)
Hi Drew,

I observed the same odd behavior in the SINAD loopback test: Highest SINAD at 500Hz, lowest SINAD at 505Hz, and same high SINAD again at 510Hz.

After changing a few options, I found that the problem is in the "simulate signal" VI, the one that actually creates the tone.

When you check the properties of this VI, there is an option "Use integer number of cycles". Apparently, the VI generates a sample of a particular length, and this sample length must be tailored to accommodate an integer number of tone cycles, otherwise consecutive samples are out of phase and create very ugly harmonics.

This fixed it for me.
0 Kudos
Message 7 of 7
(3,785 Views)