Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help me!!! import numpy as np import matplotlib.pyplot as plt def plot_waveform(x, sample_rate): TODO: IMPLEMENT ME Plot the time domain signal `x`. This is
Help me!!!
import numpy as np import matplotlib.pyplot as plt def plot_waveform(x, sample_rate): """ TODO: IMPLEMENT ME Plot the time domain signal `x`. This is be a time-amplitude plot, in which the x-axis is labeled in seconds based on the `sample_rate` argument. NOTE: Do not call `plt.show()` within the function. Args: x (np.array): the 1-dimensional time domain audio signal. sample_rate (float): the sample rate in Hz. Returns: None """ plt.gca() # replace the following line with an actual implementation that returns something raise NotImplementedError() def plot_spectrum(X, sample_rate): """ TODO: IMPLEMENT ME Plot the magnitude spectrum of X. The x-axis should be frequency in Hz. The y-axis is magnitude in decibels. Feel free to limit the y-axis (i.e. clip off very low magnitudes) Only display frequencies up to and including the Nyquist frequency. NOTE: Do not call `plt.show()` within the function. Args: X (np.array[complex]): A frequency domain signal X, e.g. `X = dft(x)` sample_rate (float): sample rate in Hz Returns: None """ plt.gca() # replace the following line with an actual implementation that returns something raise NotImplementedError()
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