I NEED ANSWER Q4 NEED I ATTACHED THE QUESTION(COMPUTR ENGINEERING OR ELECTIC ENGINEERING)

3. (a) Use Matlab to generate and plot the discrete-time signal

x[n] = sin(ω0n)

for the following values of ω0: −29π 8 , −3π 8 , −π 8 , π 8, 3π 8 , 5π 8 , 7π 8 , 9π 8 , 13π 8 , 15π 8 , 33π 8 , and 21π 8 .

• Plot each signal for 0 ≤ n ≤ 63. • Label each graph with the frequency. • Use the subplot function to plot four graphs per figure. • Here is some code that will do all of this. You can type it in line-by-line at the command prompt or you can create an m-file. %---------------------------------------------------------% P3a % % plot a bunch of discrete-time sine signals %

% The frequency will be w = k*pi/8. % Load up the k’s into a vector: % kvals = [-29 -3 -1 1 3 5 7 9 13 15 33 21];

% make a counter to index the "next" k to use: next_k = 1;

n = 0:63; % the time variable

% There are 12 k values. We will plot four per % figure. So we will need three figures all % together. Loop on figures.

for Fig_num=1:3 figure(Fig_num); % selects the "current" figure

% each time through this loop, we are going to do % 4 of the k’s. Loop on Sub Figure number:

for SubFig_num = 1:4 k = kvals(next_k); next_k = next_k + 1; w = k * pi/8; % the frequency xn = sin(w*n); subplot(4,1,SubFig_num); stem(n,xn); title(sprintf(’%d%s’,k,’\pi/8’)); end % for SubFig_num end % for Fig_num

(b) Are any of the graphs from part (a) identical to one another? Explain. (c) How are the graphs of x[n] = sin(ω0n) for ω0 = 7π 8 and ω0 = 9π 8 related? Explain.

4. (a) Modify the code from Problem 3 to generate and plot the discrete-time signal

x[n] = cos(ω0n)

for the following values of ω0: −29π 8 , −3π 8 , −π 8 , π 8, 3π 8 , 5π 8 , 7π 8 , 9π 8 , 13π 8 , 15π 8 , 33π 8 , and 21π 8 . • Plot each signal for 0 ≤ n ≤ 63. • Label each graph with the frequency. • Use the subplot function to plot four graphs per figure. (b) Are any of the graphs from part (a) identical to one another? Explain.