ht2383_matlab_HW9_report

.pdf

School

New York University *

*We aren’t endorsed by this school

Course

6113

Subject

Electrical Engineering

Date

Feb 20, 2024

Type

pdf

Pages

12

Uploaded by BarristerBoulderNarwhal28

Report
I create a MATLAB file call problem.m I put my code in there. In the 'mtlab.wav' , I heard a clean sound with short fast pronounced ‘matlab’. In the 'mtlab_noisy.wav' I heard a short pronounced ‘matlab’ with a shrill whistle. [Y_clean, Fs_clean] = audioread( 'mtlab.wav' ); [Y_noisy, Fs_noisy] = audioread( 'mtlab_noisy.wav' ); soundsc(Y_clean, Fs_clean); soundsc(Y_noisy, Fs_noisy); As following impulse plot, we can clearly find that noise located at -1 to -0.8 and 0.8 to 1. fx = fft(Y_clean,7418); fy = fft(Y_noisy,7418); n = [-1:1/3709:1]; n = n(1:end-1);
R = 512; window = hamming(R); N = 512; L = 25; overlap = R - L; fs = Fs_clean; figure subplot(2,1,1) plot(n,abs(fftshift(fx))) title( 'original signal' ) subplot(2,1,2) plot(n,abs(fftshift(fy))) title( 'signal with noise' ) From the spectrogram you can tell noisy one has noticeable noise around 3kHz and above. Clean vs noisy:
figure; subplot(2, 1, 1); spectrogram(Y_clean, window, overlap, N, fs, 'yaxis' ); title( 'Clean Signal Spectrogram' ); subplot(2, 1, 2); spectrogram(Y_noisy, window, overlap, N, fs, 'yaxis' ); title( 'Noisy Signal Spectrogram' ); Option A: W as constant:
I set w=10 and w=50 for weight function turned to emphasize noise removal and allow a transition bank, and the following are the impulse and spectrogram result. W=10: W=50:
Option B: I set short as 10, long as 40: h_short = firpm(10, [0 fp fs 0.5]*2, [1 1 0 0], W1); h_long = firpm(40, [0 fp fs 0.5]*2, [1 1 0 0], W1); the following are the impulse response and spectrogram of different length under the same weighting function:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help