I am trying to figure out the mechanics of plotting the frequency response of a FIR filter. For example, I have used an algorithm (Parks-McClellan), to generate a low pass FIR filter with an even number of coefficients. I've got 34 tap values. Now I want to show the frequency response of this configuration in a normalized frequency 0 ... 1.0 (Fs) graph. The literature says, "The frequency response of the filter is computed by passing the array of coefficients through the discrete Fourier transform (DFT)." The text goes on to show this nice smooth graph, plotting magnitude vs frequency from 0.0 to 1.0. I would like to reproduce that graph.

So I sent it through my DFT code, well a 34 point DFT generates a very blocky DFT and it looks nothing like the graphic. I wanted more points of the DFT (between 0 and 34) and tried adding fractional points 0.0, 0.1, 0.2, .. 34.0) and got a very "loopy" DFT with lots of humps (and also not at all like the graphic), I tried "upsampling" adding zeros between the values, still no joy. I tried allowing the tap sequence to repeat, no joy. So I'm really curious how its done. Sending it to the MATLAB plot function produces the expected graph, so I have some confidence the data is good. Just my understanding of the mechanics of how to get the higher resolution graph are incomplete.

  • 3
    $\begingroup$ dunno why you were downvoted. that wasn't very friendly. i'll counter it with an up. anyway, take your 34 tap values and zero-pad it to a length of, say, 1024. then DFT that FIR. you'll get a nice smooth result. $\endgroup$ May 24, 2019 at 20:09
  • $\begingroup$ also, if you already are using Matlab, check the documentation for the filter() function, which will directly plot the frequency response. $\endgroup$
    – Juancho
    May 24, 2019 at 20:23
  • $\begingroup$ Thanks @robertbristow-johnson that was super helpful! That was exactly the missing clue I needed. $\endgroup$
    – Turloch
    May 24, 2019 at 22:05
  • $\begingroup$ FWIW, a collegue pointed out chapter 5 of "Understanding Digital Signal Processing" where Richard Lyons writes: If we take the five h(k) coefficient values of 1/5 and append 59 zeros, we have the sequence depicted in Figure 5-8(a). Performing a 64-point DFT on that sequence, and normalizing the DFT magnitudes, gives us the filter’s frequency magnitude response |H(m)| in Figure 5-8(b) and phase response shown in Figure 5-8(c).†† H(m) is our old friend, the sin(x)/x function from Section 3.13." $\endgroup$
    – Turloch
    May 24, 2019 at 23:28

1 Answer 1


If you want to do it manually, it is not upsampled by adding zeroes between coefficients. It is usually done by adding extra zeroes after the real coefficients. When padded to some convenient power of two like 512 coefficients, FFT can be used. The resulting amplitudes need to be scaled due to the padding. Matlab and Octave have freqz function to plot this directly for you.

  • $\begingroup$ No need for amplitude scaling... DFT transform of the padded signal will have the same amplitudes... (just finer frequency sample spacing) $\endgroup$
    – Fat32
    May 25, 2019 at 2:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.