Question

1. For each of the following choices of r(n) and N, you will perform the five tasks stated below (a) x(n (b) r(n)-2-a(n), Л-1

Task 4: Compute DTFT of y. You may not be able to obtain a closed form expression for the DTFT of y. However since y has fini

1. For each of the following choices of r(n) and N, you will perform the five tasks stated below (a) x(n (b) r(n)-2-a(n), Л-16, (d) x(n) is same as in part (c) with N = 8 otherwise
Task 4: Compute DTFT of y. You may not be able to obtain a closed form expression for the DTFT of y. However since y has finite duration of length N, you can just code the analysis equation in Matlab. Let y(k 1) = y(k) forS k1,... .N. Specifically, since the signal y(n) is 0 outside the interval 0
Comments
    0 0
    Add a comment Improve this question Transcribed image text
    Answer #1

    MATLAB code is given below in bold letters.

    clc;
    clear all;
    close all;

    % Question a
    N = 16;
    n = 0:N-1;
    x = 1./(2.^abs(n));
    % 1000 points for frequency axis
    k = 1:1000;
    w = 2*pi*(k-1)/1000;clear k;
    % initialize DTFTy
    DTFTy = zeros(size(w));
    for k = 1:length(w)
    DTFTy(k) = sum(x.*exp(-1j*w(k)*n));
    end

    figure;plot(w/(pi),DTFTy,'linewidth',2);grid;xlabel('w/pi');ylabel('Amplitude');
    title('Spectrum of x[n]=1/2^|^n^|');

    % Question b
    N = 16;
    n = 0:N-1;
    x = 1./(2.^n);
    % 1000 points for frequency axis
    k = 1:1000;
    w = 2*pi*(k-1)/1000;clear k;
    % initialize DTFTy
    DTFTy2 = zeros(size(w));
    for k = 1:length(w)
    DTFTy2(k) = sum(x.*exp(-1j*w(k)*n));
    end

    figure;plot(w/(pi),DTFTy2,'linewidth',2);grid;xlabel('w/pi');ylabel('Amplitude');
    title('Spectrum of x[n]=1/2^n');

    % Question c
    N = 16;
    n = 0:N-1;
    x = (n+1).*(n<=6) + (13-n).*(n>=7).*(n<=13);
    % 1000 points for frequency axis
    k = 1:1000;
    w = 2*pi*(k-1)/1000;clear k;
    % initialize DTFTy
    DTFTy3 = zeros(size(w));
    for k = 1:length(w)
    DTFTy3(k) = sum(x.*exp(-1j*w(k)*n));
    end

    figure;plot(w/(pi),DTFTy3,'linewidth',2);grid;xlabel('w/pi');ylabel('Amplitude');
    title('Spectrum of x_3[n]');


    % Question d
    N = 8;
    n = 0:N-1;
    x = (n+1).*(n<=6) + (13-n).*(n>=7).*(n<=13);
    % 1000 points for frequency axis
    k = 1:1000;
    w = 2*pi*(k-1)/1000;clear k;
    % initialize DTFTy
    DTFTy4 = zeros(size(w));
    for k = 1:length(w)
    DTFTy4(k) = sum(x.*exp(-1j*w(k)*n));
    end

    figure;plot(w/(pi),DTFTy4,'linewidth',2);grid;xlabel('w/pi');ylabel('Amplitude');
    title('Spectrum of x_4[n]');

    Spectrum of x[n]-1/2 nl 2 1.8 1.6 1.4 1.2 0.8 0.6 0 0.2 0.40.6 0.8 1 1.2 1.4 16 1.8 2 w/piSpectrum of x[n]-1/2 2 1.8 1.6 1.4 0.8 0.6 0 0.2 0.40.6 0.8 1 1.2 1.4 16 1.8 2 w/piSpectrum of xzln] 50 40 30 ) 20 T 10 0 -10 -20 0 0.2 0.40.6 0.8 1 1.2 1.4 16 1.8 2 wlpiSpectrum of x4In] 40 30 20 10 0 -10 -20 0 0.2 0.40.6 0.8 1 1.2 1.4 16 1.8 2 w/pi

    Add a comment
    Know the answer?
    Add Answer to:
    1. For each of the following choices of r(n) and N, you will perform the five tasks stated below ...
    Your Answer:

    Post as a guest

    Your Name:

    What's your source?

    Earn Coins

    Coins can be redeemed for fabulous gifts.

    Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
    Similar Homework Help Questions
    ADVERTISEMENT
    Free Homework Help App
    Download From Google Play
    Scan Your Homework
    to Get Instant Free Answers
    Need Online Homework Help?
    Ask a Question
    Get Answers For Free
    Most questions answered within 3 hours.
    ADVERTISEMENT
    ADVERTISEMENT
    ADVERTISEMENT