Skip to content Skip to navigation

Connexions

You are here: Home » Content » Linear-Phase FIR Filters: Amplitude Formulas

Navigation

Content Actions

  • Download module PDF
  • Add to ...
    Add the module to:
    • My Favorites
    • A lens
    • An external social bookmarking service
    • My Favorites (What is 'My Favorites'?)
      'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.
    • A lens (What is a lens?)

      Definition of a lens

      Lenses

      A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

      What is in a lens?

      Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

      Who can create a lens?

      Any individual Connexions member, a community, or a respected organization.

    • External bookmarks
  • E-mail the author

Recently Viewed

Linear-Phase FIR Filters: Amplitude Formulas

Module by: Ivan Selesnick

Summary: (Blank Abstract)

SUMMARY: AMPLITUDE FORMULAS

Type θω θ ω Aω A ω
I -Mω M ω hM+2n=0M-1hncosM-nω h M 2 n 0 M 1 h n M n ω
II -Mω M ω 2n=0N2-1hncosM-nω 2 n 0 N 2 1 h n M n ω
III -Mω+π2 M ω 2 2n=0M-1hnsinM-nω 2 n 0 M 1 h n M n ω
IV -Mω+π2 M ω 2 2n=0N2-1hnsinM-nω 2 n 0 N 2 1 h n M n ω

where M=N-12 M N 1 2

AMPLITUDE RESPONSE CHARACTERISTICS

To analyze or design linear-phase FIR filters, we need to know the characteristics of the amplitude response Aω A ω .

Type Properties
I Aω A ω is even about ω=0 ω 0 Aω=A-ω A ω A ω
Aω A ω is even about ω=π ω Aπ+ω=Aπ-ω A ω A ω
Aω A ω is periodic with 2π 2 Aω+2π=Aω A ω 2 A ω
II Aω A ω is even about ω=0 ω 0 Aω=A-ω A ω A ω
Aω A ω is odd about ω=π ω Aπ+ω=-Aπ-ω A ω A ω
Aω A ω is periodic with 4π 4 Aω+4π=Aω A ω 4 A ω
III Aω A ω is odd about ω=0 ω 0 Aω=-A-ω A ω A ω
Aω A ω is odd about ω=π ω Aπ+ω=-Aπ-ω A ω A ω
Aω A ω is periodic with 2π 2 Aω+2π=Aω A ω 2 A ω
IV Aω A ω is odd about ω=0 ω 0 Aω=-A-ω A ω A ω
Aω A ω is even about ω=π ω Aπ+ω=Aπ-ω A ω A ω
Aω A ω is periodic with 4π 4 Aω+4π=Aω A ω 4 A ω
Figure 1
Figure 1 (fourAmps.png)

EVALUATING THE AMPLITUDE RESPONSE

The frequency response H f ω H f ω of an FIR filter can be evaluated at LL equally spaced frequencies between 0 and π using the DFT. Consider a causal FIR filter with an impulse response hn h n of length-NN, with NL N L . Samples of the frequency response of the filter can be written as H2πLk=n=0N-1hn-2πLnk H 2 L k n 0 N 1 h n 2 L n k Define the LL-point signal {gn|0nL-1} g n 0 n L 1 as gn=hnif0nN-10ifNnL-1 g n h n 0 n N 1 0 N n L 1 Then H2πLk=Gk= DFT L gn H 2 L k G k DFT L g n where Gk G k is the LL-point DFT of gn g n .

Types I and II

Suppose the FIR filter hn h n is either a Type I or a Type II FIR filter. Then we have from above H f ω=Aω-Mω H f ω A ω M ω or Aω= H f ωMω A ω H f ω M ω Samples of the real-valued amplitude Aω A ω can be obtained from samples of the function H f ω H f ω as: A2πLk=H2πLkM2πLk=Gk W L M k A 2 L k H 2 L k M 2 L k G k W L M k Therefore, the samples of the real-valued amplitude function can be obtained by zero-padding hn h n , taking the DFT, and multiplying by the complex exponential. This can be written as:

A2πLk= DFT L hn0 L - N W L M k A 2 L k DFT L h n 0 L - N W L M k (1)

Types III and IV

For Type III and Type IV FIR filters, we have H f ω=-MωAω H f ω M ω A ω or Aω=- H f ωMω A ω H f ω M ω Therefore, samples of the real-valued amplitude Aω A ω can be obtained from samples of the function H f ω H f ω as: A2πLk=-H2πLkM2πLk=-Gk W L M k A 2 L k H 2 L k M 2 L k G k W L M k Therefore, the samples of the real-valued amplitude function can be obtained by zero-padding hn h n , taking the DFT, and multiplying by the complex exponential.

A2πLk=- DFT L hn0 L - N W L M k A 2 L k DFT L h n 0 L - N W L M k (2)

Example 1: EVALUATING THE AMP RESP (TYPE I)

In this example, the filter is a Type I FIR filter of length 7. An accurate plot of Aω A ω can be obtained with zero padding.

Figure 2
Figure 2 (type1.png)

The following Matlab code fragment for the plot of Aω A ω for a Type I FIR filter.


	  h = [3 4 5 6 5 4 3]/30;
	  N = 7;
	  M = (N-1)/2;
	  L = 512;
	  H = fft([h zeros(1,L-N)]);
	  k = 0:L-1;
	  W = exp(j*2*pi/L);
	  A = H .* W.^(M*k);
	  A = real(A);

	  figure(1)
	  w = [0:L-1]*2*pi/(L-1);
	  subplot(2,1,1)
	  plot(w/pi,abs(H))
	  ylabel('|H(\omega)| = |A(\omega)|')
	  xlabel('\omega/\pi')
	  subplot(2,1,2)
	  plot(w/pi,A)
	  ylabel('A(\omega)')
	  xlabel('\omega/\pi')
	  print -deps type1
	

The command A = real(A) removes the imaginary part which is equal to zero to within computer precision. Without this command, Matlab takes A to be a complex vector and the following plot command will not be right.

Observe the symmetry of Aω A ω due to hn h n being real-valued. Because of this symmetry, Aω A ω is usually plotted for 0ωπ 0 ω only.

Example 2: EVALUATING THE AMP RESP (TYPE II)

Figure 3
Figure 3 (type2.png)

The following Matlab code fragment produces a plot of Aω A ω for a Type II FIR filter.


	  h = [3 5 6 7 7 6 5 3]/42;
	  N = 8;
	  M = (N-1)/2;
	  L = 512;
	  H = fft([h zeros(1,L-N)]);
	  k = 0:L-1;
	  W = exp(j*2*pi/L);
	  A = H .* W.^(M*k);
	  A = real(A);

	  figure(1)
	  w = [0:L-1]*2*pi/(L-1);
	  subplot(2,1,1)
	  plot(w/pi,abs(H))
	  ylabel('|H(\omega)| = |A(\omega)|')
	  xlabel('\omega/\pi')
	  subplot(2,1,2)
	  plot(w/pi,A)
	  ylabel('A(\omega)')
	  xlabel('\omega/\pi')
	  print -deps type2
	

The imaginary part of the amplitude is zero. Notice that Aπ=0 A 0 . In fact this will always be the case for a Type II FIR filter.

An exercise for the student: Describe how to obtain samples of Aω A ω for Type III and Type IV FIR filters. Modify the Matlab code above for these types. Do you notice that Aω=0 A ω 0 always for special values of ωω?

Comments, questions, feedback, criticisms?

Send feedback