This myRIO application is a simple, 3-band audio equalizer. It allows you to control the amplitude of bass, midtone and treble components from any audio track.
PRIMARY GOAL: Models of Computation
The primary aim of this demo is to showcase LabVIEW’s support for multiple programming interfaces. This simple graphic equaliser performs audio filtering using either...
G (native graphical programming in LabVIEW)
MathScript (textual mathematics using the MathScript node)
...this application allows you to quickly switch between filters implemented using these two different models of computation. The processed waveform is the same, regardless of which approach you select.
Although we have implemented the same processing algorithms using two different programming interfaces, by using LabVIEW the ability to interact with the real world (and deploy to embedded processors) is clean and simple.
SECONDARY GOAL: FPGA for Audio Streaming
The default FPGA personality used with myRIO supports point-by-point data acquisition. While this is perfect for many applications, certain projects (such as audio processing applications) require waveform acquisition. This project uses a custom FPGA VI (and several DMA channels) to handle the streaming of left/right audio waveforms to/from the myRIO’s real-time processor.
I have also created some easy-to-use functions (subVIs) for controlling and interacting with this custom FPGA – meaning that you should be able to reuse this code for your own audio processing projects!
The Custom FPGA VI
LabVIEW Real Time
myRIO (software and hardware)
Download attached zip file and extract contents
Open RT Audio Filter.lvproj
Right-click the myRIO target within the project, and select Properties. Ensure that the IP address matches your myRIO.
Open RT Audio Filter.vi from the project
Ensure that you have an audio source (laptop, microphone, mp3 player, smart phone) connected to the myRIO’s audio input. Also ensure that you have connected a loud speaker or headphones to the myRIO’s audio output
Click run (the code should now depluy to your myRIO)
NOTE: At this point, you may need to recompile the FPGA code the first time you run this application.
Adjust the Bass/Midtone/Treble sliders and notice the music and spectral graph updates accordingly (note: the red plot is the raw audio spectrum... the blue plot is the filtered/processed audio spectrum)
Switch to the block diagram. Notice that the filtering is implemented using LabVIEW’s out-of-the-box filter functions AND a MathScript node.
Click the Mode Select button to change the implementation of the filtering.
Notice that the myRIO LEDs turn on when MathScript is selected, yet the music sounds exactly the same as the native LabVIEW filtering.
Audio Equilizer Front Panel
Rich Roberts Senior Marketing Engineer, National Instruments Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/