Homework 9 Solutions

Similar documents
Homework 6 Solutions

The Johns Hopkins University Department of Electrical and Computer Engineering Introduction to Linear Systems Fall 2002.

Signals and Systems Profs. Byron Yu and Pulkit Grover Fall Midterm 2 Solutions

Final Exam of ECE301, Section 3 (CRN ) 8 10am, Wednesday, December 13, 2017, Hiler Thtr.

Homework 5 Solutions

Homework 5 Solutions

Problem Value

New Mexico State University Klipsch School of Electrical Engineering EE312 - Signals and Systems I Fall 2015 Final Exam

ECE 301 Fall 2010 Division 2 Homework 10 Solutions. { 1, if 2n t < 2n + 1, for any integer n, x(t) = 0, if 2n 1 t < 2n, for any integer n.

EE 3054: Signals, Systems, and Transforms Summer It is observed of some continuous-time LTI system that the input signal.

ECE-314 Fall 2012 Review Questions for Midterm Examination II

Question Paper Code : AEC11T02

Final Exam of ECE301, Section 1 (Prof. Chih-Chun Wang) 1 3pm, Friday, December 13, 2016, EE 129.

Fourier series for continuous and discrete time signals

Solutions to Problems in Chapter 4

Final Exam of ECE301, Prof. Wang s section 1 3pm Tuesday, December 11, 2012, Lily 1105.

Homework 1 Solutions

3. Frequency-Domain Analysis of Continuous- Time Signals and Systems

x(t) = t[u(t 1) u(t 2)] + 1[u(t 2) u(t 3)]

4 The Continuous Time Fourier Transform

6.003 Homework #10 Solutions

E2.5 Signals & Linear Systems. Tutorial Sheet 1 Introduction to Signals & Systems (Lectures 1 & 2)

Homework 3 Solutions

Homework 4. May An LTI system has an input, x(t) and output y(t) related through the equation y(t) = t e (t t ) x(t 2)dt

George Mason University Signals and Systems I Spring 2016

Representing a Signal

EC Signals and Systems

University Question Paper Solution

Problem Value

EE 224 Signals and Systems I Review 1/10

Ch 4: The Continuous-Time Fourier Transform

Final Exam of ECE301, Prof. Wang s section 8 10am Tuesday, May 6, 2014, EE 129.

Digital Signal Processing. Midterm 1 Solution

LECTURE 12 Sections Introduction to the Fourier series of periodic signals

GATE EE Topic wise Questions SIGNALS & SYSTEMS

EE 16B Final, December 13, Name: SID #:

LTI Systems (Continuous & Discrete) - Basics

EE Homework 13 - Solutions

Using MATLAB with the Convolution Method

Signals and Systems Spring 2004 Lecture #9

ECE 301: Signals and Systems Homework Assignment #3

ECE 301 Fall 2011 Division 1. Homework 1 Solutions.

Lecture 8: Signal Reconstruction, DT vs CT Processing. 8.1 Reconstruction of a Band-limited Signal from its Samples

Table 1: Properties of the Continuous-Time Fourier Series. Property Periodic Signal Fourier Series Coefficients

Chapter 6: Applications of Fourier Representation Houshou Chen

ECE 301 Fall 2011 Division 1 Homework 10 Solutions. { 1, for 0.5 t 0.5 x(t) = 0, for 0.5 < t 1

Problem Value

Signals & Systems. Lecture 5 Continuous-Time Fourier Transform. Alp Ertürk

EE301 Signals and Systems In-Class Exam Exam 3 Thursday, Apr. 19, Cover Sheet

Therefore the new Fourier coefficients are. Module 2 : Signals in Frequency Domain Problem Set 2. Problem 1

The different frequency components in a sound signal are processed first by the sensory system in the ear then some specialized cortical areas in the

EE 637 Final April 30, Spring Each problem is worth 20 points for a total score of 100 points

Frequency-Domain C/S of LTI Systems

EEL3135: Homework #4

NAME: ht () 1 2π. Hj0 ( ) dω Find the value of BW for the system having the following impulse response.

ECE 301 Division 1 Final Exam Solutions, 12/12/2011, 3:20-5:20pm in PHYS 114.

Chapter 4 The Fourier Series and Fourier Transform

Homework 3 Solutions

Professor Fearing EECS120/Problem Set 2 v 1.01 Fall 2016 Due at 4 pm, Fri. Sep. 9 in HW box under stairs (1st floor Cory) Reading: O&W Ch 1, Ch2.

Signals and Systems. Problem Set: The z-transform and DT Fourier Transform

3 Fourier Series Representation of Periodic Signals

EE 210. Signals and Systems Solutions of homework 2

ECE 3620: Laplace Transforms: Chapter 3:

Each problem is worth 25 points, and you may solve the problems in any order.

Lecture 3 January 23

Module 4. Related web links and videos. 1. FT and ZT

Tutorial Sheet #2 discrete vs. continuous functions, periodicity, sampling

Digital Signal Processing. Lecture Notes and Exam Questions DRAFT

EEL3135: Homework #3 Solutions

13. Power Spectrum. For a deterministic signal x(t), the spectrum is well defined: If represents its Fourier transform, i.e., if.

LINEAR SYSTEMS. J. Elder PSYC 6256 Principles of Neural Coding

EE 3054: Signals, Systems, and Transforms Spring A causal discrete-time LTI system is described by the equation. y(n) = 1 4.

Homework 7 Solution EE235, Spring Find the Fourier transform of the following signals using tables: te t u(t) h(t) = sin(2πt)e t u(t) (2)

ECE 301 Division 1, Fall 2008 Instructor: Mimi Boutin Final Examination Instructions:

Ver 3808 E1.10 Fourier Series and Transforms (2014) E1.10 Fourier Series and Transforms. Problem Sheet 1 (Lecture 1)

Grades will be determined by the correctness of your answers (explanations are not required).

NAME: 11 December 2013 Digital Signal Processing I Final Exam Fall Cover Sheet

06/12/ rws/jMc- modif SuFY10 (MPF) - Textbook Section IX 1

ENSC327 Communications Systems 2: Fourier Representations. School of Engineering Science Simon Fraser University

Final Exam 14 May LAST Name FIRST Name Lab Time

so mathematically we can say that x d [n] is a discrete-time signal. The output of the DT system is also discrete, denoted by y d [n].

Lecture 8 ELE 301: Signals and Systems

Homework 6 EE235, Spring 2011

/ (2π) X(e jω ) dω. 4. An 8 point sequence is given by x(n) = {2,2,2,2,1,1,1,1}. Compute 8 point DFT of x(n) by

PART 1. Review of DSP. f (t)e iωt dt. F(ω) = f (t) = 1 2π. F(ω)e iωt dω. f (t) F (ω) The Fourier Transform. Fourier Transform.

x[n] = x a (nt ) x a (t)e jωt dt while the discrete time signal x[n] has the discrete-time Fourier transform x[n]e jωn

Chapter 5 Frequency Domain Analysis of Systems

ECE-700 Review. Phil Schniter. January 5, x c (t)e jωt dt, x[n]z n, Denoting a transform pair by x[n] X(z), some useful properties are

GEORGIA INSTITUTE OF TECHNOLOGY SCHOOL of ELECTRICAL and COMPUTER ENGINEERING

LAB 6: FIR Filter Design Summer 2011

1 otherwise. Note that the area of the pulse is one. The Dirac delta function (a.k.a. the impulse) can be defined using the pulse as follows:

Chapter 4 The Fourier Series and Fourier Transform

2 Background: Fourier Series Analysis and Synthesis

Chap 2. Discrete-Time Signals and Systems

Fourier Representations of Signals & LTI Systems

A.1 THE SAMPLED TIME DOMAIN AND THE Z TRANSFORM. 0 δ(t)dt = 1, (A.1) δ(t)dt =

Homework 5 EE235, Summer 2013 Solution

ECE 3084 QUIZ 2 SCHOOL OF ELECTRICAL AND COMPUTER ENGINEERING GEORGIA INSTITUTE OF TECHNOLOGY APRIL 2, Name:

3.2 Complex Sinusoids and Frequency Response of LTI Systems

New Mexico State University Klipsch School of Electrical Engineering. EE312 - Signals and Systems I Spring 2018 Exam #1

Transcription:

8-290 Signals and Systems Profs. Byron Yu and Pulkit Grover Fall 207 Homework 9 Solutions Part One. (6 points) Compute the convolution of the following continuous-time aperiodic signals. (Hint: Use the convolution property of the Fourier representations) x (t) = sin( 3πt) 4 πt ( sin( π 7 x 2 (t) = t) πt Solution: According to the convolution property, we have From the table we get ) 2 x (t) x 2 (t) X (j)x 2 (j) X (j) = { 3π 4 0 otherwise X (j) 3π 4 3π 4 For X 2 (j), we can first find the F of x 3 (t) = sin( π 7 t) πt property. and then use the multiplication

2 Homework 9 Solutions X 3 (j) = { π 7 0 otherwise X 3 (j) π 7 π 7 Calculate X 2 (j) = 2π X 3(j) X 3 (j) we get + 2π 0 2π 7 7 X 2 (j) = 2π + 0 < 2π 7 7 0 otherwise X 2 (j) 7 2π 7 2π 7 Since 2π < and 2π < 3π, we have X 7 7 4 (j)x 2 (j) = X 2 (j) hus x (t) x 2 (t) = x 2 (t) = ( sin( π 7 t) ) 2 πt

Homework 9 Solutions 3 2. (0 points) Determine whether the time-domain signals corresponding to the following frequency-domain representations are real, purely imaginary, or neither. Also determine whether the time-domain signals are even, odd or neither. Briefly explain your answer by identifying the relevant features of the frequency-domain representations. (a) F X(j) is given as below. X(j) X(j) π 2 5 4 3 2 2 3 4 5 2 4 5 4 3 2 3 5 π 2 (b) One period of DFS X[k] is given as below. X[k] X[k] π 5 4 3 2 2 3 4 5 k 5 4 3 2 2 3 4 5 k π Solution: (a) Based on the given information, we know Re{X(j)} = 0 and X(j) is odd. As a result x(t) is real and odd. (b) Based on the given information, we know Im{X[k]} = 0 and X[k] is even. As a result x[n] is real and even.

4 Homework 9 Solutions 3. (2 points) Let x (t) = u(t + ) u(t ) and y (t) = x (t) x (t) be the continuoustime convolution of x (t) with itself. (a) Evaluate X (j), the F of x (t). (b) Evaluate Y (j), the F of y (t). (c) Evaluate Y (j), the F of y(t) given below. (Hint: Express y(t) as a sum of x (t) and y (t)) y(t) 3 2 2 2 t Solution: (a) X (j) = x (t)e jt dt = = t= t= t= (u(t + ) u(t ))e jt dt e jt dt = e jt j = ej e j j = 2 sin()

Homework 9 Solutions 5 (b) y (t) = x (t) x (t). By the convolution property of Fourier ransform, we have, Y (j) = X (j)x (j) ( ) ( ) 2 sin() 2 sin() = ( ) 2 2 sin() = (c) Notice that y(t) = x (t) + y (t). Using linearity of F, we have, Y (j) = X (j) + Y (j) ( ) ( 2 sin() 2 sin() = + ) 2

6 Homework 9 Solutions 4. (0 points) Given the continuous-time signal x(t) = sin(πt), compute the F for the πt following signals. (a) y (t) = t x(τ + 2)dτ (b) y 2 (t) = d2 dt 2 x(t) d dt x(t) Solution: x(t) = sin(πt) πt X(j) = {, π 0, otherwise (a) y (t) = t x(τ + 2)dτ let s do a variable change σ = τ + 2 = y (t) = t+2 x(σ)dσ = y (t + 2) t x(σ)dσ = Y (j) = X(j) + πδ() j y (t) = y (t + 2) = Y (j) = e j2 Y (j) his implies: y (t) = t x(τ + 2)dτ Y (j) = e j2 Y (j) ( ) Y (j) = e j2 X(j) + πδ() j Y (j) = ej2 j X(j) + ej2 πδ() y (t) = t x(τ + 2)dτ Y (j) = { e j2 j + ej2 πδ(), π 0, otherwise

Homework 9 Solutions 7 (b) his implies the following: y 2 (t) = d2 dt 2 x(t) d dt x(t) y 2 (t) = d2 dt 2 x(t) = Y 2(j) = (j) 2 X(j) = Y 2 (j) = 2 X(j) y 22 (t) = d dt x(t) = Y 22(j) = jx(j) y 2 (t) = d2 dt 2 x(t) d dt x(t) Y 2(j) = 2 X(j) jx(j) Y 2 (j) = ( 2 j)x(j) { ( 2 j), π Y 2 (j) = 0, otherwise

8 Homework 9 Solutions 5. (8 points) Determine the time-domain signals for the following Fourier representations. (a) Y (e jω ) = j d dω X(ejΩ ) X(e jω ), where X(e jω ) = 5 e jω (b) Y 2 (j) = j d (X(j( + 2π)) + X(j( 2π))), where X(j) = d 5+j Solution: (a) ( ) n X(e jω ) = x[n] = u[n] e jω 5 5 X (e jω ) = j d dω X(ejΩ ) x [n] = nx[n] (b) his implies that y[n] = nx[n] x[n] = (n )x[n] ( ) n = (n ) u[n] 5 X(j( + 2π)) x(t)e j2πt X(j( 2π)) x(t)e j2πt X(j( + 2π)) + X(j( 2π)) x(t)e j2πt + x(t)e j2πt x(t) ( e j2πt + e j2πt) 2x(t) cos(2πt) j d (X(j( + 2π)) + X(j( 2π))) 2tx(t) cos(2πt) d X(j) = 5 + j x(t) = e 5t u(t) Y 2 (j) y 2 (t) = 2te 5t u(t) cos(2πt)

Homework 9 Solutions 9 Part wo 6. (6 points) Consider the signal x(t) = 0 = 0π. (a) Sketch the Fourier transform X(j). ( πt sin( ) πt ) 2. Let xc (t) = cos( 0 t), where (b) Now x(t) is input to a system H which multiplies it with x c (t), giving y (t). Sketch the Fourier transform Y (j). (c) he output y (t) is further input to the same system, which gives, y 2 (t) = y (t)x c (t). Sketch the Fourier transform Y 2 (j). (d) Now consider the system whose frequency response is H(j) = u( + 2π) u( 2π ). Evaluate the signal y 3(t) = y 2 (t) h(t), where h(t) is the impulse response of the system. Is y 3 (t) related to x(t)? ) πt sin( 2, Solution: x(t) = ( ) xc (t) = cos( 0 t) πt (a) Observe that x(t) = ( sinc( t )) 2. he Fourier transform for x(t) = sinc( t ) is X(j) = ( u( + π ) u( π )) Using the property that multiplication in time domain is convolution in frequency domain, we have, X(j) = 2π ( X(j) X(j)) = ( 2π u( + π ) u( π ) ) { ( + 2π = ), 2π < 0 ( ), 0 < 2π 2π X(j) (u( + π ) u( π ) ) 2π 2π

0 Homework 9 Solutions (b) y (t) = x(t)x c (t) Using the property that multiplication in time domain is convolution in frequency domain, we have, Y (j) = X(j) X c (j) x c (t) = cos( 0 t) = X c (j) = π(δ( + 0 ) + δ( 0 )) Hence, Y (j) = 2π X(j) π(δ( + 0) + δ( 0 )) = 2 (X(j( 0)) + X(j( + 0 ))) 2 Y (j) 4 2π 0 0 2π 0 0 0 2π + 0 0 2π + 0 (c) y 2 (t) = y (t)x c (t). Using the property of time domain multiplication again, Y 2 (j) = 2π Y (j) π(δ( + 0 ) + δ( 0 )) = 2 (Y (j( 0 )) + Y (j( + 0 ))) ( = 4 (X(j( 0 0 )) + X(j( 0 + 0 ))+ X(j( + 0 0 )) + X(j( + 0 + 0 ))) = 4 (X(j( + 2 0)) + 2X(j) + X(j 2 0 )) 2 Y (j) 4 2π 2 0 2 0 2π 2 0 2π 0 0 2π 2π +2 0 2 0 2π +2 0

Homework 9 Solutions (d) y 3 (t) = y 2 (t) h(t). Using the property that time domain convolution is frequency domain multiplication, we have, Y 3 (j) = Y 2 (j)h(j) = 4 (X(j( + 2 0)) + 2X(j) + X(j 2 0 ))H(j) Now, notice that H(j) 0, 2π X(j) 0, 2π 2π. Similarly, X(j( + 2 0 )) 0, 2π X(j( 2 0 )) 0, 2π Given that 0, X(j( ± 2 0 ))H(j) = 0. Hence, 2π. Further, 2 0 2π 2 0 + 2 0 2π + 2 0 Y 3 (j) = 4 2X(j)H(j) = 2 X(j) his problem describes the concept of amplitude modulation. Notice that the original signal, x(t) is a low frequency signal. In practice, low frequency signals not only require very large antennae, but also get mixed up when sent in air. his problem is circumvented by shifting the signal to higher frequency by multiplying it with a very high frequency cosine signal, x c (t), called a carrier signal. he recovery of the signal is an easy operation, which involves multiplication with the same carrier signal x c (t) and cutting off the high frequency terms.

2 Homework 9 Solutions 7. (7 points) Consider the discrete-time periodic signal x[n] = sin ( π 3 n) + sin ( π 5 n). (a) (2 points) Evaluate Ω 0, the fundamental frequency of x[n]. (b) (3 points) Compute the DFS coefficients with Ω 0 as the fundamental frequency. (c) (3 points) Compute the DFS coefficients with fundamental frequency Ω 0 /5. (Hint: his is simply a change of index in the DFS.) Solution: (a) Let x (t) = sin ( π 3 n) and x 2 (t) = sin ( π 5 n) Ω = 2π π 3 = 6 Ω 2 = 2π π 5 = 0 = Ω 0 = LCM(6, 0) = 30. (b) ( π ) x[n] = sin 3 n = 2j = 2j ( π ) + sin 5 n ( ) e j π 3 n e j π 3 n + ( e j π 5 n e j π n) 5 2j ( ) e j 5 2π 30 n e j 5 2π n 30 + ( ) e j 3 2π 30 n 3 2π j e 30 n 2j = X[ 5] = 2j X[ 3] = 2j X[3] = 2j X[5] = 2j

Homework 9 Solutions 3 (c) x[n] = 2j = 2j ( ) e j π 3 n e j π 3 n + ( e j π 5 n e j π n) 5 2j ( ) e j 25 2π 50 n e j 25 2π n 50 + ( ) e j 5 2π 50 n 5 2π j e 50 n 2j = X[ 25] = 2j X[ 5] = 2j X[5] = 2j X[25] = 2j

4 Homework 9 Solutions 8. (5 points) Extra files: Download the files required Matlab questions from Canvas or course website, http://ece.cmu.edu/~ece290/homeworks/hw9_matlab.zip. Unzip it in your working directory, and you will find the files g.png, MatlabQ9.m, and dtfs.m. (a) (6 points) he purpose of this problem is to visually illustrate the convolution property of Fourier transform. You will use the following discrete-time periodic signals: ( ) 2π f[n] = sin where N is a constant. 30 n ), ( 2π g[n] = sin N n Derive the DFS coefficients of f[n] using pencil and paper assuming fundamental period, N 0 = 30. Using the convolution property, evaluate the DFS coefficients of h[n] = g[n] f[n] using pencil and paper, where g[n] = sin ( 2π n) for N = 60, N = N 30, and N = 2. (Hint: Use results from Problem 7) Evaluate the discrete-time signal h[n] for the three values of N using pencil and paper. Submit: DFS of f[n], DFS of h[n], and h[n] for the three values of N. (b) (5 points) Visualization You will now see what the signal h[n] = g[n] f[n] looks like. First, create an array f, which represents 0 periods of f[n] = sin ( 2π 30 n). n = [:300]; f = sin(2*pi/30*n); Plot f and submit the plot. Now load the image g.png, provided in the zip-file. You can view the image using imshow(g). he image contains three rows, where each row is a sinusoid with periods N = 60, 30 and 2. herefore, each row represents g[n] for one value of N. g = imread('g.png'); g = double(g) - 27.5; % subtract the mean Now that you have the signals f[n] and g[n], you can compute h[n] = g[n] f[n]. o convolve the two signals, you use the function cconv from the Image Processing oolbox of Matlab. It convolves two periodic D signals, and hence each horizontal line of g is going to be convolved with f independently.

Homework 9 Solutions 5 h = zeros(size(g)); % create image h same of size as g for y = : size(h,) % for each horizontal line result = cconv(g(y,:), f, 300); % perform convolution h(y,:) = result; % assign the computed result to h end %% Normalize the image and display. imshow(normalize(h)); Submit: Plot of f and the image of h. (c) (4 points) Interpretation In part (a) you computed the time domain representation of signal h[n] for three values of N using the convolution property of DFS. In part (b) you computed h[n] directly using convolution. Do the results of parts (a) and (b) match? Solution: (a) DFS coefficients for discrete periodic sine function are: x[n] = sin (pω 0 n) 2j δ[k p] δ[k + p] 2j he fundamental period of f equals 30 and Ω = 2π. herefore, p = in the formula above. So the DFS coefficients are: 2j δ[k ] δ[k + ] 2j g[n] f[n] NG[k]F [k], where N is the common period. If N = 60 or N = 2, then If N = 30, then g[n] = h[n], and If N = 60 or N = 2, If N = 30, NG[k]F [k] = 0 NG[k]F [k] = 30G[k] 2 = 30( 2j δ[k ] δ[k + ])2 2j = 5( 2 δ[k ] + δ[k + ]) 2 g[n] h[n] = 0 g[n] h[n] = 5cos( 2π 30 n) that is, h[n] is a harmonic function with the same period N = 30.

6 Homework 9 Solutions (b) Below are the two figures. (c) he top and bottom parts of image h is uniform gray, which means that h[n] = 0 for periods = 60 and = 2. On the other hand, the center part of image h

Homework 9 Solutions 7 is a harmonic function with the period N = 30 as in the center of image g, as predicted in part (a).

8 Homework 9 Solutions 9. (5 points) In this problem, we will study the first difference of discrete-time signals. We need to fill in the missing part of MatlabQ9.m for parts (b),(c), and (e) according to the instructions. (a) (3 points) Create a signal x [n] such that x [n] = cos ( πn ) 20 Now we will take the first difference of x [n], namely x 2 [n] = x [n] x [n ]. Derive the expression of x 2 [n] using pencil and paper. Submit: Expression for x 2 [n]. (b) (3 points) We can compute the first difference in Matlab, using the diff function as follows: x2 = [0 diff(x)]; % extra zero to have same length as x Define x [n] and x 2 [n] in MatlabQ9.m, and plot the frequency domain representations of x [n] and x 2 [n] using dtfs(x,n,k) from Homework 7, where n = -200:99 and k = -200:99. Answer: What is the dominant frequency? What is the amplitude at that frequency? Do the frequency and the amplitude match your pencil and paper calculations? Submit: Code for computing x 2 [n] and DFS of x 2 [n], and the frequency domain plots of x [n] and x 2 [n]. (c) (3 points) Now, let us add noise to x [n] and generate the signal sig as below. sig = x + 0.02 * randn(size(x)); % add noise to the clean signal hen compute sig2, the first difference of sig. Define x [n] and x 2 [n] in MatlabQ9.m and plot the two signals. hen plot the DFS coefficients of sig and sig2 and compare the plots. Answer: What happens to the amplitude of the noise when we take the first difference? Answer this question by compare sig and sig2 in the time domain and the frequency domain. Submit: Code for generating sig and sig2, plots of the two time-domain signals and their DFS coefficients. (d) (3 points) Now let us analyze the result in (c) by looking at the frequency response of the first difference operation. Let X[k] be the DFS coefficients of

Homework 9 Solutions 9 x[n]. Derive Y [k], the DFS of y[n] = x[n] x[n ] using pencil and paper. Find H[k] such that Y [k] = H[k]X[k]. Submit: Expressions for Y [k] and H[k] (e) (3 points) Plot the magnitude of H[k] for k = -200:99 and N = 400 in MatlabQ9.m. Answer: Describe how the plot of H[k] explains your observations in part (c). Submit: Code and plot for H[k]. Solutions: (a) x 2 [n] = cos ( πn 20 ) ( ) cos π(n ) = 2 sin ( π 20 40 ) ( ) sin π(2n ) 40 (b) he dominant frequency is 0.025 Hz and the amplitude of one spike should be sin ( π 40) = 0.0785, which matches with the plot.

20 Homework 9 Solutions (c) For the original signal, the noise is negligible in time domain, and we can see the noise has smaller amplitude than the main frequency. After taking the difference, noise becomes obvious in the time domain and the value relative to the main frequency increases in the frequency domain.

Homework 9 Solutions 2

22 Homework 9 Solutions (d) Y [k] = ( e j 2π N k )X[k] H[k] = e j 2π N k (e) Notice that this is a high pass filter. So the noise is enhanced.(if the x-axis is k instead of frequency, student can also get full points for the plot.) Code: %% question b n = -500:499; k = -500:499; % define x and x2 x = cos(n*pi/20); x2 = [0 diff(x)]; % hen calculate their DFS X = dtfs(x,n,k); X2 = dtfs(x2,n,k);

Homework 9 Solutions 23 % Plot freq = k/000; % convert to real frequencies % plot X figure;stem(freq,real(x),'filled','linewidth',2);grid on title('he original signal');xlabel('frequency(hz)');ylabel('dfs'); % plot X2 figure;stem(freq,imag(x2),'filled','linewidth',2);grid on title('he first difference');xlabel('frequency(hz)');ylabel('dfs'); %% question c sig = x + 0.02 * randn(size(x)); % add noise to the clean signal sig2 = [0 diff(sig)]; % Calculate DFS S = dtfs(sig,n,k); S2 = dtfs(sig2,n,k); % plot sig figure; subplot(,2,);plot(n,sig,'linewidth',.5); title('ime domain');xlabel('n');ylabel('sig') subplot(,2,2);stem(freq,abs(s),'.','linewidth',.5); title('frequency domain');xlabel('frequency(hz)');ylabel('abs(s)') % plot sig2 figure; subplot(,2,);plot(n,sig2,'linewidth',.5); title('ime domain');xlabel('n');ylabel('sig2') subplot(,2,2);stem(freq,abs(s2),'.','linewidth',.5); title('frequency domain');xlabel('frequency(hz)');ylabel('abs(s2)') %% question e H = - exp(i * 2*pi/000*k); stem(freq,abs(h),'.','linewidth',.5) title('frequency response');xlabel('frequency(hz)');ylabel('abs(h)')

24 Homework 9 Solutions Common Mistakes