• Home
  • Textbooks
  • Digital Signal Processing. Principles, Algorithms and System Design
  • Finite Word Length Effects

Digital Signal Processing. Principles, Algorithms and System Design

Winser Alexander and Cranos M. Williams (Auth.)

Chapter 6

Finite Word Length Effects - all with Video Answers

Educators


Chapter Questions

Problem 1

The system transfer function for an IIR digital filter is given by
$$H(z)=\frac{B(z)}{A(z)}$$where$$
\begin{aligned}B(z)= & 0.1006-0.4498 z^{-1}+1.1211 z^{-2}-1.8403 z^{-3}+2.1630z^{-4} \\
& -1.8403 z^{-5}+1.1211 z^{-6}-0.4498 z^{-7}+0.1006 z^{-8} \\
A(z)= & 1.0-1.0130 z^{-1}+2.8890 z^{-2}-1.4483 z^{-3}+2.4901 z^{-4} \\
& -0.3959 z^{-5}+0.9169 z^{-6}+0.0324 z^{-7}+0.1867 z^{-8}\end{aligned}$$
Develop a cascade implementation of the filter using second order sections.

Check back soon!
05:51

Problem 1

You are required to scale the filter coefficients for fixed point implementation using an input sequence with words scaled to 15 bits and with a requirement that the output can be represented using 32 bit words.
Determine the scale factor for the coefficients

Narayan Hari
Narayan Hari
Numerade Educator

Problem 1

The system transfer function for a digital filter is given by
$$
H(z)=\frac{B(z)}{A(z)}
$$
where
$$
\begin{aligned}
B(z)= & 0.2324+1.6073 z^{-1}+5.0891 z^{-2}+9.5962 z^{-3}+11.7644 z^{-4} \\
& +9.5962 z^{-5}+5.0891 z^{-6}+1.6073 z^{-7}+0.2324 z^{-8}
\end{aligned}
$$
and
$$
\begin{aligned}
A(z)= & 1.0+4.4704 z^{-1}+9.9870 z^{-2}+13.7949 z^{-3}+12.9880 z^{-4} \\
& +8.5743 z^{-5}+4.0521 z^{-6}+1.3003 z^{-7}+0.2508 z^{-8}
\end{aligned}
$$
You are required to scale the filter coefficients for fixed point implementation using an input sequence with words scaled to 14 bits and with a requirement that the output can be represented using 32 bit words. Show all computations.
Determine the scale factor for the numerator coefficients.

Check back soon!

Problem 1

Convert the following numbers to two's complement fixed point numbers assuming that a 10 bit word is used. Assume that one bit is used for the sign. Assume that the decimal point is located after the sign bit in each case. Specify the value of the exponent for the number using this assumption:
0.0934

Check back soon!

Problem 1

The system transfer function for an FIR digital filter is given by
$$
\begin{aligned}
H(z)= & -0.0087-0.1448 z^{-1}+0.0663 z^{-2}+0.6962 z^{-3} \\
& +0.0663 z^{-4}-0.1448 z^{-5}-0.0087 z^{-6}
\end{aligned}
$$
Assume that you want to implement this filter using 14 bit fixed point arithmetic.

Determine the coefficients for the implementation of the filter using fixed point arithmetic. Represent the numbers in the form
$$
\widehat{b(k)}=M \times 2^{-13}
$$
where $M$ is an integer in the range $-2^{13} \leq M \leq 2^{13}-1$.

Check back soon!

Problem 1

Use the following Matlab script to compute the coefficients for an FIR digital filter.
order $=40$
wc $=0.491$
type $=$ high';
b1 = fir1(order, wc, type);
order $=40$;
$w c=0.491 ;$
type $=$ "high";
$b 1=$ fir1(order, wc, type);

Use the Matlab function freqz to plot the magnitude and phase plots for the filter designed using this script which we will call $H(z)$ for this problem.

Check back soon!

Problem 1

This problem involves the statistical analysis of roundoff errors for an IIR second order section. Fig. 6.5 gives a block diagram for a second order FIR filter that has been implemented as two FIR lattice sections. Fig. 6.6 gives a block diagram for the same filter showing the input errors $\left(e_0(n)\right.$ to $\left.e_3(n)\right)$ associated with roundoff errors. The outputs from the adders are rounded from 32 bits by multiplying the adder output by $2^{-16}$ and truncating toward zero. The scaled coefficients are given by
$$
\begin{aligned}
& K_1=22921, \\
& K_2=-7504 .
\end{aligned}
$$

