Question

In: Electrical Engineering

given the sequences x1 = cos (0.5*pi*n) + cos (0.25*pi*n) + cos (0.125*pi*n); for n =...

given the sequences
x1 = cos (0.5*pi*n) + cos (0.25*pi*n) + cos (0.125*pi*n); for n = 0 to 7;
x2 = sin (0.5*pi*n) - cos (o.25*pi*n) + sin (0.125*pi*n); for n = 0 to 7;
plot the sequences and comment on the results. increasing the number of samples to n = 0 to 99, compute the DFT of the two sequences in MATLAB and plot the magnitude and phase of the computed DFTs. comment on the results

Solutions

Expert Solution

MATLAB CODE:

clc
clear all
close all

n = 0:7;
x1 = cos(0.5.*pi.*n)+cos(0.25.*pi.*n)+cos(0.125.*pi.*n);
x2 = sin(0.5.*pi.*n)-cos(0.25.*pi.*n)+sin(0.125.*pi.*n);

subplot(2,1,1)
stem(n,x1)
xlabel('n')
ylabel('x1')
title('x1')

subplot(2,1,2)
stem(n,x2)
xlabel('n')
ylabel('x2')
title('x2')

OUTPUT:

COMPUTING 'DFT' USING MATLAB:

clc
clear all
close all

n = 0:99;
x1 = cos(0.5.*pi.*n)+cos(0.25.*pi.*n)+cos(0.125.*pi.*n);
x2 = sin(0.5.*pi.*n)-cos(0.25.*pi.*n)+sin(0.125.*pi.*n);

y1 = fft(x1); % computing DFT of x1
y2 = fft(x2); % computing DFT of x1

%Magnitudes of y1 and y2
mag1 = sqrt(real(y1).^2+imag(y1).^2);
mag2 = sqrt(real(y2).^2+imag(y2).^2);

%Phases of y1 and y2
phase1 = atan(imag(y1)./real(y1));
phase2 = atan(imag(y2)./real(y2));

subplot(2,2,1)
stem(n,mag1)
xlabel('n')
ylabel('mag1')
title('Magnitude of y1')


subplot(2,2,2)
stem(n,phase1)
xlabel('n')
ylabel('phase1')
title('Phase of y1')

subplot(2,2,3)
stem(n,mag2)
xlabel('n')
ylabel('mag2')
title('Magnitude of y2')


subplot(2,2,4)
stem(n,phase2)
xlabel('n')
ylabel('phase2')
title('Phase of y2')

MAGNITUDE AND PHASE PLOTS:


Related Solutions

For the given function f(x) = cos(x), let x0 = 0, x1 = 0.25, and x2...
For the given function f(x) = cos(x), let x0 = 0, x1 = 0.25, and x2 = 0.5. Construct interpolation polynomials of degree at most one and at most two to approximate f(0.15)
A mechanical wave is given by the equation: y(x,t) = 0.5 cos (62.8x – 15.7t) ,...
A mechanical wave is given by the equation: y(x,t) = 0.5 cos (62.8x – 15.7t) , Find: (1) Amplitude, frequency, wavelength? (2) The velocity of the wave? (3) The maximum velocity of the vibrations? (4) Write down the equation in the opposite direction?
use matlab y(t)=10*(cos(2*pi*500*t)+cos(2*pi*1000*t)+ cos(2*pi*1500*t)). e) Down sample y(t) by a factor of 6. Sketch the Fourier...
use matlab y(t)=10*(cos(2*pi*500*t)+cos(2*pi*1000*t)+ cos(2*pi*1500*t)). e) Down sample y(t) by a factor of 6. Sketch the Fourier transform with appropriate frequency axis. Check if all frequency components are correct? Up-sample the time-domain signal obtained in e) by a factor of 6. Use appropriate filter for interpolation. Sketch the Fourier transform of the up-sampled and filtered signal. Does the resulting signal show all frequency components of the original signal y(t)?
use matlab y(t)=10*(cos(2*pi*500*t)+cos(2*pi*1000*t)+ cos(2*pi*1500*t)). e) Down sample y(t) by a factor of 6. Sketch the Fourier...
use matlab y(t)=10*(cos(2*pi*500*t)+cos(2*pi*1000*t)+ cos(2*pi*1500*t)). e) Down sample y(t) by a factor of 6. Sketch the Fourier transform with appropriate frequency axis. Check if all frequency components are correct? Up-sample the time-domain signal obtained in e) by a factor of 6. Use appropriate filter for interpolation. Sketch the Fourier transform of the up-sampled and filtered signal. Does the resulting signal show all frequency components of the original signal y(t)?
Suppose that a consumer has a utility function U(x1,x2) = x1 ^0.5 x2^0.5 . Initial prices...
Suppose that a consumer has a utility function U(x1,x2) = x1 ^0.5 x2^0.5 . Initial prices are p1 =1and p2 =1,andincomeism=100. Now, the price of good1 increases to 2. (a) On the graph, please show initial choice (in black), new choice (in blue), compensating variation (in green) and equivalent variation (in red). (b) What is amount of the compensating variation? How to interpret it? (c) What is amount of the equivalent variation? How to interpret it?
given the sequences  x1 = [2, 6, -4, 1] x2 = [8, 0, 2, 0, -9,...
given the sequences  x1 = [2, 6, -4, 1] x2 = [8, 0, 2, 0, -9, 0, 1, 0] x3 = [2, 0, -8, -8, 2] x4 = [0, 1, 5i, 0, 6i, 0] x5 = [9, 3, 7] plot the 1. DFT magnitude of the computed sequences in MATLAB  2. phase responses in degrees and radians against frequency and number of samples 3. comment on the plots
Find the p-value of the test. A) Less than 0.25% B) Between 0.25% and 0.5% C)...
Find the p-value of the test. A) Less than 0.25% B) Between 0.25% and 0.5% C) Between 0.5% and 1% D) Between 1% and 2.5% E) Between 2.5% and 5% F) Between 5% and 10% G) Between 10% and 15% H) Between 15% and 20% I) Between 15% and 20% J) Bigger than 20%. Are births really evenly distributed across the days of a week? Here are data on 700 births in a hospital: Day Sun. Mon. Tue. Wed. Thu....
You are given 2 sorted sequences of log(n) and n-1 keys. We would like to merge...
You are given 2 sorted sequences of log(n) and n-1 keys. We would like to merge those 2 sorted sequences by performing o(n) comparisons.[Note that we are interested in the comparisons and not the running time.] Show how this can be done or argue how this cannot be done. In class we show that ordinary merging would require no more than lg(n)+n-1+1 = n+lg(n) comparisons.
Find the 10-point DFT sequence of the x [n] sequence given below. ?[?] = cos (...
Find the 10-point DFT sequence of the x [n] sequence given below. ?[?] = cos ( 3??/ 5 ) . sin( 4??/ 5 )
Consider the following hypotheses. Upper H0​: p≤0.25 Upper H1​: p>0.25 Given that p=0.3​, n=110​, and α=0.05...
Consider the following hypotheses. Upper H0​: p≤0.25 Upper H1​: p>0.25 Given that p=0.3​, n=110​, and α=0.05 answer the following questions. a. What conclusion should be​ drawn? b. Determine the​ p-value for this test.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT