Frequency response FIR: properties

Screencast video [⯈]



In the previous section, we found the following relation between the impulse response description in time domain h[n] and the frequency response description in frequency domain H(ejθ): Time domainFrequency domainh[n]=k=0M1h[k]δ[nk]H(ejθ)=k=0M1h[k]ejθk

The first important property of the Frequency response H(ejθ), is that it is a periodic function with period 2π. This can be verified by adding an integer number l times 2π to the frequency θ, which result into: H(ej(θ+l2π))=k=0M1h[k]ej(θ+l2π)k=k=0M1h[k]ejθkejlk2π=k=0M1h[k]ejθk1=H(ejθ). The fact that the frequency response is a periodic function of θ, with period 2π, is the main reason that we do not denote this function as H(θ), but in a special way, namely by H(ejθ).

The second important property is that the Frequency response of a real impulse response h[n] is a conjugate symmetric function, thus: H(ejθ)=H(ejθ). A proof of this property is as follows:

By using the fact that the impulse response h[n] is real, thus the complex conjugate values of the impulse response coefficients are the same as the impulse response values themselves (h[n]=h[n]), we obtain:

H(ejθ)=k=0M1h[k]ejθk=k=0M1h[k] (ejθk)=(k=0M1h[k]ejθk)=H(ejθ).

