MG_17 (generate a sinusoidal signal) Generate a sinusoid Write a script to generate a sinusoidal signal y and a vector containing the corresponding time values t using the following variables: • A amplitude of the sine function •w. frequency of the sine function phi phase of the sine function . T interval between time samples •n. number of time samples These variables have already been defined for you in the solution template. Follow the steps below to complete the script A. Start by calculating the final time sample value and assign the result to the variable tf That is, what will the final time value be if you want a vector of n time beginning at 0 and separated by a spacing of T? 2 Use the colon operator () to create row vector of n time samples trom e to tf spaced by T, and assign the result to the variable t. 3 Use t and the sin function to create the corresponding row vector of n sine function values evaluated at the fime values in t, where the amplitude, frequency, a the sine wave are given by the vanables above. Assign the result to the variable y

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
label(S15,Tontsize, 20,
MG 17 (generate a sinusoidal signal)
Generate a sinusoid
Write a script to generate a sinusoidal signal y and a vector containing the corresponding time values t using the following variables:
. A. amplitude of the sine function
• w. frequency of the sine function
- phi phase of the sine function
• T interval between time samples
•n. number of time samples
These variables have already been defined for you in the solution template. Folow the steps below to complete the script
N Start by calculating the tinal time sample value and assign the result to the variable tf That is, what will the final time value be if you want a vector of n time samples
beginning at 0 and separated by a spacing of T?
2/ Use the colon operator (Gy to create row vector of n time samples trom e to tf spaced by T. and assign the result to the variable t.
3. Use t and the sin function to create the corresponding row vector of n sine function values evaluated at the time values in t, where the amplitude, frequency, and phase of
the sine wave are given by the variables above. Assign the result to the variable y
Code to plot the sinusoid has been provided at the end of the script Test your solution by using the Run Code button, if the results seem reasonable, submit your solution for
assessment
NOTE: The sin function tetums the sine of the argument in radians
Script e
H Save
C Reset
O MATLAB Documentation
1A- 2: X Aaplitude
2w-3; X Frequency
phi - 0.e1; X Phase
AT-0.02; Time step
sn-100: X Number of signal points
6 A-2;
7w-3;
s phi- 0.01:
9T-0.02;
10 n-100:
11
12 tf-2:
13 t-0:T:tf;
14y- A sin(2 ph1.t):
as
15
stem(t.y)
label(ssTontsize20, Interpreter,"latex")
ylabel('sys,Fontsire, 20, Lnterpreter latex")
SUND- A-T
rei
enb
Transcribed Image Text:label(S15,Tontsize, 20, MG 17 (generate a sinusoidal signal) Generate a sinusoid Write a script to generate a sinusoidal signal y and a vector containing the corresponding time values t using the following variables: . A. amplitude of the sine function • w. frequency of the sine function - phi phase of the sine function • T interval between time samples •n. number of time samples These variables have already been defined for you in the solution template. Folow the steps below to complete the script N Start by calculating the tinal time sample value and assign the result to the variable tf That is, what will the final time value be if you want a vector of n time samples beginning at 0 and separated by a spacing of T? 2/ Use the colon operator (Gy to create row vector of n time samples trom e to tf spaced by T. and assign the result to the variable t. 3. Use t and the sin function to create the corresponding row vector of n sine function values evaluated at the time values in t, where the amplitude, frequency, and phase of the sine wave are given by the variables above. Assign the result to the variable y Code to plot the sinusoid has been provided at the end of the script Test your solution by using the Run Code button, if the results seem reasonable, submit your solution for assessment NOTE: The sin function tetums the sine of the argument in radians Script e H Save C Reset O MATLAB Documentation 1A- 2: X Aaplitude 2w-3; X Frequency phi - 0.e1; X Phase AT-0.02; Time step sn-100: X Number of signal points 6 A-2; 7w-3; s phi- 0.01: 9T-0.02; 10 n-100: 11 12 tf-2: 13 t-0:T:tf; 14y- A sin(2 ph1.t): as 15 stem(t.y) label(ssTontsize20, Interpreter,"latex") ylabel('sys,Fontsire, 20, Lnterpreter latex") SUND- A-T rei enb
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education