Use the Matlab script sampdata, provided in Appendix A.1, to obtain an input sample. Use the Matlab script fscale, provided in Appendix D.1, to scale the input sequence to 16 bits.

Check back soon!

Problem 1

The system transfer function for a discrete time system is given by$$\begin{aligned}
H(z)= & \frac{B(z)}{A(z)}, \\
B(z)= & 0.1296-0.5471 z^{-1}+1.1387 z^{-2}-1.4293 z^{-3}+1.1387 z^{-4} \\
& -0.5471 z^{-5}+0.1296 z^{-6}, \\
A(z)= & 1.0-1.0584 z^{-1}+2.0396 z^{-2}-0.8474 z^{-3}+1.0440 z^{-4} \\
& -0.1153 z^{-5}+0.2654 z^{-6} .
\end{aligned}$$
Determine the scale factor for the numerator coefficients to scale the coefficients to 14 bit fixed point numbers using the format Q5.8.

Check back soon!

Problem 1

The system transfer function for an IIR digital filter is given by
$$
H(z)=\frac{0.1345-0.4593 z^{-1}+0.6565 z^{-2}-0.4593 z^{-3}+0.1345 z^{-4}}{1.0000-0.2188 z^{-1}+0.9438 z^{-2}+0.1229 z^{-3}+0.2819 z^{-4}} .
$$
The numbers in 32 bit IEEE format are represented in the form
$$
p=(1 . f)(-1)^s\left(2^{e-127}\right)
$$
where $p$ is the floating number to be represented, $s$ is a sign bit, $e$ is the biased exponent represented using 8 bits, and $f$ is a positive fraction represented using 23 bits.
- $s$ is the most significant bit in the 32 bit word (bit 32 ),
- $e$ is the next most significant 8 bits (bits 24 through 31 ), and
- $f$ is the 23 least significant bits (bits 1 through 23).
$$
\text { Determine the values for } s, e \text {, and } f \text { for each of the filter coefficients. }
$$

Check back soon!

Problem 1

The system transfer function for a discrete time system is given by
$$
\begin{aligned}
H(z)= & \frac{B(z)}{A(z)}, \\
B(z)= & 0.3428+2.1417 z^{-1}+5.9713 z^{-2}+9.6003 z^{-3} \\
& +9.6003 z^{-4}+5.9713 z^{-5}+2.1417 z^{-6}+0.3428 z^{-7}, \\
A(z)= & 1.0+4.3846 z^{-1}+8.9602 z^{-2}+10.5621 z^{-3} \\
& +7.5750 z^{-4}+3.1003 z^{-5}+0.5560 z^{-6}-0.0261 z^{-7} .
\end{aligned}
$$
Determine the scale factor for the numerator coefficients to scale the coefficients to 13 bit fixed point numbers with 1 bit representing the sign bit, 5 bits representing the whole number part, and 7 bits representing the fractional part. The scale factor for the coefficients is restricted to be a power of $2\left(s_2=2^m\right)$. This is equivalent to the fixed point format $Q 5.7$.

Check back soon!

Problem 1

Convert the following numbers to two's complement fixed point numbers assuming that a 14 bit word is used. Specify the location of the decimal point and also the value of the exponent in each case:

59.7407

Check back soon!

Problem 1

Convert the following numbers to two’s complement fixed point numbers assuming
that a 12 bit word is used.
0.0062

Check back soon!
01:31

Problem 1

Determine the scale factors for the numerator coefficients to scale the coefficients to 11 bit fixed point numbers.

Brian Lin
Brian Lin
Numerade Educator

Problem 1

Design an FIR band stop filter using the Matlab script firls using the following
parameters:
• The pass band is 1000 to 2500 Hz.
• The stop bands are
(a) 0 to 750 Hz,
(b) 2750 to 4000 Hz.
• The maximum desired pass band ripple is ±2.0 dB.
• The maximum desired stop band ripple is ?35 dB.
• The order of the desired filter is 32.
Use the Matlab help utility to obtain more information on the firls script.

Check back soon!

Problem 1

Use the following Matlab script to design a low pass digital filter.

Check back soon!

Problem 1

