Part 2 Here\'s the part where we\'re going to animate something. What I\'d like
ID: 1372599 • Letter: P
Question
Part 2 Here's the part where we're going to animate something. What I'd like to show you is what happens to three sine waves as we change the sample frequency, and UNDERSAMPLE it, meaning we sample it at a lower rate than its principle frequency. In the class example, we did 2(t)-0.2 cos(100hrt) + 0.3 sin(700?1+ ?/3) + 2 cos( 1700rrt-?/6) and when we sampled it at with f 400Hz, we showed that even though this signal started off as three separate waves of different frequency added just evaluating the function at f 400Hz, lets leave f a variable and make a new vector of points based on the following equation. it ended up as one wave with only one frequency. Instead of z[nl = 0.2 cs(100?,1+0.3 sin(700?7 +?/3) + 2cos(1700? n-?/6). (1) 2.1 Implement the above equation in MATLAB code and call the variable xWave. Make sure you set f 400 a line above this equation in your code, and leave the variable f in your equation in the code. This will allow us to change what f is and watch how it moves. 2.2 Implement the time domain version of r[n], using a time vector from 0 to 0.0625 seconds, and an interval between the points of le-4 seconds.Explanation / Answer
clc;
clear all;
%2.1
f=400;
n=1:25;
x_n=(.2*cos(100*pi*(n/f)))+(.3*sin((700*pi*(n/f))+(pi/3)))+(2*cos((1700*pi*(n/f))-(pi/6)));
%2.2
t=0:1e-4:.0625;
x_t=(.2*cos(100*pi*t))+(.3*sin((700*pi*t)+(pi/3)))+(2*cos((1700*pi*t)-(pi/6)));
%2.3
figure
subplot(2,1,1)
stem(n,x_n);xlabel('n');title('x[n]');xlim([min(n),max(n)]);grid on
subplot(2,1,2)
plot(t,x_t);xlabel('t');title('x(t)');xlim([min(t),max(t)]);grid on
%2.4
f=3600;
for i=1:9
nmax=max(t)*f;
nmin=min(t)*f;
n=nmin:nmax;
x_n=(.2*cos(100*pi*(n/f)))+(.3*sin((700*pi*(n/f))+(pi/3)))+(2*cos((1700*pi*(n/f))-(pi/6)));
figure
subplot(2,1,1)
stem(n,x_n);xlabel('n');title('x[n] for f= ');xlim([min(n),max(n)]);grid on
subplot(2,1,2)
plot(t,x_t);xlabel('t');title('x(t)');xlim([min(t),max(t)]);grid on
f=f-400
end
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.