Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 3 is provided to help answer problem 4.1 and 4.2 In MATLAB, take the sine wave given to you named y and compute its
Problem 3 is provided to help answer problem 4.1 and 4.2
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 Problem 4.1 In Python, use similar methods and logic in the cell for Problem 3 to create 1 second of a cosine wave with amplitude 1, sampling rate of 1000 Hz, and frequency of 10Hz into a variable called y_cos. Also load in y_prime . Copy and paste your code as the answer to this question on Gradescope Problem 4.2 Once is created, plot ycos and yprime together. Make sure you still plot as the x-axis. Note: ycos will have 1 more sample than y_prime. You can use any method you wish to plot \( y_{\text {_cos }} \) as long as its time is aligned with y_prime. The goal is to visually compare the two signals and not the specific implementation. Save the plot and upload it as the answer to this question on Gradescope \# These should have imported earlier, but we'll call them again here as reminders. import numpy as np import matplotlib.pyplot as plt \# Problem 4 answer here \# Hint: putting np. prefix in front of a MATLAB functionStep 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