From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Audio Analysis - Time Domain /FFT /Spectrogram

Code and Documents

Attachment

Overview
This example VI is a basic audio analysis function with a display of raw sound data in the time domain, an FFT of that data, as well as a power spectrogram.


Description
This example is a basic audio analysis function with a display of raw sound data in the time domain, an FFT of that data, as well as a power spectrogram. The VI does not require the Signal Processing toolkit, which has a spectrogram built in natively. And it is designed to use the signal from your Windows computer's microphone input. You will have to configure the code to match the sound device as it is set to use device 0 by default.

The code has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attached folder to your computer
  2. Open the VI " Audio Analysis with Sound Card 2012 NIVerified.vi"
  3. Run the program

 

Additional Information or References
VI Snippet

 Block Diagram.PNG

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Regards,

Shawn S. | NIC
Instrument Driver/IVI PSE
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
MathieuG
Member
Member
on

Hello,

could you please comment on why you chose the values 140, 1.33 and 10 on the Frequency Power Spectrum 2 ?

I am not sure where they come from.

Best regards

Mathieu