Implementation of Digital Filters as Part of Custom Synthesizer with NI SPEEDY 33

Publish Date: Dec 19, 2011 | 1 Ratings | 5.00 out of 5 |  PDF

Overview

This document is part of the NI SPEEDY-33 Introduction Series which consists of application examples and information about the NI SPEEDY-33 hardware and its interface with NI LabVIEW Embedded. This document gives a brief background on digital filters and their implementation using the NI SPEEDY-33 in an interesting audio signal processing application (a custom synthesizer). This document will demonstrate the power of LabVIEW Embedded to make DSP filter programming much quicker and easier than traditional C-based programming environments. In addition, this document includes an example application that demonstrates how to build a custom synthesizer using only NI SPEEDY-33 and LabVIEW Embedded.


Table of Contents

  1. Digital Filters in DSP
  2.  Digital State Variable Filter
  3.  NI SPEEDY- 33
  4.  Programming Digital State Variable Filter in LabVIEW DSP for NI SPEEDY-33 
  5.  Example Application for Digital State Filters in custom synthesizer using NI SPEEDY-33 
  6.  Conclusion

1. Digital Filters in DSP

Digital filters process digitized representations of analog signals. A digital filter computes a quantized time-domain representation of the convolution of a sampled input time function and a representation of the weighting function of the filter. They are realized by an extended sequence of multiplications and additions carried out at a uniformly spaced sample interval. Simply said, the digitized input signal is mathematically influenced by the DSP program. These signals are passed through structures that shift the clocked data into summers (adders), delay blocks and multipliers. These structures change the mathematical values in a predetermined way; the resulting data represents the filtered or transformed signal.

It is important to note that distortion and noise can be introduced into digital filters simply by the conversion of analog signals into digital data as well as by the digital filtering process itself and ultimately by conversion of the processed data back into analog. When fixed-point processing is used, additional noise and distortion may be added during the filtering process because the filter consists of large numbers of multiplications and additions, which produce errors by creating truncation noise. Increasing the bit resolution beyond 16-bits will reduce this filter noise. For most applications, as long as the A/D and D/A converters have high enough bit resolution, distortions introduced by the conversions are less of a problem.

 

Back to Top

2.  Digital State Variable Filter


The digital filter used in this application is the digital filter described in Hal Chamberlin's Musical Applications of Microprocessors. It is derived by straight-forward replacement of components from the analog state variable filter with digital counterparts. The digital state variable is a popular synthesizer filter, as was its analog counterpart.

The state variable filter has similar advantages as biquads (second order IIR filters) as a synthesizer filter. Lowpass, highpass, bandpass, and band reject filters are all available simultaneously as part of this digital filter. Also, corner frequencies and Q values are independent and have easily calculated values.


Figure 1: Digital state variable filter


The frequency control coefficient, f, is defined as




where Fs is the sample rate and Fc is the filter's corner frequency you want to set. The q coefficient is defined as




where Q normally ranges from 0.5 to infinity. The filter oscillates at Q = infinity.

Like its analog counterpart, the digital state variable filter has a cutoff slope of 12 dB/octave.

Back to Top

3.  NI SPEEDY- 33


NI SPEEDY-33 is a self-contained, high-performance, programmable DSP board for signal processing applications. The NI SPEEDY-33 comes equipped with a Texas Instruments DSP for high speed DSP calculations and Analog to Digital (A/D) and Digital to Analog (D/A) converters for interaction with the outside world. In addition, this high performance DSP board comes equipped with a USB interface used for connection to the PC, a 16-bit stereo audio codec with two on-board microphones, and Serial Port and CompactFlash interfaces.

 


Figure 2: NI SPEEDY 33


NI SPEEDY-33 can optimally and easily be used by programming it in the graphical and block diagram interface of LabVIEW Embedded. Given that most DSP application focus on speech and audio processing, LabVIEW Embedded offers a wide variety of built-in signal processing and analysis functions. These hardware and software features make building and demonstrating DSP concepts a simple task with LabVIEW Embedded.

Back to Top

4.  Programming Digital State Variable Filter in LabVIEW DSP for NI SPEEDY-33 


Until recently, designing and programming signal processing systems in DSP, such as digital filters, meant writing cumbersome and complicated C or assembly source code applications. With LabVIEW Embedded, those days are history. The intuitive high-level graphical programming approach of LabVIEW Embedded allows for easy transfer of the digital filters’ concept block diagrams to the block diagrams of LabVIEW Embedded Virtual Instruments (VIs).

 


Figure 3: LabVIEW Embedded block diagram of the digital state variable filter


LabVIEW Embedded code from Figure 3 has almost identical data flow and appearance with the concept block diagram of the digital state filter from Figure 1. Even for inexperienced DSP programmers, programming digital filter by using LabVIEW’s graphical building blocks and following the filter’s concept block diagram is fairly straight forward task. Essentially, with LabVIEW Embedded you are wiring your code on the block diagram just as you would create a flowchart or block diagram when designing the implementation of your filter on paper. This inherent power makes LabVIEW Embedded an excellent choice for rapid prototyping as well as the creation of commercial-quality software applications.

Learn more about design and implementation of digital filters in LabVIEW DSP from this tutorial.

Back to Top

5.  Example Application for Digital State Filters in custom synthesizer using NI SPEEDY-33 


The custom synthesizer is DSP application which implements digital state filter to generate audio waves by using NI SPEEDY-33 hardware and the LabVIEW Embedded programming environment. The application is deterministic and runs in real time. It can play up to 4 notes simultaneously, the maximum allowed by NI SPEEDY-33’s RAM. After notes are generated a Digital State Filter is applied using a point-by-point time domain algorithm. The center frequency of the filter (cutoff frequency for low pass) can be changed by the frequency knob and is modulated by the average value of all the envelopes. This is the effect of an Auto-Wah or Envelope Following Filter familiar to guitarists.




Figure 4: Custom Synthesizer in LabVIEW Embedded


Experience all the features of this custom synthesizer hands-on by downloading it (link) to your NI SPEEDY-33.

Back to Top

6.  Conclusion


NI SPEEDY-33 and LabVIEW Embedded provide an powerful, easy to use platform for learning, designing and demonstrating various DSP concepts. The ease-of-use and implementation allows for building DSP digital filters by writing block diagrams in LabVIEW code. Users are no longern required to be fluent in text based programming in order to build DSP applications, and even the most novice users can quickly and efficiently develop complex DSP applications.

Back to Top

Bookmark & Share

Ratings

Rate this document

Answered Your Question?
Yes No

Submit