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

Q3. Write a Matlab script to read in a wav signal as follows: [y, Fs] = audiorea

ID: 1766583 • Letter: Q

Question

Q3. Write a Matlab script to read in a wav signal as follows: [y, Fs] = audioread('applause·wav'). vector y contains the audio signal and Fs returns the sampling rate. Use the function sound(y,Fs) to listen to the audio. The audio signal must be processed using lowpass and highpass filters and the output of each filter played using the sound function above to compare with the original and with each other. Step 1: Filter with the lowpass filter which has a cutoff frequency Fc 400 Hz. The filter coefficients are: b [0.127405506514293 0.509622026057172 0.764433039085757 0.509622026057172 0.127405506514293] * 1.0e-03 a=[ 1.000000000000000-340492 1297086085 4.385491616873872-25288764 15181691 0.550344583498133] Step 2: Filter with the highpass filter which has a cutoff frequency Fc = 1300 Hz. The filter coefficients are: b= [0.369600037616006-1.478400150464025 2.217600225696037-1.478400150464025 0.369600037616006] 1.887390228238211-0807738582323864 a=[1.000000000000000-208 1796907318938 0.136674883975085]

Explanation / Answer

clear all;close all;clc;commandwindow;
%load the wave file..
load applause.mat;

%reads the file, y has the file data and Fs is the sampling frequency..
[y, Fs]=audioread('applause.wav');

%plays the audio...
sound(y,Fs);

% filtering using low pass filter...
b=1.0e-03.*[0.127405506514293 0.509622026057172 0.764433039085757 0.509622026057172 0.127405506514293];
a=[1.000000000000 -3.404921297086085 4.385491616873872 -2.528876415181691 0.550344583498133];
y_LP is the low pass filtered data...
y_LP=filtfilt(b,a,y);

% filtering using high pass filter...
b=[0.369600037616006 -1.47840015064025 2.217600225696037 -1.47840015064025 0.369600037616006];
a=[1.000000000000 -2.081796907318938 1.887390228238211 -0.807738582323864 0.13667488975085];
y_HP is the high pass filtered data...
y_HP=filtfilt(b,a,y);