LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Spectrum Unit Conversion Help

I'm trying to create a spectrum analyzer program by utilizing a DAQ and LabView. I've attached a very limited scaled down program just for clarification. I have sampled 1 second of data at 100k sample rate and stored that in the constant waveform. If I take and do a simple FFT on this data, it is very similar to what my HP3562A shows. But now I want to do a noise measurement on this data. I can set up the analyzer to display in Vrms/root Hz and I get what is shown in the bottom picture. In order to make this measurement in LabView, I figured that the best way was to use the Spectrum Unit Conversion VI. The problem is that there is no example or any real type of help on how to use this VI. I set up what I thought would the the correct way to use it, but it obviously doesn't work. What am I missing (not doing an FFT on the signal, do I do this before the conversion or after, etc. - I've tried these but still don't get the response I desire.)? I am not sure what the VI expects or how to use it in order to mimic the performance of the 3562. Thanks for any help you can give me. Or does anyone know if NI sells a canned spectrum analyzer program that utilize DAQMx cards that is fully functional. I thought they did at one time, but I looked and can no longer find it - which is why I decided to try and build my own.

0 Kudos
Message 1 of 5
(4,226 Views)

1. df = fs/N not 1/(fs*N) as in your VI. Also, because you do the multplication of fs times N as integers, you introduce an error because the product (1E10) is greater than the maximum value which can be represented by a signed 32-bit integer (~2E9).

 

2. The output of Scaled Time Domain Window.vi is not a spectrum. So, wiring that output to the Spectrum Unit Conversion.vi does not get a spectrum to display. The Unit Conversion VI scales a spectrum for logarithmic or linear and cnages teh units but does not calculate the spectrum.

 

3. The window properties output from Scaled Time Domani Window.vi is used by Unit Conversion when working with power spectral densities. But the Spectrum input must come from Spectral Measurements or one of the FFT VIs.

 

4. The Spectral Measurements VI and the similar FFT Power Spectrum and PSD.vi provide the same scaling. The detailed help for FFT Power Spectrum and PSD.vi specifies the units for the various options. The results are the same as Unit Conversion.

 

I took the photos of the HP3562A out of the modified VI to reduce the file size.

 

Lynn

0 Kudos
Message 2 of 5
(4,210 Views)

1. Thanks. This is the problem with the canned help in LV. I did a search on ni.com to find out what df is and the first result I found that described it said 1/fs*N.

2. Ok, so the output isn't a spectrum. I was only really using it to get eq noise BW. Because once again "is the equivalent noise bandwidth (ENBW) of the window that was used. The default is 1.0. You can use this value to divide a sum of individual power spectra of the power spectrum or to compute the power in a given frequency span." means nothing to me. Since it is an input, the help should tell me how to calculate this value. But maybe I'm asking too much from a canned help menu.

3. OK, I see you made that change.

4. Yes I see that there are various outputs available. However none of them produce the output shown in the second photo (which is why I attached them). The amplitude of the signal at 1kHz in Vrms/rtHz should be approx -36.7 dB and the noise floor at ~15kHz should be around -125 dB. This is how I know I can trust the calculations done in LV. I don't see that and therefore I cannot trust this code.

 

I ran your modification and on the lower half of the code, all I get is an array of NaN. (?) See below...

NaN.png

 

Side note: I so wish there was a course that would teach us how to use these type of natives. I can see that LV is a powerful program but without knowing how to use it, it is frustrating to write code that does what I want it to do. I am thankful for people like you to help me try to understand what is going on in this forum.

Jim

0 Kudos
Message 3 of 5
(4,169 Views)

I was away all day today and am too tired now to think through carefully the response needed for your comments on 2 and 4.  I will try to post something tomorrow.

 

Lynn

Message 4 of 5
(4,147 Views)

No problem. I'm not in a big rush for this. This is just a project I've been working on in my spare time.

 

I don't have the Developer Suite Core Package version of LV. Do you know if this something that is a canned function in the sound and vibration toolkit? I'm obviously not apposed to learning how these functions work (it is probably better in the long run), but from our company's standpoint if there is something off-the-shelf that can be bought that gets the job done quicker it makes more sense just to buy it.

0 Kudos
Message 5 of 5
(4,128 Views)