Question

In this problem, we will study the significance of phase information in the sinusoidal coding of audio. Use the audio file $\operatorname{ch} 9 a u d 1 . w a v$. Consider a frame size of $N=512$ samples. Let $S_i(k)$ be the 512 -point FFT of the $i$-th audio frame, and $S_i(k)=\left|S_i(k)\right| e^{j \Phi_i(k)}$ where $\left|S_i(k)\right|$ is the magnitude spectrum and $\Phi_i(k)$ is the phase at the $k$-th FFT bin. Write a MATLAB program to pick 30 spectral peaks from the 512-point FFT magnitude spectrum. Set the rest of the spectral component magnitudes to a very small value, e.g., 0.000001 . Call the resulting spectral magnitude as $\left|\hat{S}_i(k)\right|$. a. Set the phase $\Phi_i(k)=0$ and reconstruct the audio signal, $\hat{s}_i(n)=$ $\mathrm{IFFT}_{512}\left[\hat{S}_i(k)\right]$ for all the frames, $i=1,2, \ldots, N_f$. b. Calculate the sample MSE, $E_i=\mathrm{E}\left[e_i^2(n)\right]$ for each frame, $i$. Compute the average MSE, $E_{\mathrm{Avg}}=\frac{1}{N_f} \sum_{i=1}^{N_f} E_i$, where $N_f$ is the number of frames. c. Set the phase $\left.\boldsymbol{\Phi}_i=\pi(2 \operatorname{rand}(1,512)-1)\right)$, where $\boldsymbol{\Phi}_i$ is the $[1 \times 512]$ uniform random phase vector that varies between $-\pi$ and $\pi$. Reconstruct the audio signal, $\hat{s}_i(n)=\operatorname{IFFT}_{512}\left[\hat{S}_i(k) e^{j \Phi_i}\right]$ for all the frames. Note that you must avoid using the same set of random phase components in all the frames. Repeat step (b). d. Set the phase $\Phi_i(k)=\arg \left[S_i(k)\right]$, i.e., we are using the input signal phase. Reconstruct the audio, $\hat{s}_i(n)=\operatorname{IFFT}_{512}\left[\hat{S}_i(k) e^{j \Phi_i(k)}\right]$ for all the frames. Repeat step (b). e. Perform an experiment where the low-frequency sinusoids $(<1.5 \mathrm{kHz})$ use the input signal phase and the high-frequency components use random phase as in part (c). Compute $E_i$ and $E_{\text {Avg }}$ using step (b). f. Give a dB plot of $E_i$ obtained from steps (a) and (b) across the number of frames, $i=1,2, \ldots, N_f$. Now superimpose the $E_i$ 's obtained in steps (c), (d), and (e). Which case performed better in terms of the MSE measure? g. Evaluate to the synthesized audio obtained from steps (a), (c), (d), and (e). Which case results in better perceptual quality?

   In this problem, we will study the significance of phase information in the sinusoidal coding of audio. Use the audio file $\operatorname{ch} 9 a u d 1 . w a v$. Consider a frame size of $N=512$ samples. Let $S_i(k)$ be the 512 -point FFT of the $i$-th audio frame, and $S_i(k)=\left|S_i(k)\right| e^{j \Phi_i(k)}$ where $\left|S_i(k)\right|$ is the magnitude spectrum and $\Phi_i(k)$ is the phase at the $k$-th FFT bin. Write a MATLAB program to pick 30 spectral peaks from the 512-point FFT magnitude spectrum. Set the rest of the spectral component magnitudes to a very small value, e.g., 0.000001 . Call the resulting spectral magnitude as $\left|\hat{S}_i(k)\right|$.
a. Set the phase $\Phi_i(k)=0$ and reconstruct the audio signal, $\hat{s}_i(n)=$ $\mathrm{IFFT}_{512}\left[\hat{S}_i(k)\right]$ for all the frames, $i=1,2, \ldots, N_f$.
b. Calculate the sample MSE, $E_i=\mathrm{E}\left[e_i^2(n)\right]$ for each frame, $i$. Compute the average MSE, $E_{\mathrm{Avg}}=\frac{1}{N_f} \sum_{i=1}^{N_f} E_i$, where $N_f$ is the number of frames.
c. Set the phase $\left.\boldsymbol{\Phi}_i=\pi(2 \operatorname{rand}(1,512)-1)\right)$, where $\boldsymbol{\Phi}_i$ is the $[1 \times 512]$ uniform random phase vector that varies between $-\pi$ and $\pi$. Reconstruct the audio signal, $\hat{s}_i(n)=\operatorname{IFFT}_{512}\left[\hat{S}_i(k) e^{j \Phi_i}\right]$ for all the frames. Note that you must avoid using the same set of random phase components in all the frames. Repeat step (b).
d. Set the phase $\Phi_i(k)=\arg \left[S_i(k)\right]$, i.e., we are using the input signal phase. Reconstruct the audio, $\hat{s}_i(n)=\operatorname{IFFT}_{512}\left[\hat{S}_i(k) e^{j \Phi_i(k)}\right]$ for all the frames. Repeat step (b).
e. Perform an experiment where the low-frequency sinusoids $(<1.5 \mathrm{kHz})$ use the input signal phase and the high-frequency components use random phase as in part (c). Compute $E_i$ and $E_{\text {Avg }}$ using step (b).
f. Give a dB plot of $E_i$ obtained from steps (a) and (b) across the number of frames, $i=1,2, \ldots, N_f$. Now superimpose the $E_i$ 's obtained in steps (c), (d), and (e). Which case performed better in terms of the MSE measure?
g. Evaluate to the synthesized audio obtained from steps (a), (c), (d), and (e). Which case results in better perceptual quality?
Show more…
Audio Signal Processing and Coding
Audio Signal Processing and Coding
Andreas Spanias, Ted… 1st Edition
Chapter 9, Problem 10 ↓

Instant Answer

verified

Step 1

wav`. You can use the `audioread` function to read the audio data and sampling rate. ```matlab [audioData, fs] = audioread('ch9aud1.wav'); ```  Show more…

Show all steps

lock
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
In this problem, we will study the significance of phase information in the sinusoidal coding of audio. Use the audio file $\operatorname{ch} 9 a u d 1 . w a v$. Consider a frame size of $N=512$ samples. Let $S_i(k)$ be the 512 -point FFT of the $i$-th audio frame, and $S_i(k)=\left|S_i(k)\right| e^{j \Phi_i(k)}$ where $\left|S_i(k)\right|$ is the magnitude spectrum and $\Phi_i(k)$ is the phase at the $k$-th FFT bin. Write a MATLAB program to pick 30 spectral peaks from the 512-point FFT magnitude spectrum. Set the rest of the spectral component magnitudes to a very small value, e.g., 0.000001 . Call the resulting spectral magnitude as $\left|\hat{S}_i(k)\right|$. a. Set the phase $\Phi_i(k)=0$ and reconstruct the audio signal, $\hat{s}_i(n)=$ $\mathrm{IFFT}_{512}\left[\hat{S}_i(k)\right]$ for all the frames, $i=1,2, \ldots, N_f$. b. Calculate the sample MSE, $E_i=\mathrm{E}\left[e_i^2(n)\right]$ for each frame, $i$. Compute the average MSE, $E_{\mathrm{Avg}}=\frac{1}{N_f} \sum_{i=1}^{N_f} E_i$, where $N_f$ is the number of frames. c. Set the phase $\left.\boldsymbol{\Phi}_i=\pi(2 \operatorname{rand}(1,512)-1)\right)$, where $\boldsymbol{\Phi}_i$ is the $[1 \times 512]$ uniform random phase vector that varies between $-\pi$ and $\pi$. Reconstruct the audio signal, $\hat{s}_i(n)=\operatorname{IFFT}_{512}\left[\hat{S}_i(k) e^{j \Phi_i}\right]$ for all the frames. Note that you must avoid using the same set of random phase components in all the frames. Repeat step (b). d. Set the phase $\Phi_i(k)=\arg \left[S_i(k)\right]$, i.e., we are using the input signal phase. Reconstruct the audio, $\hat{s}_i(n)=\operatorname{IFFT}_{512}\left[\hat{S}_i(k) e^{j \Phi_i(k)}\right]$ for all the frames. Repeat step (b). e. Perform an experiment where the low-frequency sinusoids $(<1.5 \mathrm{kHz})$ use the input signal phase and the high-frequency components use random phase as in part (c). Compute $E_i$ and $E_{\text {Avg }}$ using step (b). f. Give a dB plot of $E_i$ obtained from steps (a) and (b) across the number of frames, $i=1,2, \ldots, N_f$. Now superimpose the $E_i$ 's obtained in steps (c), (d), and (e). Which case performed better in terms of the MSE measure? g. Evaluate to the synthesized audio obtained from steps (a), (c), (d), and (e). Which case results in better perceptual quality?
Close icon
Play audio
Feedback
Powered by NumerAI
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever