## Basic DSP Test Signals

Will Pirkle

You need to know the data sequences for several fundamental digital signals in order to begin understanding how the DSP theory works. The basic signal set consists of • Direct Current (DC) and step: DC is a 0Hz signal • Nyquist • ½ Nyquist • ¼ Nyquist • Impulse The first four of these signals are all you need to get a ballpark idea of the frequency response of some basic DSP filters. The good news is that all the sequences are simple to remember.

**DC and Step**

The DC or 0 Hz and step responses can both be found with the DC/step input sequence: {…0, 0, 1, 1, 1, 1, 1, 1, 1, 1…}. This signal in Figure 1.11 contains two parts: the step portion where the input changes from 0 to 1 and the DC portion where the signal remains at the constant level of 1.0 forever. When

you apply this signal to your DSP filter and examine the output, you will get two pieces of information. The step portion will tell you the transient attack time and the DC portion will give you the response at DC or 0 Hz.

**Nyquist**

The Nyquist input sequence represents the Nyquist frequency of the system and is independent of the actual sample rate. The Nyquist sequence is {…21, 11, 21, 11, 21, 11, 21, 11…}.

The Nyquist frequency signal in Figure 1.12 is the highest frequency that can be encoded. It contains the minimum of two samples per cycle with each sample representing the maximum and minimum values. The two-sample minimum is another way of stating the Nyquist frequency as it relates to the sampling theorem.

** ½ Nyquist**

The ½ Nyquist input sequence in Figure 1.13 represents the ½ Nyquist frequency of the system and is independent of the actual sample rate. The signal is encoded with four samples

per cycle, twice as many as Nyquist. The ½ Nyquist sequence is {…21, 0, 11, 0, 21, 0, 11, 0, 21, 0, 11, 0, 21, 0, 11, 0…}.

** ¼ Nyquist**

The ¼ Nyquist input sequence in Figure 1.14 represents the ¼ Nyquist frequency of the system and is independent of the actual sample rate. It is encoded with eight samples per cycle. The ¼ Nyquist sequence is {…0.0, 0.707, 11.0, 0.707, 0.0, 20.707, 21.0, 20.707, 0.0…}.

** Impulse**

The impulse shown in Figure 1.15 is a single sample with the value 1.0 in an infinitely long stream of zeros. The impulse response of a DSP algorithm is the output of the algorithm after applying the impulse input. The impulse sequence is {…0, 0, 0, 0, 1, 0, 0, 0, 0,…}.

**Signal Processing Algorithms**

In the broadest sense, an algorithm is a set of instructions that completes a predefined task. The signal processing loop in Figure 1.8 is a picture of an algorithm for processing audio and control (UI) data in real time. In the specialized case of audio signal processing, an algorithm is a set of instructions that operates on data to produce an audio output bit-stream. Most of the exercises in this book involve processing incoming audio data and transforming it into a processed output. However, synthesizing a waveform to output also qualifies and in this special case, there is no real-time audio input to process. Most of the plug-ins in this book use the effects model, where an input sequence of samples is processed to create an output sequence, as shown in Figure 1.16 .

Conventions and rules: • x ( n ) is always the input sequence; the variable n represents the location of then the sample of the x -sequence. • y ( n ) is always the output sequence; the variable n represents the location of then the sample of the y -sequence. • h ( n ) is the impulse response of the algorithm; a special sequence that represents the algorithm output for a single sample input or impulse. • For real-time processing, the algorithm must accept a new input sample (or set of samples), do the processing, then have the output sample(s) available before the next input arrives; if the processing takes too long, clicks, pops, glitches, and noise will be the real-time result.

Excerpt from *Designing Audio Effect Plug-Ins in C++*by Will Pirkle.

**Author Bio**

Will Pirkle is an Assistant Professor of Music Engineering Technology at the University of Miami Frost School of Music, where he teaches C++ audio programming, signal processing, audio synthesis, recording studio workshops, and mobile app programming. In addition to his nine years of teaching, Mr. Pirkle has twenty years of experience in the audio industry, during which he worked and consulted for companies including Korg Research and Development, SiriusXM Radio, Diamond Multimedia, Gibson Musical Instruments, and National Semiconductor Corporation. An avid guitarist and studio owner, Mr. Pirkle continues to seek projects that combine all his skills.

## No Comments

## Tell us what you think!