To download NI software, including the products shown below, visit ni.com/downloads.
This document demonstrates how you can use the LabVIEW Digital Filter Design Toolkit to implement a DSD decoder on NI FPGA Platforms.
Description-Separate-2Super Audio CD® (SACD) is a high-resolution CD audio format developed by Sony and Philips. SACD uses Direct Stream Digital® (DSD) technology to oversample audio signals and store them as delta-sigma modulated digital audio. The sampling rate of DSD is 2.82 MHz, which is 64 times the CD audio sampling rate of 44.1 kHz. Because of the high sampling rate, DSD signals can represent analog signals more accurately than a regular CD can.
To retrieve audio signals, a DSD decoder must perform low-pass filtering followed by a 1/64 decimation of the DSD stream. You can use the LabVIEW Digital Filter Design Toolkit to implement a DSD decoder on NI FPGA platforms, such as an NI CompactRIO controller. The DSD decoder acquires DSD signals from a digital input (DI) port, decimates the signals, and returns audio signals to a host computer or an analog output (AO) module. The following figure shows this process.
Because DSD decoding deals with different sampling rates, you must design a multirate filter for a DSD decoder. Normally, you could use either the Multirate FIR Design Express VI or the Multistage Multirate Filter Design Express VI to interactively design a multirate filter. However, because the decimation factor for a DSD decoder is 64, which is very large, a single-stage multirate FIR filter requires a large number of taps to meet the requirement of the frequency response. In this situation, the filter might not process data at the input data rate of 2.82 MHz that DSD requires. Refer to the following inequality for the relationship between the input data rate a decimation filter can handle and the number of FIR taps the filter requires.
If you design a DSD decoder as a single-stage multirate filter, the tap count becomes so large that the previous inequality cannot be satisfied. Therefore, you must design a multistage multirate filter for a DSD decoder. In this situation, you can use only the Multistage Multirate Filter Design Express VI to interactively design the filter.
To complete the tasks in the following sections, you must install the LabVIEW FPGA Module and Digital Filter Design Toolkit. To help you perform these tasks, you can download the dsd_decoder.zip file, which is attached to this document. The dsd_decoder.zip file consists of an example LabVIEW project and some example VIs that you can use as a reference.
In LabVIEW, place the Multistage Multirate Filter Design Express VI on the block diagram. The following figure shows a configuration of the Multistage Multirate Filter Design Express VI that you can use as a reference.
You can leave this configuration dialog box open after specifying the required parameters on the Floating-Point Design page.
To implement a filter on FPGA targets, you must convert the filter from floating-point representation to fixed-point representation. Complete the following steps to convert the floating-point filter you created in the previous section to a fixed-point filter.
Click OK to close the configuration dialog box.
Before you generate LabVIEW FPGA code for the filter you created, you might want to validate the numeric accuracy of the filter. You can validate the filter by using the DFD FXP NStage MRate Simulation VI to simulate the filter on a PC. Complete the following steps to validate the numeric accuracy of the filter you created in the previous section.
You can compare the numeric accuracy of the filter you simulate with that of a reference floating-point filter.
If the numeric accuracy of the fixed-point filter you simulated in the previous section meets the requirements of DSD, you can use the DFD FXP NStage MRate Code Generator VI to generate LabVIEW FPGA code for the filter you created in the Converting the Floating-Point Filter to a Fixed-Point Filter section. Complete the following steps to generate LabVIEW FPGA code for this filter.
You can find the maximum acceptable sampling frequency per channel for the FPGA filter by multiplying the value of the sampling frequency/FPGA clock indicator of the DFD FXP NStage MRate Code Generator VI by the FPGA clock rate the filter runs at. You can read the FPGA clock rate the filter runs at by right-clicking the FPGA target in the Project Explorer window and selecting Properties»Top-Level Clock. If the maximum acceptable sampling frequency per channel for the FPGA filter does not reach 2.82 MHz that DSD requires, return to the Designing a Multistage Multirate Filter section to increase the number of filtering stages.
If you follow the previous sections and set the value of the # channels control to 1, the generated filter can process signals at an input data rate of 5 MHz, which meets the requirements of DSD on FPGA targets.
Therefore, you can implement this filter on an FPGA target.
Drag and drop the filter block of the LabVIEW project you generated in the previous section on the FPGA block of a LabVIEW project that you want to implement the filter on. The following figure shows where to drop the filter block.
Notice that the filter block in the LabVIEW project contains two FIFOs. The input FIFO is DSD_DataIn, and the output FIFO is DSD_DataOut. Notice that the filter block also contains three filtering VIs that represent each of the three stages you designed in the Designing a Multistage Multirate Filter section.
Right-click the FPGA target in the LabVIEW project and select New»VI to create a DSD decoder VI. Drag and drop the two FIFOs and three filtering VIs on the block diagram of the DSD decoder VI. You must specify other parameters as your project requires. The following figure shows the block diagram of a DSD decoder VI that you can use as a reference.
In the previous figure, the input FIFO, which receives DSD signals from a DIO node, is in the Timed Loop on the top. The filtering VIs, which filter and decimate DSD signals, is in the middle. The output FIFO, which sends audio signals to a DMA upload FIFO, is in the Timed Loop at the bottom. You now can run this DSD decoder VI on the FPGA target.
This document demonstrates how you can use the Digital Filter Design Toolkit to implement a DSD decoder on NI FPGA Platforms. The seamless connection between LabVIEW, the Digital Filter Design Toolkit, and NI FPGA Platforms makes them an integrated development platform, which saves time and cost when you design and verify a filter.
How-Separate-2Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.