PLEASE WRITE A MATLAB CODE FOR THIS QUESITON. An audio file (chirp.wav) is given
ID: 1995083 • Letter: P
Question
PLEASE WRITE A MATLAB CODE FOR THIS QUESITON.
An audio file (chirp.wav) is given. The sampling frequency used to record this audio signal was 8192 Hz. Read the file in MATLAB. Play the file. Plot the signal with respect to time (Use proper labels). Compute the discrete Fourier transform (DFT) of the signal using a fast Fourier transform (FFT) algorithm. Use fftshift to fhift zero-frequency component to center of spectrum Calculate the magnitude and phase of DFT components. Plot the double-side amplitude and phase spectrum with respect to frequency (Use Nyquist criteria to define frequency range). Figure: Example of double-side spectrum Store the frequency, amplitude and phase parameters in ASCII file (text, excel, csv, etc.) Save the script as "Signal_Analyzer.m"Explanation / Answer
%since u didnt provide the link audio file, icant give the figures
Matlab code:
load chirp;%To read the audio file in Matlab
y=y(1:8192);%take the sample of audio file
N=8192;
fs=8192;
sound(y,fs);%To play the file
Y=fftshift(fft(y));% take the fft andshfit the fft file
w=[-pi:2*pi/N:pi-pi/N]*fs;
subplot(1,2,1)
plot(y);
xlabel('time in sec');
ylabel('amp in V')
subplot(1,2,2)
plot(w,abs(Y));%plot for double sided wave worm
xlabel('w in Hz')
ylable('magnitude');
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.