Question

In: Electrical Engineering

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)?

Solutions

Expert Solution

Sorry for the inconvenience caused to you. Pls. find below the Matlab program as per the given question:

clc
clear all
close all
%%
fs= 4000; %%(assumed)
Ts= 1/fs;
t=0:Ts:5e-2;
f1=500;
f2=1000;
f3=1500;
y= 5*sin(2*pi*f1*t)+ 5*sin(2*pi*f2*t)+ sin(2*pi*f3*t);
figure(1);
plot(t,y);
title('Input signal');
%% Fourier Transform of original signal
N=length(y);
N1=2.^nextpow2(N);
fy=fft(y,N1);
fy=fy(1:N1/2);
K=(0:N1/2-1)/(N1/fs);
figure(2);
plot(K,abs(fy/max(fy)));
title('Magnitude spectrum of original signal');

%% Downsample by 6
y1= 5*sin(2*pi*f1*t*6)+ 5*sin(2*pi*f2*t*6)+ sin(2*pi*f3*t*6);
figure(3);
plot(1:6:6*length(y1),y1);
title('Downsampled signal by 6');
%% Fourier Transform of Downsampled signal
N=length(y1);
N1=2.^nextpow2(N);
fy=fft(y1,N1);
fy=fy(1:N1/2);
K=(0:N1/2-1)/(N1/fs);
figure(4);
plot(K,abs(fy/max(fy)));
title('Magnitude spectrum of Downsampled signal by 6');
%%
%%Upsampled by 6
y2= 5*sin(2*pi*f1*t/6)+ 5*sin(2*pi*f2*t/6)+ sin(2*pi*f3*t/6);
figure(5);
plot(1:6:6*length(y2),y2);
title('Upsampled signal by 6');
%% Fourier Transform of Upsampled signal
N=length(y2);
N1=2.^nextpow2(N);
fy=fft(y2,N1);
fy=fy(1:N1/2);
K=(0:N1/2-1)/(N1/fs);
figure(6);
plot(K,abs(fy/max(fy)));
title('Magnitude spectrum of Upsampled signal by 6');
%%
%%Interpolation Filter
upsampling = 6;
Ripple = 0.5;
h = intfilt(upsampling,2,Ripple);
b = fir1(40,Ripple);
%%rng('default')
x1 = filter(b,1,y2);
x2 = upsample(x1,upsampling);
y = filter(h,1,x2);
delay = mean(grpdelay(h));
y(1:delay) = [];
stem(1:upsampling:upsampling*length(x1),x1)
hold on
plot(y)
title(' Interpolated signal');


Related Solutions

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)?
Write the matlab command to sample the following signals at nyquist frequency 1.x(t)=3cos(2*pi(400)t +0.3*pi) 2.x(t)=cos^2(300*pi*t)
Write the matlab command to sample the following signals at nyquist frequency 1.x(t)=3cos(2*pi(400)t +0.3*pi) 2.x(t)=cos^2(300*pi*t)
Sketch the curve given by the parametric equation x= tan(t) , y=sec (t) for -pi/2 <...
Sketch the curve given by the parametric equation x= tan(t) , y=sec (t) for -pi/2 < t < pi/2. Eliminate the parameter "t" and find the Cartesian form of this curve. What type of curve is this? What curve would be good if "t" belong to the interval (pi/2, 3pi/2)?
y'' - y = e^(-t) - (2)(t)(e^(-t)) y(0)= 1 y'(0)= 2 Use Laplace Transforms to solve....
y'' - y = e^(-t) - (2)(t)(e^(-t)) y(0)= 1 y'(0)= 2 Use Laplace Transforms to solve. Sketch the solution or use matlab to show the graph.
Solve the initial value problem dy/dx = −(2x cos(x^2))y + 6(x^2)e^(− sin(x^2)) , y(0) = −5...
Solve the initial value problem dy/dx = −(2x cos(x^2))y + 6(x^2)e^(− sin(x^2)) , y(0) = −5 Solve the initial value problem dy/dt = (6t^5/(1 + t^6))y + 7(1 + t^6)^2 , y(1) = 8. Find the general solution of dy/dt = (2/t)*y + 3t^2* cos3t
5. Solve equation y'+2y=2-e^-4t, where y(0)=1 6. Use Euler’s method for a previous problem at t=0,...
5. Solve equation y'+2y=2-e^-4t, where y(0)=1 6. Use Euler’s method for a previous problem at t=0, 0.1, 0.2, 0.3. Compare approximate and the exact values of y.
Suppose that x = [10, -2, 6, 5, -3] and y = [9, -3, 2, 5, -1]. Find the results of the following operations by hand and use MATLAB to check your results.
Suppose that x = [10, -2, 6, 5, -3] and y = [9, -3, 2, 5, -1]. Find the results of the following operations by hand and use MATLAB to check your results.a. z = (x < 6)b. z = (x
Chapter 6, Section 2-HT, Exercise 114 Use the t-distribution and the sample results to complete the...
Chapter 6, Section 2-HT, Exercise 114 Use the t-distribution and the sample results to complete the test of the hypotheses. Use a 5% significance level. Assume the results come from a random sample, and if the sample size is small, assume the underlying distribution is relatively normal. Test H0 : μ=15 vs Ha : μ>15 using the sample results x¯=17.2, s=6.4, with n=40. Your answer is partially correct. Try again. (a) Give the test statistic and the p-value. Round your...
use a matlab built-in function to numerically solve: dy/dx= -x^2+((x^3*e^-y)/4) for 1<=x<=5 with y(1)=1 plot the...
use a matlab built-in function to numerically solve: dy/dx= -x^2+((x^3*e^-y)/4) for 1<=x<=5 with y(1)=1 plot the solution
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT