Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
ELEC421 Take-home Assignment
digital signal, correlation, z-transform, and LTI. Marking rules: • For textbook-type problems: The brief solution is provided (together with the assignment). However the students are still required to submit the solutions for all textbook-type problems to get full marks. The purpose is to ‘force’ the students to practice on such textbook problems similar to those in later exams. • 20 points for Matlab problems: 20 = 8+12 Submission rules: • For textbook-type problems: Submit the hard copy of your solutions in-class if you like. • For Matlab problems: Submit your solution file through Canvas (with the file name like ‘ELEC421_studentName_ID_HW1.pdf’). Please organize everything in a single .doc or .pdf file for the Matlab part; make sure to attach the codes in the end; and make sure that the results are calculated using Matlab and figures/tables are not drawn by hands. Textbook Problems: 1. Consider the system in Fig. 1 with h(n)=u(n)+0.6nu(n). Determine the response y(n) of the system when having the input x(n)= d(n+3)+u(n)-u(n-2). 2. For the signals x(n)={1, 4, 1} and y(n)={1, 1, 1}, (a) Determine the autocorrelation sequence of the signal x(n); and (a1) determine the normalized autocorrelation sequence of x(n). (b) Determine the autocorrelation sequence of y(n) and the cross-correlation sequence {rxy(l)}. 3. Determine the z-transform of the following signals. (a) x(n) = {1, 3, 5, 3,1} (b) x(n) = 0.5nu(n) + n u(n) (c) x(n) = u(n) – u(n-2) + 0.25nu(n+1) (d) x(n) = (an sin(w0n) )u(n), with |a|<1 h(n) h(n) z-2 z-1 + x(n ) y(n) 4. Determine the signal x(n) from X(z) (a) Determine the signal x(n) for the z-transform X(z) = log(1-z), |z|<1. (b) Determine all possible signals x(n) if its z-transform X(z) = 1/(1-0.4z-1+0.03z-2). (c) For , determine x(n) if x(n) is left sided. 5. Suppose the input x(n)=u(n), consider the system shown below: Write down the difference equation, and compute the response of the system y(n). 6. Compute the response of a system (a) Suppose the input x(n)=u(n-1)+ n u(n), compute the response of the system y(n) = 0.3 y(n-1) – 0.02 y(n-2) + 2 x(n) + x(n-1). (b) When h(n) = 0.5nu(n), and x(n) = u(n) – u(n-2) + cos(pn/3) u(n). (c ) Consider the filter y(n) = 0.6y(n-1) + b x(n). Determine b so that |H(z)|=1 for z=1. Matlab assignments: 2 problems in total 1. (Digital signal) Consider the following analog sinusoidal signal xa(t)=cos(2p f0 t). (a) Sketch (plot) the signal xa(t) for 0≤t≤20 for f0=1, 1.5, and 4 Hz respectively. (b) For the sample rate Fs = 4Hz, plot the digital signal x(n) for 0≤n≤99. Explain the similarities and differences among the various plots (for f0=1, 1.5, and 4 Hz respectively). (c) Suppose that f0 =5Hz and Fs=20Hz. Plot the signal x(n). What is the frequency of the signal x(n)? (d) Same as in (c), let y(n)=x(2n-1), i.e. by taking the even-numbered samples of x(n), is this a sinusoidal signal? Why? If so, what is its frequency? 21 3 )25.01( 3)( - - - = z zzX 2 2. (Correlation analysis of EEG channels) Figure 1. Bulb-squeezing Task EEG data description: During the experiment, subjects were seated 2 m away from a large computer screen. They were asked to squeeze a pressure responsive bulb with their right hand in order to match vertical target bars on the screen that represented 25 % of maximum voluntary contraction (MVC). The task consisted of 7 squeezing trials, where each trial contained 10 seconds of rest period followed by 2 seconds of squeezing (see Figure 1). EEG signals are sampled at 250 Hz. Please download both ‘pdData.mat’ (the EEG data for a subject with Parkinson’s disease) and ‘normalData.mat’ (the EEG data for a normal subject). Each data file contains three variables: • data (number of channels x number of timepoints) • ampVec (1 x number of timepoints); ampVec(t)=1 during squeezing, amp(t)=0 during rest • channel_name (1xnumber of channels) Sub-problems: (a) Plot the second EEG node, plot the data. (b) Separate the data into the rest part and the squeezing part based on the vector ampVec. (c) Based on the EEG data of the ‘rest’ state, calculate the covariance matrix C_r; Based on the EEG data of the ‘squeezing’ state, calculate the covariance matrix C_s. (d) Based on the EEG data of the ‘rest’ state, calculate the matrix R of correlation coefficients, and comment on the dependencies between the EEG nodes. (You can use ‘mesh’ commend to display the matrix R.) Compare the differences between the Pakinson’s disease subject the normal subject (e.g. based on features such as the eigenvalues of R; For each EEG node k, calculate the summation of R(k,j) over j and use such summations as features for comparison) and comment on your results. (e) Repeat (d) for the ‘squeezing’ state.