The state space representation for a discrete time system is given by
$$
\begin{aligned}
& \mathbf{q}(\mathbf{n})=\mathbf{A q}(\mathbf{n}-\mathbf{1})+\mathbf{B} x(n) \\
& y(n)=\mathbf{C q}(\mathbf{n}-\mathbf{1})+\mathbf{D} x(n)
\end{aligned}
$$
where
$$
\begin{gathered}
\mathbf{A}=\left[\begin{array}{rrrr}
-1.7134 & 1.0000 & 0 & 0 \\
-1.4282 & 0 & 1.0000 & 0 \\
-0.5621 & 0 & 0 & 1.0000 \\
-0.0900 & 0 & 0 & 0
\end{array}\right] \\
\mathbf{B}=\left[\begin{array}{l}
0.6851 \\
1.3697 \\
1.0300 \\
0.2726
\end{array}\right], \\
\mathbf{C}=\left[\begin{array}{lll}
1 & 0 & 0
\end{array}\right] \\
\mathbf{D}=\left[\begin{array}{ll}
0.2996
\end{array}\right] .
\end{gathered}
$$
Determine the scaled state space matrices to implement this system using fixed point arithmetic using the following specifications:
The coefficients of the scaled state space matrices should be represented using 12 bit fixed point numbers.

Check back soon!

Problem 1

This problem involves an investigation of the effects of roundoff on the location of
the zeros and poles of the system transfer function and on the frequency response
when the system is implemented as a cascade of second-order sections.
Use the following Matlab script to design a low pass digital filter.
order -8
$r p=1.5:$
$r s=40$
$w c=0.716:$
$[b, a]=$ el1ip(order, rp, rs, wc):
order $=8$.
$r p=1.5$ :
$r s=40$
$w c=0.716:$
[b, a ] - e11ip(order, rp, rs, wc):

Check back soon!

Problem 2

This problem involves an investigation of the effects of roundoff on the location of
the zeros and poles of the system transfer function and on the frequency response
when the system is implemented as a cascade of second-order sections.
Use the Matlab function $t f 2 \operatorname{sos}$ to develop a cascade implementation of the filter using second order sections.

Check back soon!
01:31

Problem 2

Determine the scale factor for the denominator coefficients to scale the coefficients to 14 bit fixed point numbers using the format Q5.8 with the restriction that the scale factor for the coefficients must be a power of $2\left(s_3=2^m\right)$.

James Kiss
James Kiss
Numerade Educator

Problem 2

Use the Matlab function zplane to plot the location of the zeros for $H(z)$.

Check back soon!

Problem 2

The system transfer function for a discrete time system is given by
$$
\begin{aligned}
H(z)= & \frac{B(z)}{A(z)}, \\
B(z)= & 0.3428+2.1417 z^{-1}+5.9713 z^{-2}+9.6003 z^{-3} \\
& +9.6003 z^{-4}+5.9713 z^{-5}+2.1417 z^{-6}+0.3428 z^{-7}, \\
A(z)= & 1.0+4.3846 z^{-1}+8.9602 z^{-2}+10.5621 z^{-3} \\
& +7.5750 z^{-4}+3.1003 z^{-5}+0.5560 z^{-6}-0.0261 z^{-7} .
\end{aligned}
$$
Determine the scale factor for the denominator coefficients to scale the coefficients to 13 bit fixed point numbers with 1 bit representing the sign bit, 5 bits representing the whole number part, and 7 bits representing the fractional part. The scale factor for the coefficients is restricted to be a power of $2\left(s_2=2^m\right)$. This is equivalent to the fixed point format $Q 5.7$.

Check back soon!

Problem 2

Convert the following numbers to two’s complement fixed point numbers assuming
that a 12 bit word is used.
?0.0111

Check back soon!

Problem 2

Use the Matlab function sampdata provided in the course locker to obtain a sample sequence. Use the Matlab function conv to compute the convolution of the original filter with this sample sequence.

Check back soon!
01:31

Problem 2

Determine the scale factors for the denominator coefficients to scale the coefficients to 11 bit fixed point numbers with the restriction that the scale factor for the coefficients must be a power of $2\left(s_3=2^m\right)$.

James Kiss
James Kiss
Numerade Educator
00:24

Problem 2

Determine the corresponding scaled numerator coefficients.

Ali Soave
Ali Soave
Numerade Educator

Problem 2

Scale the filter coefficients for each individual second order section to 10 bits.

Check back soon!

Problem 2

Obtain the sample input using the sampdata function provided in Appendix A.1.
Use the Matlab conv function to filter the input signal using your FIR band pass
filter.

Check back soon!
05:51

Problem 2

You are required to scale the filter coefficients for fixed point implementation using an input sequence with words scaled to 15 bits and with a requirement that the output can be represented using 32 bit words.
Determine the corresponding scaled integer coefficients.

Narayan Hari
Narayan Hari
Numerade Educator

Problem 2

Convert the following numbers to two's complement fixed point numbers assuming that a 10 bit word is used. Assume that one bit is used for the sign. Assume that the decimal point is located after the sign bit in each case. Specify the value of the exponent for the number using this assumption:
?0.00893

Check back soon!

Problem 2

This problem involves the statistical analysis of roundoff errors for an IIR second order section. Fig. 6.5 gives a block diagram for a second order FIR filter that has been implemented as two FIR lattice sections. Fig. 6.6 gives a block diagram for the same filter showing the input errors $\left(e_0(n)\right.$ to $\left.e_3(n)\right)$ associated with roundoff errors. The outputs from the adders are rounded from 32 bits by multiplying the adder output by $2^{-16}$ and truncating toward zero. The scaled coefficients are given by
$$
\begin{aligned}
& K_1=22921, \\
& K_2=-7504 .
\end{aligned}
$$

Write a Matlab script to obtain the output sequence with the output from the adders multiplied by 2?16 but the results left in a floating point number (no rounding).
This will be used as the output without error. Note that this experiment does not consider any errors due to scaling the K parameters.

Check back soon!

Problem 2

The system transfer function for an IIR digital filter is given by
$$
H(z)=\frac{0.1345-0.4593 z^{-1}+0.6565 z^{-2}-0.4593 z^{-3}+0.1345 z^{-4}}{1.0000-0.2188 z^{-1}+0.9438 z^{-2}+0.1229 z^{-3}+0.2819 z^{-4}} .
$$
The numbers in 32 bit IEEE format are represented in the form
$$
p=(1 . f)(-1)^s\left(2^{e-127}\right)
$$
where $p$ is the floating number to be represented, $s$ is a sign bit, $e$ is the biased exponent represented using 8 bits, and $f$ is a positive fraction represented using 23 bits.
- $s$ is the most significant bit in the 32 bit word (bit 32 ),
- $e$ is the next most significant 8 bits (bits 24 through 31 ), and
- $f$ is the 23 least significant bits (bits 1 through 23).
Determine the two’s complement representation for each of the coefficients as
represented using 32 bit IEEE floating point format.

Check back soon!

Problem 2

Convert the following numbers to two's complement fixed point numbers assuming that a 14 bit word is used. Specify the location of the decimal point and also the value of the exponent in each case:

?262.1167

Check back soon!

Problem 2

The state space representation for a discrete time system is given by
$$
\begin{aligned}
& \mathbf{q}(\mathbf{n})=\mathbf{A q}(\mathbf{n}-\mathbf{1})+\mathbf{B} x(n) \\
& y(n)=\mathbf{C q}(\mathbf{n}-\mathbf{1})+\mathbf{D} x(n)
\end{aligned}
$$
where
$$
\begin{gathered}
\mathbf{A}=\left[\begin{array}{rrrr}
-1.7134 & 1.0000 & 0 & 0 \\
-1.4282 & 0 & 1.0000 & 0 \\
-0.5621 & 0 & 0 & 1.0000 \\
-0.0900 & 0 & 0 & 0
\end{array}\right] \\
\mathbf{B}=\left[\begin{array}{l}
0.6851 \\
1.3697 \\
1.0300 \\
0.2726
\end{array}\right], \\
\mathbf{C}=\left[\begin{array}{lll}
1 & 0 & 0
\end{array}\right] \\
\mathbf{D}=\left[\begin{array}{ll}
0.2996
\end{array}\right] .
\end{gathered}
$$
Determine the scaled state space matrices to implement this system using fixed point arithmetic using the following specifications:
The values of the past state variables, $q_k(n-1)$, used in the computations are represented using 12 bit fixed point numbers. The computed state variables will be truncated or rounded to 12 bits before they are used in later computations.

Check back soon!

Problem 2

Scale the filter coefficients to 10 bit fixed point numbers using the Matlab function iirscale provided in Appendix D.3.

Check back soon!

Problem 3

The state space representation for a discrete time system is given by
$$
\begin{aligned}
& \mathbf{q}(\mathbf{n})=\mathbf{A q}(\mathbf{n}-\mathbf{1})+\mathbf{B} x(n) \\
& y(n)=\mathbf{C q}(\mathbf{n}-\mathbf{1})+\mathbf{D} x(n)
\end{aligned}
$$
where
$$
\begin{gathered}
\mathbf{A}=\left[\begin{array}{rrrr}
-1.7134 & 1.0000 & 0 & 0 \\
-1.4282 & 0 & 1.0000 & 0 \\
-0.5621 & 0 & 0 & 1.0000 \\
-0.0900 & 0 & 0 & 0
\end{array}\right] \\
\mathbf{B}=\left[\begin{array}{l}
0.6851 \\
1.3697 \\
1.0300 \\
0.2726
\end{array}\right], \\
\mathbf{C}=\left[\begin{array}{lll}
1 & 0 & 0
\end{array}\right] \\
\mathbf{D}=\left[\begin{array}{ll}
0.2996
\end{array}\right] .
\end{gathered}
$$
Determine the scaled state space matrices to implement this system using fixed point arithmetic using the following specifications:
Assume that the input is represented using 12 bit fixed point numbers.

