Question

In: Electrical Engineering

Consider the finite duration signal x(n) = (0.9)ncos(0.1πn) for 0 ≤ n ≤ 31. Using MATLAB:...

Consider the finite duration signal x(n) = (0.9)ncos(0.1πn) for 0 ≤ n ≤ 31. Using MATLAB:

a.) Plot the signal

b.) Plot the real part of the DFT of x(n), the imaginary part of the DFT of x(n) and the DCT of x(n). All transforms are length N = 32.

Solutions

Expert Solution

%code

clc;
clear all;
for n = 1:32
x(n) = 0.9*(n-1)*cos(0.1*pi*(n-1));
end

%code for part a)

figure()
plot(x);xlabel('time');ylabel('amplitude');title('Input signal');

%code for part b)


figure()
plot(real(fft(x,32)));xlabel('frequency');ylabel('amplitude');title('Real part of fft of the signal');
figure()
plot(imag(fft(x,32)));xlabel('frequency');ylabel('amplitude');title('Imaginary part of fft of the signal');
figure()
plot(dct(x,32));xlabel('frequency');ylabel('amplitude');title('DCT of the signal');


Related Solutions

Signals and systems Consider the following discrete signal x[n] = sin(π n/32) (u[n]-u[n-33]) a) Using MATLAB...
Signals and systems Consider the following discrete signal x[n] = sin(π n/32) (u[n]-u[n-33]) a) Using MATLAB only, Find the DFT using FFT algorithm, b) Plot the signal x[n], spectrum |X(ω)|^2 , and phase of X(ω). Hint: use L=512 for FFT.
By using MATLAB 1. Divide a speech signal or music signal into frames of size N...
By using MATLAB 1. Divide a speech signal or music signal into frames of size N = 64. 2. Compute the N?point DFT of each frame. 3. Save only first L = 20 DFT coefficients. 4. Reconstruct the frame from these L coefficients. (Do not disturb the symmetry of DFT during inverse DFT computation. X[k] = X[N ?k] for real signals, N = 64 here. Pad zeros for missing DFT coefficients.) 5. Comment on the quality of reconstructed and the...
Consider a discrete-time periodic signal x [ n ]   =   cos ( 0 . 7 πn ) (1)...
Consider a discrete-time periodic signal x [ n ]   =   cos ( 0 . 7 πn ) (1) Determine the fundamental period of x[n]. (2) Suppose x[n] is obtained by sampling the continuous-time signal  x ( t )   =   cos   ( πt ), by letting the sampling period to be T s =   0 . 7 and considering the sample values at each n. Is the Nyquist sampling conditions satisfied in this case? Explain and relate this to the answer given before. (3) Under that conditions would...
Q1. Interpolationv (MATLAB PROGRAM ) : Suppose that x = 0:10;? y = [1.5, 1.0, 0.9,...
Q1. Interpolationv (MATLAB PROGRAM ) : Suppose that x = 0:10;? y = [1.5, 1.0, 0.9, 2.6, 2.2, 0.03];? a)Use both linear interpolation and cubic spline interpolation function to determine the value of y when x= 3.5 b) Plot both functions y and the interpolated version of y. PLEASE SOLVE THE QUESTION USING MATLAB PROGRAM .
USING MATLAB In signal processing applications, the Hankel matrix is useful. The elements of a (N...
USING MATLAB In signal processing applications, the Hankel matrix is useful. The elements of a (N × N) Hankel matrix are given by h?? =0   ?+?−1>? =?+?−1 otherwise Write a script that takes as input from the user an integer, n. Your code should accept input ≥1 and <10. The user should be repeatedly prompted until acceptable input is entered. Next, create n Hankel matrices for N=1,2,...,n. That is, if the user enters 4, you’ll generate 1×1, 2×2, 3×3, and...
using matlab, compute and plot y [n] = x [n]* h [n], where a. x [n]...
using matlab, compute and plot y [n] = x [n]* h [n], where a. x [n] = h [n] = a^n (0 <=n <=40) & a = 0.5 b. x [n] = cos [n]; h [n] = u [n]; n = 0:4:360 c. x [n] = sin [n] ; h [n] = a^n; n:4:360; a = 0.9
Make a code in matlab to know the determinant of a matrix n x n, using...
Make a code in matlab to know the determinant of a matrix n x n, using the sarrus rule.
Solve this differential equation using Matlab yy' + xy2 =x , with y(0)=5 for x=0 to...
Solve this differential equation using Matlab yy' + xy2 =x , with y(0)=5 for x=0 to 2.5 with a step size 0.25 (a) Analytical (b) Euler (c) Heun d) 4th order R-K method Display all results on the same graph
Use and provide Matlab for the following: Generate the discrete-time signal x[n] = 4 cos (2pi....
Use and provide Matlab for the following: Generate the discrete-time signal x[n] = 4 cos (2pi. 10. nT5) + 2cos(2pi. 100. nT5) + 3cos(2pi 200. nT's), with Ts0.001 sec. Display the signal in both time and frequency-domain. Assume that the 100 Hz component of x [n] is your desired signal while the other two components are noise. Design a suitable filter to extract the desired (i.e. 100 Hz) signal. Display the filter's response. Display the output signal in the frequency-domain....
4. For a signal x(n)=sin(2*pi*n/3) defined for n=0to7, evaluate the Fast Fourier Transform using signal flow...
4. For a signal x(n)=sin(2*pi*n/3) defined for n=0to7, evaluate the Fast Fourier Transform using signal flow graph. (Use decimation in frequency Algorithm)     
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT