Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

WAV power spectrum

I am conducting a sound measurement test using a IEPE microphone and the NI USB 9233. I used the SVXMPL_WAV Recorder (DAQmx).vi to record a Wav file of the sound and then the SVXMPL.WAV Power Spectrum.vi to produce a power spectrum of the wave file. I had a concern that scaling was occurring because the spectrum seemed louder than expected. I read in another thread that no scaling occurs in the vi. Next I used SVMPL_FFT Subset (DAQmx).vi to produce a power spectrum over the same frequency range (20 to 20,000 Hz). In general, the two method agree well except that the peaks in the spectrum are at lower frequencies for the WAV Power spectrum vi than that obtained for the SVMPL_FFT vi. I was wondering if any one could please explain why this is occurring?

 

Regards,

Bill

Message 1 of 9
(9,715 Views)

Hello Schieb,

 

Thanks for your post!

 

I see that you are using the WAV Power Spectrum VI and the SVMPL_FFT vi and seeing some different results in the frequencies. You mention that you are seeing lower frequencies in the WAV Power Spectrum than the SVMPL_FFT VI. I did try these on my computer using a WAV file that produces two frequencies at 1000 Hz and 4000 Hz. Using both these methods I saw the same amplitude and frequencies for the WAV file using both methods. Take a look at the screen shot of my test. Perhaps if you could post your findings and code here we could see what some differences might be. It seems to me that there should not be a difference in frequency. Have a great weekend!

 

Cheers!

 

Corby_B

http://www.ni.com/support

0 Kudos
Message 2 of 9
(9,676 Views)

Thank you for your reply. I have attached two excel files comparing the results I got using SVXMPL_WAV Recorder (DAQmx).vi to record a Wav file of the sound and the SVXMPL.WAV Power Spectrum.vi to produce a power spectrum of the wave file. Then showing the comparison to using the SVMPL_FFT Subset (DAQmx).vi to produce a power spectrum over the same frequency range. I also have attached the vi's as requested. The program I called Narrow Band Acoustics is the SVMPL_FFT Subset (DAQmx).vi modified to include some additional features such as logging to Excel.

 

Regards,

Bill

0 Kudos
Message 3 of 9
(9,666 Views)

I see it only included the last attachment, which is the only vi I modified, I'll try again to send the Excel file showing the comparison of Power spectra.

 

Bill

0 Kudos
Message 4 of 9
(9,663 Views)

Corby,

 

Please see another example of the problem with the frequencies not agreeing for the two methods.

 

Bill

0 Kudos
Message 5 of 9
(9,656 Views)

Hello Bill!

 

Thanks for your posts back and the information. So what I have done is I ran approx 1 KHz signal through a series of different programs to see if I could reproduce anything you were seeing. I also used the program you posted as well. However when I run the  WAV Recorder (DAQmx) vi and then put that wave file into the WAV Power SPectrum I see the signal at about 1KHz like I expect. Then I aslo use your program to see if I can get the same results with the same function generated signal. I always se my signal in the same matter and the frequency components line up accordingly. See the pictures attached below. Thanks for posting your code and it seems like I am unable to reproduce what you are seeing. Did you make any changes to the VI's in your code? If you could perhaps post the wav files that you are producing to see what I can make of them? Take a look at the screen shots that I was able to produce. 

 

Cheers!

 

Corby_B

http://www.ni.com/support 

0 Kudos
Message 6 of 9
(9,632 Views)

Corby,

 

I attached the wav file and the corresponding Wav Power Spectrum Vi with the spectrum saved on the Vi front panel. The wav spectrum is also shown in the Excel file in Figure 1. Figure 2 is the spectrum obtained from the FFT Subset (DAQmx).vi (I've been calling it Narrow Band Acoustics). The peaks from Wav Spectrum are at a lower frequency than the peaks from the FFT Subset.vi.

 

Regards,

Bill

0 Kudos
Message 7 of 9
(9,613 Views)

In older versions of the toolkit, there was a bug in which the requested sample rate (44100 Hz) was saved into the file as opposed to the actual sample rate. For example, if you request a sample rate of 44100 Hz, the 9233 will automatically coerce this rate to 50000 Hz. A frequency shift occurs if the dt = 1/44100 is saved instead of the actual dt = 1/50000. The example did not return a warning if the rate/dt was coerced or different than the saved rate/dt. You can manually verify the dt in the WAV file to see if this is the bug. You may also dig into the svx_Sound Write Waveform (DAQmx) VI; you should be able to tell whether the actual dt of the waveform is being used as opposed to the sample rate input. From the ratio of the frequencies in your attached Excel file, this looks to be the case.

 

This bug is fixed in SVT 5.0 and later. If you have any trouble updating the VI, please let us know. Depending on your version of the toolkit and LabVIEW, it may be easy to post the updated version of the VI. If you are using LabVIEW 8.2 or later, you may also want to upgrade to the latest version of SVT. Sorry for the delay this has caused you.

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
Message 8 of 9
(9,606 Views)

Thank you for providing the solution to the problem.

 

Regards,

Bill

0 Kudos
Message 9 of 9
(9,586 Views)