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.](http://img.homeworklib.com/questions/c0e89ca0-5395-11eb-8093-63e621741d93.png?x-oss-process=image/resize,w_560)

please code on MATHLAB and show graph thank you in advance! Generate the following function y1(t)=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 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...
Amplitude=3; fs=8000; n=0:399; t=0:1/fs: n*1/fs-1/fs; signal=3+3*cos(2*pi*1100*t)+3*cos(2*pi*2200*t)+3*cos(2*pi*3300*t); fftSignal= fft(signal); fftSignal=f ftshift (fftSignal); f=fs/2*linspace(-1,1,fs); plot(f,abs(fftsignal); xlabel('Frequency(Hz)’) ylabel('amplitude(v)') title('Spectral domain') plz code above using For ..End loop to archive the same results.
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
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. ---------------------------------------------------------------------------- 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(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
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 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,...
Plot the following function on MATLAB h(t) = cos(pi*t/2) -2 <= t < -1 1 + t3 -1 <= t < 0 1 0 <= t < 1 1 + sin(2*pi*t) 1 <= t < 2 0 elsewhere