Question

Using matlab. Consider the function s(t) defined for t in [0,4) by { -sin(pi*t/2)+1 , for...

Using matlab.

Consider the function s(t) defined for t in [0,4) by

{ -sin(pi*t/2)+1 , for t in [0,1)
s(t) = { -(t-2)^5 , for t in [1,3)
{ sin(pi*t/2)-1 , for t in [3,4)

(i) Generate a column vector s consisting of 512 uniform
samples of this function over the interval [0,4). (This
is best done by concatenating three vectors.)

Homework Answers

Answer #1

MATLAB code is given below in bold letters.

clc;
close all;
clear all;

% define time t
t = 0:0.01:4;

% now define the signal using logical expressions as below (concatenation is not required)
s = (-sin(pi*t/2)+1).*(t<=1) + (-(t-2).^5).*((t>1)&(t<=3)) ...
+ (sin(pi*t/2)-1).*((t>3)&(t<=4));

% now plot the signal as below
figure;
plot(t,s,'linewidth',2);grid on;xlabel('time');ylabel('Amplitude');title('s(t)');

Know the answer?
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
Similar Questions
Let h be the function defined by H(x)= integral pi/4 to x (sin^2(t))dt. Which of the...
Let h be the function defined by H(x)= integral pi/4 to x (sin^2(t))dt. Which of the following is an equation for the line tangent to the graph of h at the point where x= pi/4. The function is given by H(x)= integral 1.1 to x (2+ 2ln( ln(t) ) - ( ln(t) )^2)dt for (1.1 < or = x < or = 7). On what intervals, if any, is h increasing? What is a left Riemann sum approximation of integral...
Assignments Generate and plot the signal x1(t) = 1+ sin (4pt), for t ranging from -1...
Assignments Generate and plot the signal x1(t) = 1+ sin (4pt), for t ranging from -1 to 1 in 0.001 increments. Use proper axes labels with title. Generate and plot the function x2(t) = sin (30pt), for t ranging from -1 to 1 in 0.001 increments. Use proper axes labels with title. Generate and plot the combination function x3(t) = x1(t)*x2(t) as above. Use proper axes labels with title. Generate and plot the sum of two cosine waves   v1(t) =...
All these to be done in MATLAB: 1.1)Define a column vector, called “b” in MATLAB that...
All these to be done in MATLAB: 1.1)Define a column vector, called “b” in MATLAB that stored floating point numbers between 0.6 to 2.5 in increment of 0.2. 1.2)What is the size of vector b? How is the size of ‘b’ stored? Define number of rows of ‘b’ in variable ’row’ and number of columns of “b” in variable “col”. 1.3)Define matrix “A” as a 10 by 10 matrix of all “1”s. 1.4)Update matrix “A” as following: set all the...
Given the function f(t) = 1/2cos (pi/3 *t) +3pi^2. Which of the following is equal to...
Given the function f(t) = 1/2cos (pi/3 *t) +3pi^2. Which of the following is equal to f'(t) f'(t) = 1/2sin(pi/3 t) +6pi f'(t) = -pi/3cos(pi/3 *t) f'(t) = -pi/6 sin(pi/3 T) f'(t) = pi/3 sin(pi/3 t) +6pit
Consider the following vector function. r(t) = <9t,1/2(t)2,t2> (a) Find the unit tangent and unit normal...
Consider the following vector function. r(t) = <9t,1/2(t)2,t2> (a) Find the unit tangent and unit normal vectors T(t) and N(t). (b) Use this formula to find the curvature. κ(t) =
SIGNALS AND SYSTEMS Experiment 1    Signal Generation Date: January 1-8, 2018 The purpose of this...
SIGNALS AND SYSTEMS Experiment 1    Signal Generation Date: January 1-8, 2018 The purpose of this laboratory is to familiarize you with the basic commands in MATLAB for signal generation and verify the generated signal. Objectives 1.Learn basic MATLAB commands and syntax, including help system. 2.Use MATLAB ( from Citrix) to generate and plot different signals. Assignments Generate and plot the signal x1(t) = 1+ sin (4pt), for t ranging from -1 to 1 in 0.001 increments. Use proper axes...
Consider the wave function at t = 0, ψ(x, 0) = C sin(3πx/2) cos(πx/2) on the...
Consider the wave function at t = 0, ψ(x, 0) = C sin(3πx/2) cos(πx/2) on the interval 0 ≤ x ≤ 1. (1) What is the normalization constant, C? (2) Express ψ(x,0) as a linear combination of the eigenstates of the infinite square well on the interval, 0 < x < 1. (You will only need two terms.) (3) The energies of the eigenstates are En = h̄2π2n2/(2m) for a = 1. What is ψ(x, t)? (4) Compute the expectation...
Question : Design the low and high pass filter for the signal, x(t) = 10 sin...
Question : Design the low and high pass filter for the signal, x(t) = 10 sin (10 t) + 1 sin (1000 t) by MATLAB Is below answer right? at ?High pass , 5row shouldn't this change from sin(100*t) ? sin(1000*t) x = 10*sin(10*t) + 1*sin(100*t); ?   x = 10*sin(10*t) + 1*sin(1000*t); ??? ..................................................................................................................................................... ?Low pass clc; rng default Fs=2000; t=linspace(0,1,Fs); x=10*sin(10*t)+sin(1000*t)%given signal n=0.5*randn(size(t));%noise x1=x+n; fc=150; Wn=(2/Fs)*fc; b=fir1(20,Wn,'low',kaiser(21,3)); %fvtool(b,1,’Fs’,Fs) y=filter(b,1,x1); plot(t,x1,t,y) xlim([0 0.1]) xlabel('Time (s) ') ylabel('Amplitude') legend('Original Signal','Filtered Data')...
2. Write the output matrix “v” t = [2:4]; k = [1:3]; v = t.*k –...
2. Write the output matrix “v” t = [2:4]; k = [1:3]; v = t.*k – k.^2 4. Given: D = [1 2 3 4 5 6 7 8 9] (3x3) . Which command will extract the submatrix [1 2 3 4 5 6] (2x3) ? a. D[1:2,1:3] b. D(1,2 ;1,3) c. [D(1:2),D(1:3)] d. D(1:2,1:3) 14. What will be the dimension of matrix B? B=[ones(3) zeros(3) rand(3); 2*eye(9)] 18. Find the value of “C” A=1:2:10; B=linspace(1,5,5); C = length(A)*B(2)+A(5)*B(3); 19....
PLEASE USE MAT LAB ONLY. THANK YOU (a) Create and plot the signals listed below and...
PLEASE USE MAT LAB ONLY. THANK YOU (a) Create and plot the signals listed below and save your Matlab code in a script file. i) Cosine signal of frequency 100 Hz over the range [0,0.1] seconds and samples spaced 10^- 4 seconds apart with a phase of pi/2 and an amplitude of 1.   PLEASE USE MAT LAB ONLY. THANK YOU ii) A square wave that oscillates between 0 and 1 every five samples, plot 3 periods of the waveform. iii)...