Check back soon!

Problem 3

The system transfer function for a discrete time system is given by
$$
\begin{aligned}
H(z)= & \frac{B(z)}{A(z)}, \\
B(z)= & 0.3428+2.1417 z^{-1}+5.9713 z^{-2}+9.6003 z^{-3} \\
& +9.6003 z^{-4}+5.9713 z^{-5}+2.1417 z^{-6}+0.3428 z^{-7}, \\
A(z)= & 1.0+4.3846 z^{-1}+8.9602 z^{-2}+10.5621 z^{-3} \\
& +7.5750 z^{-4}+3.1003 z^{-5}+0.5560 z^{-6}-0.0261 z^{-7} .
\end{aligned}
$$
\text { Determine the fixed point numerator coefficients using the given format. }

Check back soon!
02:14

Problem 3

This problem involves an investigation of the effects of roundoff on the location of
the zeros and poles of the system transfer function and on the frequency response
when the system is implemented as a cascade of second-order sections.
Use the Matlab function iirscale to scale the coefficients for each of the individual second order sections to 10 bit fixed point numbers.

James Kiss
James Kiss
Numerade Educator

Problem 3

Convert the following numbers to two’s complement fixed point numbers assuming
that a 12 bit word is used.
?0.0552

Check back soon!
02:39

Problem 3

Compute the overall system transfer function for the cascade of the scaled second order sections with no additional rounding beyond that used for the scaling.

James Kiss
James Kiss
Numerade Educator

Problem 3

Convert the following numbers to two's complement fixed point numbers assuming that a 14 bit word is used. Specify the location of the decimal point and also the value of the exponent in each case:

?154.0914

Check back soon!
01:28

Problem 3

Determine the corresponding scaled numerator coefficients (format Q5.8).

AG
Ankit Gupta
Numerade Educator

Problem 3

Compare the location of the poles and zeros and the frequency response of the resulting filter to those for the original filter.
(a) Use the Matlab function zplane to compute and plot the poles and zeros for the original floating point coefficients and for the scaled coefficients
(b) Use the Matlab function freqz to compute the magnitude and phase responses for the original floating point coefficientsand for the scaled coefficients
(c) Summarize the effects of the scaling operation in terms of the location of the poles and zeros and the magnitudes and phases of the corresponding frequency responses.

Check back soon!
01:28

Problem 3

Determine the scaled numerator coefficients.

AG
Ankit Gupta
Numerade Educator

Problem 3

The Matlab function $f s c a l e$ has been provided in Appendix A.1. Use this function to scale the filter coefficients to 6 bits.

Check back soon!

Problem 3

The system transfer function for an IIR digital filter is given by
$$
H(z)=\frac{0.1345-0.4593 z^{-1}+0.6565 z^{-2}-0.4593 z^{-3}+0.1345 z^{-4}}{1.0000-0.2188 z^{-1}+0.9438 z^{-2}+0.1229 z^{-3}+0.2819 z^{-4}} .
$$
The numbers in 32 bit IEEE format are represented in the form
$$
p=(1 . f)(-1)^s\left(2^{e-127}\right)
$$
where $p$ is the floating number to be represented, $s$ is a sign bit, $e$ is the biased exponent represented using 8 bits, and $f$ is a positive fraction represented using 23 bits.
- $s$ is the most significant bit in the 32 bit word (bit 32 ),
- $e$ is the next most significant 8 bits (bits 24 through 31 ), and
- $f$ is the 23 least significant bits (bits 1 through 23).
Determine the hexadecimal representation for each of the coefficients as repre-
sented using 32 bit IEEE floating point format.

Check back soon!
00:32

Problem 3

Determine the scale factor for the denominator coefficients using the requirement that the scale factor must be a power of $2\left(2^m\right.$ where $m$ is an integer).

Ali Soave
Ali Soave
Numerade Educator

Problem 3

Use the Matlab function firscale2 in Appendix D.2 to scale the filter coefficients
to avoid overflow if a 32 bit word is used for the output and a 13 bit word is used
for the input.

