• No results found

Basic DSP Theory

5.4 First-Order Feed-Forward Filter Revisited

Being able to express delay as the mathematical operation of multiplication by e 2jvn means you can take the block diagram and difference equation for a DSP fi lter and apply a sinusoid to the input in the form of e jvt rather than having to plug in sequences of samples as you did in Chapter 4 . Then, you can see what comes out of the fi lter as a mathematical expression and evaluate it for different values of v (where v 5 2p f with f in Hz) to fi nd the frequency and phase responses directly rather than having to wait and see what comes out then try to guesstimate the amplitude and phase offsets. Consider the fi rst-order feed-forward fi lter from the last chapter but with e jvt applied as the input signal, shown in a block diagram in Figure 5.5 .

The difference equation is as follows:

y(t) 5 a0ejvt1 a13ejvte2 jv14 (5.12) Figure 5.5 shows the familiar block diagram but this time with the input x ( t ) and output y ( t ) instead of x ( n ) and y ( n ). Notice the delay element has been replaced by e 2jv1 since there is a one-sample delay. When you apply the complex sinusoid e jvt to the input, the difference equation uses the delay-as-multiplication operation to produce the output. With a little math you can arrive at Equation 5.13 .

y(t) 5 a0ejvt1 a13ejvte2 jv14 5 ejvt1a01 a1e2 jv12 and the input x(t) 5 ejvt so

y(t) 5 x(t) 1a01 a1e2 jv12

The transfer function is defined as the ratio of output to input, therefore y(t)

x(t) 5 a01 a1e2 jv1

(5.13)

Figure 5.5: Block diagram of a fi rst-order feed-forward fi lter with signal analysis.

What is so signifi cant about this is that the transfer function is not dependent on time even though the input and output signals are functions of time. The transfer function ( Equation 5.14 ) is only dependent on frequency v, so we call it H(v).

H(v) 5 a01 a1e2 jv1 (5.14)

Notice that the transfer function is complex.

But what values of v are to be used in the evaluation? We know that v 5 2p f , but do we really care about the frequency in Hz? In Chapter 4 when you analyzed the same fi lter, you applied DC, Nyquist, ½ Nyquist, and ¼ Nyquist without thinking about the actual sampling frequency. This is called normalized frequency and is usually the way you want to proceed in analyzing DSP fi lters. The actual sampling rate determines Nyquist but the overall frequency range (0 Hz to Nyquist) is what we care about. To normalize the frequency, you let f 5 1 Hz in v 5 2p f , then v varies from 0 to 2p or across a 2p range. There is also one detail we have to be aware of: negative frequencies.

5.4.1 Negative Frequencies

You may have never thought a frequency could be negative, but it can. When you fi rst learned about the concept of a waveform’s frequency, you were taught that the frequency is 1/T, where T is the period, as shown in Figure 5.6 .

The reason the frequencies came out as positive numbers is because the period is defi ned as t 2 2 t 1 , which makes it a positive number. But, there’s no reason you couldn’t defi ne the period to be the other way around: T 5 t 1 2 t 2 , except that it implies that time is running backwards. Mathematically, time can run backwards. This means that for every positive frequency that exists, there is also a negative “twin” frequency. When you look at a frequency response plot you generally only look at the positive side. Figure 5.7 shows a low-pass response up to the highest frequency in the system, Nyquist.

However, in reality, the fi lter also operates on the negative frequencies just the same in a mirror image. In this case, as the negative frequencies get higher and higher, they are attenuated just like their positive counterparts ( Figure 5.8 ). And it makes sense too. If

The transfer function of the filter is the ratio of output to input. The frequency response of the filter is the magnitude of the transfer function evaluated at different frequencies across its spectrum.

The phase response of the filter is the argument (or angle) of the transfer function evaluated at different frequencies across its spectrum.

To produce the frequency and phase response graphs, you evaluate the function for various val-ues of v then find the magnitude and argument at each frequency. The evaluation uses Euler’s equation to replace the e term and produce the real and imaginary components.

π/2 -π/ 2 0

-Nyquist H +Nyquist

+ Nyquist +f H

- f -Nyquist

t 2 t 1

T = t2 - t1

t

A H

Nyquist f

you take an audio fi le and reverse it in time, then run it through a low-pass fi lter, the same frequency fi ltering still occurs.

For fi lter evaluation, v varies on a 0 to 2p radians/second range and one way to think about this 2p range is to split it up into the range from 2p to 1p corresponding to 2Nyquist to 1Nyquist ( Figure 5.9 ).

Figure 5.6: The classic way of defi ning the period, T .

Figure 5.7: The classic way of showing a frequency response plot only shows the positive

portion.

Figure 5.8: The more complete frequency response plot contains both positive and negative sides.

Figure 5.9: One way to divide the 2p range of frequencies includes both positive and negative frequencies.

fs 3π/2

1/π 2 fs π/2

0 H

5.4.2 Frequencies Above and Below 6Nyquist

The sampling theorem sets up the Nyquist criteria with regards to completely recovering the original, band-limited signal without aliasing. However, frequencies above Nyquist and all the way up to the sampling frequency are also allowed mathematically. And in theory, any frequency could enter the system and you could sample it without limiting Nyquist. For a frequency or phase response plot, the frequencies from Nyquist up to the sampling frequency are a mirror image about Nyquist. This is another way to divide up the 2p range by going from 0 Hz to the sampling frequency (Figure 5.10).

Notice that in either method the same information is conveyed as we get both halves of the curves, and in both cases, Nyquist maps to p and 0 Hz to 0 and positive frequencies map to the range 0 to p.