# Frequency response of a (rectangular) integrator

A very simple question which can't really figure out:

I have a simple discrete time rectangular integrator with Z transform H(z) = 1/(1-Z^(-1))

Plotting the frequency response with Matlab using freqz shows what it looks like a kind of low pass filter response.

However, when finding the freq response by sending an delta pulse through the integrator via filter Matlab function, and performing the FFT on its output, I just get a pulse (with amplitude equal to number of FFT points) followed of zeroes.

I guess this kind of makes sense mathematically, as the output of the integrator is a step function, which, after FFT, is the addition of as many samples of the step output as the FFT length.

However,

1. Why does the freqz method does not match the impulse response + FFT approach?

2. Am I wrong in trying to look at an integrator as a digital filter?

Thanks a mill

PD: I forgot to mention that this is the closest to this question I could find on the site... However it is a leaky integrator not a rectangular (i.e. feedback multiplier is 1) integrator

Is a leaky integrator the same thing as a low pass filter?

Those are good questions! Here's my "two cents." Hilmar is correct, the integrator is not stable because there's a pole on the z-plane's unit circle. But I'll bet a pint of beer that the region of convergence is outside the pole (and therefore outside the unit circle) because the integrator's impulse response is causal.

Answer to question# 1: Matlab's freqz() command computes the freq response at zero Hz by evaluating a ratio of polynomials at various frequencies. And that ratio has a zero-valued denominator at zero Hz. So freqz() gives a freq mag response of infinity at zero Hz. The DFT of an impulse response that's a finite-length sequence of ones, evaluated at zero Hz, is merely the sum of the impulse response samples. The two approaches result in freq magnitude responses that are zero-valued at all frequencies except at zero Hz. Both approaches give similar results.

Answer to question# 2: You could, if you wish, call an integrator a "filter." But it's unstable, and unstable filters are of no value in trying to filter real-world signals.

• hey, Rick. we gotta bump up your "rep" here. talk to Peter K or Dilip or sumbuddy. i would say that a single pole on the unit circle might be called "marginally stable" or "virtually stable". double poles on the unit circle would be "unstable" as well as any poles outside the unit circle (even those canceled by zeros). but i would agree that to use the word "stable" without qualification better mean that all of the poles are strictly inside the unit circle. anyway, that's what i think the word means. – robert bristow-johnson Jul 29 '15 at 3:44
• oh, and about your second answer, Julius Smith and Avery Wang might disagree: On Fast FIR Filters Implemented as Tail-Canceling IIR Filters. now I wouldn't do it this way (i would do this linear-phase thing using FILTFILT on blocks and overlap-add, like Powell and Chau but use TIIR filters like S&W do. but i would not cascade a stable TIIR with an unstable TIIR (periodically cleaning it the unstable TIIR) like Smith & Wang do. just seems too unsafe even with pole-zero cancellation. – robert bristow-johnson Jul 29 '15 at 3:52
• thank you guys for the insightful answers. Really appreciated – Almendrico Aug 9 '15 at 10:09

"integrator is unstable since it has a pole on the unit circle" -- not true. This Z-1 is done all the time in CIC resamplers. The pole is --on-- the unit circle exactly, and is therefore stable. Fun fact, if you use floating point math this falls apart and the integrator blows up bc the value is not exactly 1, its 1.000000000001 (or something larger than 1)

The integrator is unstable since it has a pole on the unit circle. That's outside the region of convergence of the Z transform and therefore Z transform analysis is not valid anymore.

If you look at the data that freqz returns you can see that its infinity for omega= 0. Freqz() is nice enough to ignore this and still produces a plot (which it probably shouldn't).