Check back soon!

Problem 3

Convert the following numbers to two's complement fixed point numbers assuming that a 10 bit word is used. Assume that one bit is used for the sign. Assume that the decimal point is located after the sign bit in each case. Specify the value of the exponent for the number using this assumption:
?0.552

Check back soon!

Problem 3

This problem involves the statistical analysis of roundoff errors for an IIR second order section. Fig. 6.5 gives a block diagram for a second order FIR filter that has been implemented as two FIR lattice sections. Fig. 6.6 gives a block diagram for the same filter showing the input errors $\left(e_0(n)\right.$ to $\left.e_3(n)\right)$ associated with roundoff errors. The outputs from the adders are rounded from 32 bits by multiplying the adder output by $2^{-16}$ and truncating toward zero. The scaled coefficients are given by
$$
\begin{aligned}
& K_1=22921, \\
& K_2=-7504 .
\end{aligned}
$$

Write a Matlab script to compute the contributions to the error due to rounding from each of the error sources. Use the Matlab rand script to generate appropriate random sequences to model each of the roundoff error inputs. Compute the average power for each error output. For example, if the output due to $e_0(n)$ is $d_0(n)$, then the average power for $d_0(n)$ can be computed as $$
P_0=\frac{1}{N} \sum_{k=0}^{N-1} d_0^2(n)
$$

Check back soon!

Problem 3

Use the Matlab function $f$ scale to quantize the sample sequence for representation using 16 bit fixed point words. Use the Matlab function conv to compute the convolution of the quantized input and your fixed point representation of the filter.

Check back soon!

Problem 4

Use the Matlab zplane function to compute the pole-zero plot for the cascade of the scaled second order sections version of $H(z)$.

Check back soon!

Problem 4

The system transfer function for a discrete time system is given by
$$
\begin{aligned}
H(z)= & \frac{B(z)}{A(z)}, \\
B(z)= & 0.3428+2.1417 z^{-1}+5.9713 z^{-2}+9.6003 z^{-3} \\
& +9.6003 z^{-4}+5.9713 z^{-5}+2.1417 z^{-6}+0.3428 z^{-7}, \\
A(z)= & 1.0+4.3846 z^{-1}+8.9602 z^{-2}+10.5621 z^{-3} \\
& +7.5750 z^{-4}+3.1003 z^{-5}+0.5560 z^{-6}-0.0261 z^{-7} .
\end{aligned}
$$
\text { Determine the fixed point denominator coefficients using the given format. }

Check back soon!

Problem 4

Convert the following numbers to two's complement fixed point numbers assuming that a 10 bit word is used. Assume that one bit is used for the sign. Assume that the decimal point is located after the sign bit in each case. Specify the value of the exponent for the number using this assumption:
0.2565

Check back soon!

Problem 4

The state space representation for a discrete time system is given by
$$
\begin{aligned}
& \mathbf{q}(\mathbf{n})=\mathbf{A q}(\mathbf{n}-\mathbf{1})+\mathbf{B} x(n) \\
& y(n)=\mathbf{C q}(\mathbf{n}-\mathbf{1})+\mathbf{D} x(n)
\end{aligned}
$$
where
$$
\begin{gathered}
\mathbf{A}=\left[\begin{array}{rrrr}
-1.7134 & 1.0000 & 0 & 0 \\
-1.4282 & 0 & 1.0000 & 0 \\
-0.5621 & 0 & 0 & 1.0000 \\
-0.0900 & 0 & 0 & 0
\end{array}\right] \\
\mathbf{B}=\left[\begin{array}{l}
0.6851 \\
1.3697 \\
1.0300 \\
0.2726
\end{array}\right], \\
\mathbf{C}=\left[\begin{array}{lll}
1 & 0 & 0
\end{array}\right] \\
\mathbf{D}=\left[\begin{array}{ll}
0.2996
\end{array}\right] .
\end{gathered}
$$
Determine the scaled state space matrices to implement this system using fixed point arithmetic using the following specifications:
The outputs for the computations cannot exceed 24 bits.

Check back soon!

Problem 4

Use the Matlab function freqz to plot the magnitude and phase plots for the scaled version of $H(z)$.

Check back soon!

Problem 4

Use the Matlab function fscale in Appendix D.1 to scale the sample sequence to
be represented using 13 bit words.

Check back soon!
00:49

Problem 4

Compare the two outputs:
(a) Compute the maximum magnitude difference between samples of the two outputs.
(b) Compute the average of the squared difference between the samples of the two outputs.
(c) Plot the two output sequences on the same plot to compare them. Use a different plot symbol or line type for each sequence.

