Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2. Use MATLAB to produce \"time-domain\" and \"amplitude spectrum” plots for the

ID: 1766264 • Letter: 2

Question

2. Use MATLAB to produce "time-domain" and "amplitude spectrum” plots for the audio file hw5 audioFile.wav" posted on the course website. Use the audioread built-in function in MATLAB to import the audio file and obtain its sampling frequency. Use this sampling frequency to create a time vector that spans 0 seconds "end time" of the audio file. Use the "subplot" command to have the 2 plots on a single page (with appropriate titles). Use the "amplitude spectrum" function posted on the course website to produce the amplitude spectrum plot. In addition to your plots, MAKE SURE that you submit a hard-copy print-out of your MATLAB code.

Explanation / Answer

Matlab code:

[x fs]=wavread('hw5_audioFILE.wav'); % Reading Audio File

N=1024;

Y = fft(x,N); % Frequency Transform

f = fs/2*linspace(0,1,N/2+1); % Frequency Vector

figure,

plot(f,abs(Y(1:N/2+1))); % Plotting Spectrum of Audio Wav filea

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote