Question: Create a function on MATLAB that extracts the main lobe of the magnitude spectrum of a window given the window type and its length. The
Create a function on MATLAB that extracts the main lobe of the magnitude spectrum of a window given the
window type and its length. The function should return the samples corresponding to the main lobe in decibels
dB The input arguments of the function are the window type and the length of window. You may expect as
input the window type to be rectangular, Hamming, and BlackmanHarris.
Tip: log is not well defined, so its a common practice to add a small value such as to the magnitude
spectrum before computing it in dB
Measure the SNR in the reconstructed signal using the STFT model
Create a function that computes the SNR of a signal using the shorttime Fourier model STFT Use the timedomain energy definition to calculate the SNR The input arguments to the function are a wav. file name including
the path, window type, window length, FFT size, and hop size. The function should return the SNR over the entire
length of the input SNR and the SNR for the segment of signals left after discarding M samples from both the
start and the end, where M is the STFT window length.
Test case: you may run your code using the piano.wav file with blackman window, window length FFT
size and hop size
Computing bandwise energy envelopes of a signal
Create a function that computes bandwise energy envelopes of a given audio signal using STFT in decibels.
For this task, consider two frequency bands: low and high. The low frequency band is the set of all frequencies
between and Hz and the high frequency band is the set of all frequencies between and Hz At
a given frame, the value of the energy envelope of a band is computed as the sum of squared values of all
frequency coefficient in that band. The input arguments to the function are a wav. file name including the path,
window type, window length, FFT size, and hop size. The function should return a matrix with two columns,
where the first column is the energy envelope of the low frequency band and the second is that of the second
frequency band.
Test case: you may run your code using the piano.wav file with blackman window, window length FFT
size and hop size
Computing an onset detection function
Create a function that computes a simple onset detection function ODF using STFT Compute two ODFs
for two frequency bands: the set of all frequencies between and Hz and the set of all frequencies between
and Hz A brief description of the onset detection function is provided in this document. Set
ODF to make the length of the ODF the same as the energy envelope. Remember to apply a half wave
rectification on the ODF. The input arguments to the function are a wav. file name including the path, window
type, window length, FFT size, and hop size. The function should return a matrix with two columns, where the
first column is the ODF computed on the low frequency band and the second column is the ODF computed on
the high frequency band.
Test case: you may run your code using the piano.wav file with blackman window, window length FFT
size and hop size
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
