Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The audio signal is a vector in R 1 0 0 0 . You will convert it into the coordinate system given by the DCT
The audio signal is a vector in You will convert it into the coordinate system given by the DCT basis. In
this coordinate system, each basis element corresponds to a cosine function of a different frequency. Thus, the
coordinate vector with respect to the DCT basis tells you how the signal can be written as a linear combination
of cosine waves of different frequencies. To eliminate noise, you replace all entries with absolute value smaller
than in the coordinate vector by Essentially, you suppress certain frequencies by setting them to
process from signal processing called filtering Finally, you transfer the new coordinate vector back into the
coordinate system given by the standard basis.
The audio recording is given to you as a Dnumpy array stored in audiosignal.
Compute the coordinate vector audiosignal with respect to the DCTbasis of Store the coordinate
vector as a Dnumpy array in coordinates.
Create a new vector obtained from coordinates by replacing all entries with absolute value smaller than by
Store this new vector as a Dnumpy array in coordinatesfiltered.
Compute the vector in whose coordinate vector in the DCT basis is coordinatesfiltered. Store this
vector as a Dnumpy array in denoised.
The setup code provides the helper function createdctbasis that creates an matrix whose columns
make up the dimensional DCT basis.
The setup code gives the following variable:
Your code snippet should define the following variable:
usercode.py
import numpy as np
import matplotif.pyplot as plt
# Write your code to calculate denoised audio signal
coordinates dots.
coordinatesfiltered dots.
denoised
# Uncorment below to plot
Hfig, pltsubplots
liptplotaudiosigna
ilplt.plotdenoised
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