Concluding the two most important properties of the frequency response of an FIR filter with real coefficients are: Periodic :H(ejθ)=H(ej(θ+l2π)Complex conjugated :H(ejθ)=(H(ejθ))

Example


Calculate the frequency response H(ejθ) of the FIR filter as depicted in the figure below and show the two main basic properties as described above.
Example to show basic properties of Frequency response.
Example to show basic properties of Frequency response.

From the signal flow graph (or realization scheme) of the FIR filter it follows that the impulse response is given by: h[n]=δ[n]+3δ[n1]δ[n2] and from this equation we obtain the following expression for the frequency response: H(ejθ)=1ej0θ+3ejθej2θ=1+3ejθej2θ. The periodicity of this function can be demonstrated by adding for example 2π to the frequency θ. This results in: H(ej(θ+2π))=1+3ej(θ+2π)ej2(θ+2π)=1+3ejθej2πej2θej222π=1+3ejθej2θ=H(ejθ). The complex conjugate property can be shown as follows: H(ejθ)=1+3ejθej2θ=1+3(ejθ)(ej2θ)=(1)+(3ejθ)+(ej2θ)=(1+3ejθej2θ)=H(ejθ)



Graphical Representation

In the module Complex Numbers And Phasors (CNAP) we have seen that a complex number can be represented as a vector in the complex plane. Such a complex vector can be represented either in the Cartesian way or in the Polar way. In order to represent the frequency response H(ejθ), we often choose the Polar representation. For this reason, we write the frequency response as: H(ejθ)=|H(ejθ)|ejH(ejθ). To represent the frequency response graphically, we can make two plots: One representing the magnitude response |H(ejθ)| and the other representing the phase response H(ejθ), both as a function of frequency θ.

In most signal processing software, like Matlab, the plot of the phase response is restricted to the range πH(ejθ)π. This is allowed because we may add or subtract 2π to the phase without changing the result, thus: ejH(ejθ)±2π=ejH(ejθ)ej±2π=ejH(ejθ).

Example


Calculate the frequency response of a system that consists of two delays in series. Make a plot of both the magnitude- and phase-response as a function of relative frequency θ inside the Fundamental Interval (FI), thus with |θ|π.
The impulse response of this system is given by h[n]=δ[n2] and from this it follows that the frequency response equals H(ejθ)=1ej(2θ). Thus the magnitude response is equal to |H(ejθ)|=1 and the phase response is equal to H(ejθ)=2θ. The graphical representation of the magnitude- and phase-response is depicted in the figure below. In the lower left-hand side figure we can see that, within the FI, the plot of the phase response of this system is in the range: 2πejH(ejθ)2π. However, the phase does not change if we add or subtract 2π, since ej2π=ej2π=1. Thus, in the graphical representation of the phase response we can subtract 2π in case the phase response becomes larger than 2π. Similarly we can add 2π in case the value becomes smaller than 2π. The lower right-hand plot depicts the phase response within these boundaries |H(ejθ)|π. This is usually automatically done in MATLAB.
Magnitude- and phase-response of a system with 2 delays.
Magnitude- and phase-response of a system with 2 delays.

The magnitude response |H(ejθ)| is a positive function of θ. However, it may occur that by evaluation of the frequency response we obtain an expression that looks like: H(ejθ)=A(ejθ)ejH(ejθ), in which A(ejθ) can become negative for some values of θ. When representing the magnitude response |H(ejθ)|, which is the absolute value of A(ejθ), we need to compensate for the fact that we plot a negative value as a positive value. So for frequencies for which A(ejθ) is negative we obtain the magnitude response plot |H(ejθ)| by multiplying A(ejθ) by 1. This is equal to a phase correction of ±π, since 1=ejπ=ejπ. Thus, due to the fact that we plot the magnitude response |H(ejθ)|, we will see phase jumps of ±π in the phase response plot at those positions where we have zero crossings in the magnitude response. Concluding, we have the following rules for the graphical representation of the magnitude- and phase-response plots of the frequency response:

  • Both Magnitude- and phase- response are depicted in the Fundamental Interval (FI): |θ|π.
  • The phase response is depicted in the range |H(ejθ)|π.
  • A phase jump of ±π is applied in the phase response plot for each zero crossing of the magnitude response.

Example


Calculate the frequency response H(ejθ) of a first order difference system, from which the Difference Equation is given by: y[n]=x[n]x[n1], and make a graphical plot for θ in the Fundamental Interval (|θ|π)of the magnitude response |H(ejθ)| and phase response H(ejθ), with |H(ejθ)|π.
The frequency response of this first order difference system is given by: H(ejθ)=1ejθ. In order to give the graphical representation of the magnitude- and phase-response we can rewrite the frequency response as follows: H(ejθ)=(ejθ2ejθ2)ejθ2=2sin(θ2)jejθ2=2sin(θ2)ej(π2θ2)=|H(ejθ)|ejH(ejθ). Because of the fact that the function 2sin(θ2) becomes negative in the frequency range πθ<0, we have to compensate the phase with π in this range. Thus, the magnitude- and phase- response of this first order difference system are given by: |H(ejθ)|=|2sin(θ2)| ; H(ejθ)={π2θ2 for 0θππ2θ2 for πθ<0 These plots are shown in the figure below. We can see a phase jump of π at the zero crossing for frequency θ=0.
Magnitude- and phase-response of first order difference system.
Magnitude- and phase-response of first order difference system.

Moving average filter

A moving average filter is used to evaluate the average value of successive input signal samples. By averaging these values we typically expect the higher frequencies to be attenuated. This effect can be shown by evaluating and making plots of the frequency response of such an moving average filter. This is done as follows:

The Difference Equation (DE) of an L-point moving average filter is given by: y[n]=1Lk=0L1x[nk] From this we obtain the frequency response using the geometric series k=0L1ak=1aL1a as: H(ejθ)=1Lk=0L1ejkθ=1L1ejLθ1ejθ=1LejLθ2ejLθ2ejθ2ejθ2ejLθ2ejθ2=sin(Lθ2)Lsin(θ2)ej(L1)θ2 Thus the magnitude- and phase-response of a moving average filter are given by the following expressions: |H(ejθ)|=|sin(Lθ2)Lsin(θ2)|H(ejθ)=(L1)θ2. An important value of the magnitude-response is the value for θ=0. This value can be found by approximate the sin-functions by the first component of its Taylor expansion, meaning that for small values of x the value of sin(x) can be approximated by its first term of the geometric series: sin(x)=xx33!+x55!+. Thus for small values of x we can approximate the fraction sin(Lx)Lsin(x) by (Lx)L(x)=1. sin(Lθ2)Lsin(θ2)θ=0=limθ0{sin(Lθ)Lsin(θ)}=1. The other important values of the phase-response are the zero-crossings, because at these frequencies we will find phase jumps of ±π in the phase-response plot. These zero-crossing can be found for those frequencies for which |H(ejθ)| is zero. Because the frequency of the numerator of |H(ejθ)| increases L times faster than the frequency of the denominator, we can find these zero crossings by evaluating those frequencies for which the numerator is zero. Besides θ=0 these values can be found as follows: sin(Lθ2)=0Lθ2=kπθ=2πL. An example is shown in Fig. 1, which is the graphical representation of the magnitude- and phase-response of an 11-point averaging filter.

Magnitude- and phase-response of 11-point averaging filter.
Magnitude- and phase-response of 11-point averaging filter.

From the left-hand figure we clearly can see that indeed this 11-point averaging filter attenuates higher frequencies. Furthermore, we see 10 zero crossings at locations θ=k2π11, for k=±1,±2,±5. In the right-hand side phase-response plot we see that the slope of the plot is (L1)θ2=5θ. Furthermore, at each of the 10 zero crossings of the magnitude-response we observe a phase jump of ±π.



Cascading FIR systems

In the previous module FIR we have seen that we can combine the impulse responses h1[n] and h2[n] of two cascaded FIR filters to one impulse response h[n] which can be obtained as the convolution sum of the two individual impulse responses. Thus h[n]=h1[n]h2[n].

Now let us see how this works when we use the frequency responses H1(ejθ) and H2(ejθ) of the two FIR filters. This is depicted in Fig. 2.

Cascading of two FIR filters.
Cascading of two FIR filters.

When applying a phasor with frequency ejθn to the first filter, the resulting output signal can be described by H1(ejθ)ejθn. This is a phasor with frequency θ and the magnitude and phase of this phasor are given by the complex number H1(ejθ). Now we apply this phasor to the second filter, which results into H1(ejθ)H2(ejθ)ejθn. In other words the phasor ejθn of the input signal results is changed in amplitude and phase by the complex value H1(ejθ)H2(ejθ). From this we can conclude the following:

When cascading two different FIR filters, one with frequency response H1(ejθ) and the other with frequency response H2(ejθ), we may combine these two FIR filters to one FIR filter of which the frequency response is given by the product of the individual frequency responses: H(ejθ)=H1(ejθ)H2(ejθ).

Example


The following two FIR filters are cascaded: h1[n]=δ[n]+δ[n+2] and h2[n]=δ[n]δ[n+2]. Calculate the impulse- and frequency- response when we cascade these two FIR filters.
Via the impulse responses: h[n]=h1[n]h2[n]=(δ[n]+δ[n2])(δ[n]δ[n2])=δ[n]δ[n4] Via frequency responses: H(ejθ)=H1(ejθ)H2(ejθ)=(1+ej2θ)(1ej2θ)=1ej4θ

In general we can conclude that a convolution in time domain is equivalent to multiplication in the frequency domain: h1[n]h2[n]H1(ejθ)H2(ejθ)



Steady State and transient behaviour

Until now we assumed signals exist for all values of n in the range <n<. However, in practice this will not be the case. More realistically, a signal would for example start with index n=0, thus: x[n]=Aej(θ1n+ϕ)u[n]={Aej(θ1n+ϕ)for n00 for n<0.

We can use the convolution sum to find an expression for the output of an FIR filter with impulse response h[n] to such an input signal. This result in: y[n]=k=0M1h[k]x[nk]=k=0M1h[k]Aej(θ1(nk)+ϕ)u[nk].

By using the fact that the unit step u[nk] is only 1 for indices nk0, or equivalently for kn, this equation can be rewritten as follows: y[n]={0n<0(k=0nh[k]ejθ1k)Aej(θ1n+ϕ)0n<M1Transient region(k=0M1h[k]ejθ1k)Aej(θ1n+ϕ)nM1Steady state region

Concluding:

  • Transient region: The complex multiplier (k=0nh[k]ejθ1k) depends on the index n.
  • Steady state region: The complex multiplier k=0M1h[k]ejθ1k is constant. Output contains only input frequency (θ1 in this example).
  • If for n>M1 the input changes to zero or to another frequency θ2θ1, then there will be a new transition- and steady state- region.

Fig. 3 shows the transient-region (in red samples) and steady- state region when we apply the signal x[n]=cos(π3n)u[n] to an FIR filter with impulse response h[k]=δ[n]+2δ[n1]+δ[n2].

Example to show transient- and steady-state region.
Example to show transient- and steady-state region.



Filtering continuous signal

In practice we often filter a continuous-time signal in the discrete-time domain as depicted in Fig. 4. The main motivations for this, is that the implementation in discrete-time domain is much more flexible and cheaper compared to the implementation in the continuous-time domain.

Filtering continuous-time signal in the discrete-time domain.
Filtering continuous-time signal in the discrete-time domain.

Of course in practice we have to take care of the aliasing effect, as discussed in the module on sampling and reconstruction, so the sampling frequencies of the C/D and D/C convertor are chosen at least twice the largest frequency of the continuous-time signal x(t).

Example


Given the continuous-time signal x(t)=5+2cos(2100πt+π4)+3cos(2800πtπ6). We sample this signal with a C/D convertor that runs at a a sample rate fs=1/Ts=4200 [samples/sec]. Next we filter the discrete-time signal samples x[n] with an FIR filter of which the impulse response is given by h[n]=δ[n]+δ[n1]. The discrete-time output signal samples y[n] are converted back to the continuous-time signal y(t) by a D/C convertor. The D/C convertor runs at the same sampling frequency fs1/Ts=4200 [samples/sec] as the C/D convertor. Calculate the continuous-time signal y(t).
With a sample rate fs=1/Ts=4200 [samples/sec] of the C/D convertor we obtain the following expression for the discrete-time input signal samples: x[n]=5+2cos(π2n+π4)+3cos(2π3nπ6). From the given impulse response it follows that the frequency response can be written as follows: H(ejθ)=1+ejθ=2cos(θ2)ejθ2 The discrete-time input signal x[n] consists of the frequencies: θ=0,π2 and 2π3, so we have to evaluate the frequency response H(ejθ) for these frequencies in order to find the output signal y[n]. Thus: H(ejθ)θ=0=2H(ejθ)θ=π2=H(ejθ)θ=π2=2ejπ4H(ejθ)θ=2π3=H(ejθ)θ=2π3=ejπ3. Based on these values the output y[n] is as follows: y[n]=52+22cos(π2n+π4π4)+31cos(2π3nπ6π3)=10+22cos(π2n)+3cos(2π3nπ2) With a sample rate fs=1/Ts=4200 [samples/sec] of the D/C convertor the resulting continuous-time output signal becomes: y(t)=10+22cos(2100πt)+3cos(2800πtπ2).