Question

Below is the MATLAB code of low-cut shelving filter which can cut the low frequency of given music signal and low-boost...

Below is the MATLAB code of low-cut shelving filter which can cut the low frequency of given music signal and low-boost shelving filter which can boost the low frequency of given music signal. Design your low-boost shelving filter and low-cut shelving filter to have noticeablly different sound. Compare the sounds of two music signals after filtering, and explain the difference in sounds briefly. If there are any mistakes in code, correct them.  

Low-cut shelving filter code:

close all,
clear all,
clc,

ProjectPath = pwd;
MusicSignal_ = strcat(ProjectPath,'\yanny_laurel.wav');

[x, Fs] = audioread(MusicSignal_);
subplot(1,2,1); plot(x);
title('Original Music Signal Magnitude Plot');
%soundsc(y,Fs);

grid on,
Fc=200; %Cut off Freq in Hz
Order=2;

Wn = Fc/(Fs/2);
b = fir1(Order,Wn,'low'); hd = dfilt.dffir(b);
y = filter(hd,x);
subplot(1,2,2); plot(y); grid on, ylim([-3,3]);
str = strcat('Filtered InputSignal, Fc = ',num2str(Fc),' Hz'); title(str);
figure,
freqz(b,1,512);

Low-boost shelving filter:

close all,
clear all,
clc,

ProjectPath = pwd;
MusicSignal_ = strcat(ProjectPath,'\yanny_laurel.wav');

[x, Fs] = audioread(MusicSignal_);

Fc=(200/Fs)/2;
f = fdesign.parameq('F0,BW,BWp,Gref,G0,GBW,Gp,Gst',...
Fc, 0.3, 0.2, 0, 4, 2, 3.5, 0.5);
h = design(f);
hfvt = fvtool(h,'Color','white');
set(hfvt,'Filters',h);
legend(hfvt,'Low-Boost Shelving Filter');

subplot(2,1,1); plot(x);
title('Original yanny_laurel.wav File Plot');
%soundsc(y,Fs);
y = filter(h,x);
subplot(2,1,2); plot(y); grid on, ylim([-3,3]);
str = strcat('Filtered InputSignal, Fc = ',num2str(Fc),' Hz'); title(str);

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Low Boost Filter means Low Pass Filter and Low cut Filter means High Pass Filter.

Therefore, we need to design low pass and high pass filter.

Fc is the cut off frequency in each case.

Below is the matlab code:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%LOW PASS FILTER

close all,
clear all,
clc,

ProjectPath = pwd;
MusicSignal_ = strcat(ProjectPath,'\Tone.wav');

Fc=20; %Cut off Freq in Hz
Order=2; %Filter Order

[x, Fs, nbits] = wavread(MusicSignal_);
subplot(1,2,1); plot(x);
title('Original Music Signal Magnitude Plot');
%soundsc(x,Fs);

grid on,

Wn = Fc/(Fs/2);
b = fir1(Order,Wn,'low');
hd = dfilt.dffir(b);
y = filter(hd,x);
subplot(1,2,2); plot(y); grid on, ylim([-3,3]);
str = strcat('Filtered InputSignal, Fc = ',num2str(Fc),' Hz'); title(str);
figure,
freqz(b,1,512);
title('Low Pass Filter');

%HIGH PASS FILTER

figure,
close all,
clear all,
clc,

ProjectPath = pwd;
MusicSignal_ = strcat(ProjectPath,'\Tone.wav');

Fc=200; %Cut off Freq in Hz
Order=2; %Filter Order

[x, Fs, nbits] = wavread(MusicSignal_);
subplot(1,2,1); plot(x);
title('Original Music Signal Magnitude Plot');
%soundsc(x,Fs);

grid on,

Wn = Fc/(Fs/2);
b = fir1(Order,Wn,'high');
hd = dfilt.dffir(b);
y = filter(hd,x);
subplot(1,2,2); plot(y); grid on, ylim([-3,3]);
str = strcat('Filtered InputSignal, Fc = ',num2str(Fc),' Hz'); title(str);
figure,
freqz(b,1,512);
title('High Pass Filter');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Filtered InputSignal, Fc 20 Hz Original Music Signal Magnitude Plot 0.25 0.2 0.15 0.1 ПО5 0.05 01 0.15 U.2 0.5 2.5 15 3.5 05

Low Pass Filter 05 1 - 1.5 -2 25 0.9 0.8 07 0.6 0.5 04 0.3 0.2 0 1 Nomalized Frequency (xx rad/sample) FO 100 150 09 0.8 07 O

Original Music Signal Magnitude Plot Filtered InputSignal, Fc 200 Hz 0.25 0.2 0.15 0.1 ПО5 0.05 01 0.15 U.2 0.5 2.5 15 3.5 05

High Pass Filter 0.005 -0.01 -0015 -0.02 0.025 0.9 0.8 0.7 0.6 0.03 0.5 04 0.3 0.2 0.1 Nomalized Frequency (xx rad/sample) FO

Add a comment
Know the answer?
Add Answer to:
Below is the MATLAB code of low-cut shelving filter which can cut the low frequency of given music signal and low-boost...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT