Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In MATLAB, take the sine wave given to you named y and compute its (estimated) first derivative using a for loop. Save the result to
In MATLAB, take the sine wave given to you named y and compute its (estimated) first derivative using a for loop. Save the result to a variable named y_prime. After computing y_prime, normalize it so that the maximum value is 1 and the minimum is 1. As a reminder, you can approximate the first derivative by subtracting sample i from sample i+1. This means that y_prime will be 1 sample shorter than y. Note: I recognize there are faster, more efficient, etc. ways to compute the first derivative. The goal is to force practicing a for loop. It's highly encouraged to check your answer against one of these other methods. Feel free to leave the code you used for the check in the assignment you turn in Copy and paste your code as the answer to this question on Gradescope \( \begin{array}{ll}\% \text { Don't delete this! } & \\ \text { fs }=1000.0 ; & \% \text { Hz; sampling rate } \\ \text { n_time }=1 ; & \% \text { Seconds; length of signal } \\ \text { time }=\text { linspace }\left(0, n_{-} t i m e, n_{-} t i m e * f s ight) ; & \% \text { List of seconds; time points of our data } \\ \mathrm{f}=10.0 ; & \% \text { Hz; frequency of sine wave } \\ \mathrm{a}=1.0 ; & \% \text { Amplitude of sine wave (arbitrary unit) } \\ \mathrm{y}=\mathrm{a} * \sin (\mathrm{pi} * 2 * \mathrm{f} * \text { time); } & \% \text { Create our sine wave } \\ \% \text { Problem } 3 \text { answer here } & \end{array} \)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started