Amrita Bhasin
Amrita Bhasin
Numerade Educator

Problem 4

Convert the following numbers to two’s complement fixed point numbers assuming
that a 12 bit word is used.
0.2565

Check back soon!

Problem 4

This problem involves an investigation of the effects of roundoff on the location of
the zeros and poles of the system transfer function and on the frequency response
when the system is implemented as a cascade of second-order sections.
You will have 4 second-order sections which we will call $H_1(z), H_2(z), H_3(z)$, and $H_4(z)$. Compute the equivalent overall system transfer function
$$
H_2(z)=H_1(z) H_2(z) H_3(z) H_4(z)=\frac{\sum_{k=0}^8 b 2(k) z^{-k}}{1.0+\sum_{k=1}^8 a 2(k) z^{-k}} .
$$

Check back soon!

Problem 4

Convert the following numbers to two's complement fixed point numbers assuming that a 14 bit word is used. Specify the location of the decimal point and also the value of the exponent in each case:

16.7390

Check back soon!
01:28

Problem 4

Determine the corresponding scaled denominator coefficients (format Q5.8).

AG
Ankit Gupta
Numerade Educator
01:28

Problem 4

Determine the corresponding scaled denominator coefficients.

AG
Ankit Gupta
Numerade Educator

Problem 4

This problem involves the statistical analysis of roundoff errors for an IIR second order section. Fig. 6.5 gives a block diagram for a second order FIR filter that has been implemented as two FIR lattice sections. Fig. 6.6 gives a block diagram for the same filter showing the input errors $\left(e_0(n)\right.$ to $\left.e_3(n)\right)$ associated with roundoff errors. The outputs from the adders are rounded from 32 bits by multiplying the adder output by $2^{-16}$ and truncating toward zero. The scaled coefficients are given by
$$
\begin{aligned}
& K_1=22921, \\
& K_2=-7504 .
\end{aligned}
$$

Compute the average power in the error free output from part 2 as $$
P Y=\frac{1}{N} \sum_{k=0}^{N-1} y^2(n)
$$
where $y(n)$ is the error free output.

Check back soon!
01:28

Problem 4

Determine the scaled denominator coefficients.

AG
Ankit Gupta
Numerade Educator

Problem 5

Use the Matlab function conv function to filter the scaled input sequence using
your the scaled band pass filter.

Check back soon!

Problem 5

Convert the following numbers to two's complement fixed point numbers assuming that a 10 bit word is used. Assume that one bit is used for the sign. Assume that the decimal point is located after the sign bit in each case. Specify the value of the exponent for the number using this assumption:
0.6071

Check back soon!

Problem 5

This problem involves an investigation of the effects of roundoff on the location of
the zeros and poles of the system transfer function and on the frequency response
when the system is implemented as a cascade of second-order sections.
Compare the location of the poles and zeros and the frequency response of the resulting filter $\mathrm{H}_2(z)$ to those for the original filter.
(a) Use the Matlab function zplane to compute and plot the poles and zeros for the original floating point coefficients $[b, a]$ and for the scaled coefficients $[b 2, \mathrm{a} 2]$.
(b) Use the Matlab function freqz to compute the magnitude and phase responses for the original floating point coefficients $[b, a]$ and for the scaled coefficients $[\mathrm{b} 2, \mathrm{a} 2]$.

Check back soon!

Problem 5

Convert the following numbers to two’s complement fixed point numbers assuming
that a 12 bit word is used.
0.607

Check back soon!

Problem 5

Use the Matlab freqz function to plot the magnitude and phase of the frequency response for the cascade of the scaled second order sections version of $H(z)$.

Check back soon!

Problem 5

This problem involves the statistical analysis of roundoff errors for an IIR second order section. Fig. 6.5 gives a block diagram for a second order FIR filter that has been implemented as two FIR lattice sections. Fig. 6.6 gives a block diagram for the same filter showing the input errors $\left(e_0(n)\right.$ to $\left.e_3(n)\right)$ associated with roundoff errors. The outputs from the adders are rounded from 32 bits by multiplying the adder output by $2^{-16}$ and truncating toward zero. The scaled coefficients are given by
$$
\begin{aligned}
& K_1=22921, \\
& K_2=-7504 .
\end{aligned}
$$

Compute the roundoff error signal to noise power as the ratio of the average output power for the error free output to the total average noise power.

Check back soon!

Problem 5

Convert the following numbers to two's complement fixed point numbers assuming that a 14 bit word is used. Specify the location of the decimal point and also the value of the exponent in each case:
98.8602

