Question

Design a matlab code that: 1-play sound 2- add noise to the sound 3- filter the...

Design a matlab code that:

1-play sound

2- add noise to the sound

3- filter the noised signal using fir or iir filter

Note: FIR: Finite impulse response filter

IIR: Infinite impulse response filter

Please make code simple.

don't copy other from other codes.

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

Hello,
          Please find the answer attached as under. Please give a thumbs up rating if you find the answer useful! Have a rocking day ahead!

************ Matlab Code ************


%% create filter parameters
Fs = 8192;                                             % Sampling Frequency (Change If Different)
Fn = Fs/2;                                              % Nyquist Frequency
Wp = [150 5800]/(6*Fn);                                    % Normalised Passband
Ws = [ 50 6100]/(6*Fn);                                    % Normalised Stopband
Rp = 1;                                                % Passband Ripple (dB)
Rs = 30;                                                % Stopband Ripple (dB)
[n,Ws] = cheb2ord(Wp,Ws,Rp,Rs);                         % Chebyshev Type II Order
[b,a] = cheby2(n,Rs,Ws);                                % IIR Filter Coefficients
[SOS,G] = tf2sos(b,a);                                  % Convert To Second-Order-Section For Stability
figure(1)
freqz(SOS, 4096, Fs)                                    % Check Filter Performance

%% load data file
load handel.mat
filename = 'handel.wav';
audiowrite(filename,y,Fs);
clear y Fs
[y,Fs] = audioread('handel.wav');
%% filter the signal
filt_sig = filtfilt(SOS,G,y);
sound(filt_sig,Fs);

******** End of Code *************

*****************************************************************
PS: Please do not forget the thumbs up!

Add a comment
Know the answer?
Add Answer to:
Design a matlab code that: 1-play sound 2- add noise to the sound 3- filter the...
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