1 / 9

Lab 6 (EASY)

Lab 6 (EASY). Fast Convolution. Fast Convolution. Lab objectives Implement a bandpass filter in the frequency domain, using a Hamming window function. Filter the noisy signal generated in Lab 3, and plot the result. Write the result to a .wav file for playback. Fast Convolution.

avon
Download Presentation

Lab 6 (EASY)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 6 (EASY) Fast Convolution

  2. Fast Convolution Lab objectives • Implement a bandpass filter in the frequency domain, using a Hamming window function. • Filter the noisy signal generated in Lab 3, and plot the result. • Write the result to a .wav file for playback

  3. Fast Convolution In lab 3, we generated a 5 second long, 40000 sample, wave file continaining noise, a 1000 Hz. sinusoid, and a 1500 Hz. sinusoid. In this lab, we’ll process the first 8192 samples of this complex signal. We’ll create a frequency domain Hamming window, centered at 1500 Hz., to attenuate the 1000 Hz. sinusoid while passing the 1500 Hz. sinusoid

  4. Fast Convolution When we take the 8192 point FFT of this signal, which was sampled at fs = 8000 Hz, the first 4096 samples in the FFT output represent frequencies from 0 Hz. to 4000 Hz. Samples 4097 through 8192 represent -4000 Hz to 0 Hz. Therefore, we need a gaussian window centered at

  5. Fast Convolution The Hamming window function is given by In this case, we’ll make the window 200 points wide, so N = 200.

  6. Fast Convolution In Matlab, index = linspace(0, 199, 200); Hamming = 0.54-0.46*cos(2 * pi * index / (199)); Now, we’ll create a vector containing the frequency response of our filter: H = zeros(8192, 1);

  7. Fast Convolution and we’ll place the filter window so that it’s centered at sample number 1536, with a negative frequency replica at sample 8191 – 1536 = 6655: H(1436:1635) = Hamming; H(6755:-1:6556) = Hamming(200:-1:1);

  8. Fast Convolution Next, either read your wav file from Lab 3, or generate the same noisy signal. Store the signal in a vector called x. Take the FFT of the first 8192 points in that vector, and store it in a vector xf: xf = fft(x(1:8192); Multiply xf by H, point by point: yf = xf .* H;

  9. Fast Convolution Take the Inverse FFT of yf, and write its real part to a wav file using wavwrite or auwrite. y = ifft(yf); Turn in: an m-file implementing the above procedure, and a wav file containing the output. MAKE SURE IT WORKS BEFORE YOU SEND IT TO ME!

More Related