Question

please code on MATHLAB and show graph thank you in advance!

Fourier transform Generate the following function yl (t) 2 sin(2*pi*1*t +4*sin(2*pi*2*t0+3*sin(2*pi*4*) y2(t) 2 cos(2*pi*1*t+4*cos (2*pi*2*tt +3*cos 2 pi*4*t) First, required by sampling theorem, the step size of t (delta t has to be smaller than a value. Figure out this value and set the delta t at least 3 times smaller than this value and calculated yl(t) and y20). Increase the step size (delta t and recalculate yl() and y2(t). See the difference. Calculate Fourier Transform of yl(t and y20t using fft and plot your results. Using frequency as the x axis data and amplitude as the y axis data. Also, plot the phase, too. f[0:1Mength(yl): 1/2] (1/ delta t) ama 1 fft(yl) figure: plot (f abs(am101:length(f)), Use function of abs to calculate the amplitude and angle to calculate phase.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

/x f0i [ht 은 D·k State cap?talォ.leota: nt)! pysten, out , print (AX。)x thi capital. 3 fapu next Rne

Add a comment
Know the answer?
Add Answer to:
please code on MATHLAB and show graph thank you in advance! Generate the following function y1(t)=2*...
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
  • Can you please help me answer Task 2.b? Please show all work. fs=44100; no_pts=8192; t=([0:no_pts-1]')/fs; y1=sin(2...

    Can you please help me answer Task 2.b? Please show all work. fs=44100; no_pts=8192; t=([0:no_pts-1]')/fs; y1=sin(2*pi*1000*t); figure; plot(t,y1); xlabel('t (second)') ylabel('y(t)') axis([0,.004,-1.2,1.2]) % constrain axis so you can actually see the wave sound(y1,fs); % play sound using windows driver. %% % Check the frequency domain signal. fr is the frequency vector and f1 is the magnitude of F{y1}. fr=([0:no_pts-1]')/no_pts*fs; %in Hz fr=fr(1:no_pts/2); % single-sided spectrum f1=abs(fft(y1)); % compute fft f1=f1(1:no_pts/2)/fs; %% % F is the continuous time Fourier. (See derivation...

  • You are given a finite step function xt=-1  0<t<4 1  4<t<8.           Hand calculate the FS coefficients of...

    You are given a finite step function xt=-1  0<t<4 1  4<t<8.           Hand calculate the FS coefficients of x(t) by assuming half- range expansion, for each case below. Modify the code below to approximate x(t) by cosine series only (This is even-half range expansion). Modify the below code and plot the approximation showing its steps changing by included number of FS terms in the approximation. Modify the code below to approximate x(t) by sine series only (This is odd-half range expansion).. Modify...

  • Please answer "b" only. %Example code function plotFS(m); %m = user provided number of terms desired in the Fou...

    Please answer "b" only. %Example code function plotFS(m); %m = user provided number of terms desired in the Fourier series; %this code computes the Fourier series of the function %f(x)=0, for -pi<= x <0, % =cos(x) for 0<= x <pi %generate the interval from -pi to pi with step size h; h = pi/100; xx1=[-pi:h:0]; xx2=[0:h:pi]; xx = [xx1, xx2]; %generate the given function f so that it can be graphed ff = [zeros(size(xx1)), cos(xx2)]; %compute the first partial sum...

  • MATLAB code starts here --------- clear T0=2; w0=2*pi/T0; f0=1/T0; Tmax=4; Nmax=15; %--- i=1; for t=-Tmax: .01:Tmax...

    MATLAB code starts here --------- clear T0=2; w0=2*pi/T0; f0=1/T0; Tmax=4; Nmax=15; %--- i=1; for t=-Tmax: .01:Tmax T(i)=t; if t>=(T0/2) while (t>T0/2) t=t-T0; end elseif t<=-(T0/2) while (t<=-T0/2) t=t+T0; end end if abs(t)<=(T0/4) y(i)=1; else y(i)=0; end i=i+1; end plot(T,y),grid, xlabel('Time (sec)'); title('y(t) square wave'); shg disp('Hit return..'); pause %--- a0=1/2; F(1)=0; %dc freq C(1)=a0; for n=1:Nmax a(n)=(2/(n*pi))*sin((n*pi)/2); b(n)=0; C(n+1)=sqrt(a(n)^2+b(n)^2); F(n+1)=n*f0; end stem(F,abs,(C)), grid, title(['Line Spectrum: Harmonics = ' num2str(Nmax)]); xlabel('Freq(Hz)'), ylabel('Cn'), shg disp('Hit return...'); pause %--- yest=a0*ones(1,length(T)); for n=1:Nmax yest=yest+a(n)*cos(2*n*pi*T/T0)+b(n)*sin(2*n*pi*T/T0);...

  • MATLAB code for a double pendulum. Please explain each lines for these codes pls. -------------------------------------...

    MATLAB code for a double pendulum. Please explain each lines for these codes pls. ---------------------------------------------------------------------------- clc close all clear all %---------Parameters------------------------------------------------------ L1=1; L2=1 ; M_1=2 ; M_2=1; G=9.8; %---------initial condition----------------------------------------------- tspan=30; theta1=3; theta1_prime=0; theta2=2.5; theta2_prime=0; y0=[theta1 theta1_prime theta2 theta2_prime]; [t,y]=ode45(@pend, [0 ,tspan],[ 3 0 2 0]); %---position of mass 1 and mass 2---------------------------------------- x1=L1*sin(y(:,1)); y1=-L1*cos(y(:,1)); x2=L1*sin(y(:,1))+l2*sin(y(:,3)); y2=-L1*cos(y(:,1))-l2*cos(y(:,3)); %------visualizing the result--------------------------------------------- figure(1) plot(x1,y1,'linewidth',2) hold on plot(x2,y2,'r','linewidth',2) h=gca; get(h,'fontSize') set(h,'fontSize',14) xlabel('X','fontSize',14); ylabel('Y','fontSize',14); title('Chaotic Double Pendulum','fontsize',14) fh = figure(1); set(fh, 'color', 'white'); figure(2)...

  • Exercises: u used to the instructor b the end of next lab. 20 102 Plot the f(t)-sinc(20r) cos(300...

    Exercises: u used to the instructor b the end of next lab. 20 102 Plot the f(t)-sinc(20r) cos(300t)sinc (10t) cos(100t) Use the fast Fourier transform to find the magnitude and phase spectrum of the signal and plot over an appropriate range. Use appropriate values for the time interval and the sampling interval. Note that in Matlab sinc(x)-, so we need to divide the argument by n to make it match the given function. Le, sinc(20t/pi) Hint: Use the parameters from...

  • SOLVE USING MATLAB ONLY AND SHOW FULL CODE. PLEASE TO SHOW TEXT BOOK SOLUTION. SOLVE PART D ONLY

    SOLVE USING MATLAB ONLY AND SHOW FULL CODE. PLEASE TO SHOW TEXT BOOK SOLUTION. SOLVE PART D ONLY Apply Euler's Method with step sizes h # 0.1 and h 0.01 to the initial value problems in Exercise 1. Plot the approximate solutions and the correct solution on [O, 1], and find the global truncation error at t-1. Is the reduction in error for h -0.01 consistent with the order of Euler's Method? REFERENCE: Apply the Euler's Method with step size...

  • solve using scilab show codes Task 1 Generate a time vector (series) “t' which contains the...

    solve using scilab show codes Task 1 Generate a time vector (series) “t' which contains the number 0 to 9. i.e 0 st 10 with a step size of 1 Repeat the experiment with a step size of 0.01. (1.5 marks) 57%, 13:23 Task 2.2 Let X(t) = A sin(217ft) where A= Amplitude Frequency E-Time a) Create the signals X (t) = A, sin(26ft) and X (t) = A, sin(271f_t) where A, = 2, A, = 4, f = 20,...

  • PLEASE USE MATLAB this problem you are trying to find an approximation to the periodic function /(t) esint-1) over one period, o <t < 2π. In t-linspace(0,2*pi,200)' and let b be a column ve...

    PLEASE USE MATLAB this problem you are trying to find an approximation to the periodic function /(t) esint-1) over one period, o <t < 2π. In t-linspace(0,2*pi,200)' and let b be a column vector of evaluations of f at those points. (a) Find the coefficients of the least squares fit In MATLAB, let (b) Find the coefficients of the least squares fit f(t)ndy+d2 cos(t)+ d, sin(t)+d, cos(2t)+dy sin(2t). (c) Plot the original function f(t)and the two approximations from (a) and...

  • Problem 04: A voltage source is expressed by the following Fourier series: v(t) = -2 +...

    Problem 04: A voltage source is expressed by the following Fourier series: v(t) = -2 + 5* sin(t) – 5*cos(t) – 3* sin(2*t) + 4*cos(2*t) – sin(3*t) – 6*cos(3*t) + 4*sin(4*t) + 6*cos(4*t). Now, (a) Express v(t) in amplitude-phase form. (b) Draw the amplitude and phase spectra of v(t) (c) Determine the effective value (rms value) of the voltage v(t) (d) If the voltage is applied across an impedance block as shown in the circuit below, determine the average power...

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