Check back soon!

Problem 5

Use the Matlab function zplane to plot the location of the zeros for the scaled version of $H(z)$.

Check back soon!

Problem 6

Convert the following numbers to two's complement fixed point numbers assuming that a 10 bit word is used. Assume that one bit is used for the sign. Assume that the decimal point is located after the sign bit in each case. Specify the value of the exponent for the number using this assumption:
129.411

Check back soon!

Problem 6

Compare the output from the fixed point implementation with the floating point
output:
(a) Compute the maximum magnitude difference between samples of the two
outputs.
(b) Compute the average of the squared difference between the samples of the
two outputs.
(c) Plot the two output sequences on the same plot to compare them. Use a different plot symbol or line type for each sequence.

Check back soon!

Problem 6

Convert the following numbers to two’s complement fixed point numbers assuming
that a 12 bit word is used.
160.4711

Check back soon!

Problem 6

This problem involves an investigation of the effects of roundoff on the location of
the zeros and poles of the system transfer function and on the frequency response
when the system is implemented as a cascade of second-order sections.
Give a short summary of your observations on the impact of rounding on the system transfer function and any benefits from using second order sections to implement the filter.

Check back soon!

Problem 6

Compare the location of the poles and zeros and the frequency response of the resulting cascade of the scaled second order sections version of $H(z)$ to those for the original filter.

Check back soon!

Problem 6

Compare the location of the poles and zeros and the frequency response of the scaled version of $H(z)$ to those for the original filter.

Check back soon!

Problem 7

Give a short summary of your observations on the impact of rounding on the system transfer function and any benefits from using second order sections to implement the filter.

Check back soon!

Problem 7

Convert the following numbers to two’s complement fixed point numbers assuming
that a 12 bit word is used.
?89.7895

Check back soon!

Problem 7

Give a short summary of your observations on the impact of rounding on the system transfer function.

Check back soon!

Problem 7

Convert the following numbers to two's complement fixed point numbers assuming that a 10 bit word is used. Assume that one bit is used for the sign. Assume that the decimal point is located after the sign bit in each case. Specify the value of the exponent for the number using this assumption:
?75.192

Check back soon!

Problem 7

Observe that the number of bits needed to represent the scaled filter coefficients
obtained in part 3 is greater than 16 bits.
(a) Determine the maximum word size we can use for scaling the input sequence
and represent the filter coefficients using 16 bit words without getting overflow when a 32 bit word is used for the output.
(b) Use the Matlab function firscale2 to scale the filter coefficients using this
word size for the input sequence.
(c) Repeat part 5 using the revised scaled filter coefficients. The input for this
part of the problem should be scaled to the new word size using fscale.
(d) Repeat part 6 to compare the output for the convolution of the revised fixed
point coefficients and the input scaled to the new word size with the output
from the floating point implementation.

Check back soon!

Problem 8

Convert the following numbers to two’s complement fixed point numbers assuming
that a 12 bit word is used.
?18.1259

Check back soon!

Problem 8

Convert the following numbers to two's complement fixed point numbers assuming that a 10 bit word is used. Assume that one bit is used for the sign. Assume that the decimal point is located after the sign bit in each case. Specify the value of the exponent for the number using this assumption:
?40.281

Check back soon!

Problem 8

To be turned in:
(a) The design parameters for your FIR filter. This includes the input arrays to
firls for specifying the frequencies, the frequency response, the weights, etc.
(b) The Matlab script for designing and implementing the floating point and both
versions of the fixed point implementations of the filter.
(c) The magnitude and phase plots for the filter.
(d) The stem plots for all of the output sequences.
(e) The parameters for comparing the outputs to the floating point output from
conv.

Check back soon!

Problem 9

Convert the following numbers to two’s complement fixed point numbers assuming
that a 12 bit word is used.
3.8986

Check back soon!

Problem 9

Convert the following numbers to two's complement fixed point numbers assuming that a 10 bit word is used. Assume that one bit is used for the sign. Assume that the decimal point is located after the sign bit in each case. Specify the value of the exponent for the number using this assumption:
5.898

Check back soon!

Problem 10

Convert the following numbers to two’s complement fixed point numbers assuming
that a 12 bit word is used.
1.6470

Check back soon!

Problem 10

Convert the following numbers to two's complement fixed point numbers assuming that a 10 bit word is used. Assume that one bit is used for the sign. Assume that the decimal point is located after the sign bit in each case. Specify the value of the exponent for the number using this assumption:
2.647

Check back soon!