lab5_08 - ECE220, Spring 2008 Lab 5: FIR Filters Monday,...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE220, Spring 2008 Lab 5: FIR Filters Monday, February 25 - Thursday, February 28 Location: 314 Phillips Hall. This time the Prelab report is due Friday, 5:00pm, February 22th , in the collection boxes next to the south entrance to 219 Phillips Hall. Matlab is available in most of the computer laboratories on the campus. To identify the lab closest to you visit www.cit.cornell.edu/labs/ . Read the entire lab description before you show up in the lab. Read 6 and 7 from the textbook. Make a copy of your prelab report and bring it with you when you come to the lab. You will also need all Matlab programs that you are asked to write for your prelab. In the lab you will answer questions related to topics covered in this document. Your TA will note on the TAs’ check-out form to what extent your answers were correct. 1 Spectra Useful signals are often time varying meaning that their frequencies vary with time. MATLAB provides a function, named specgram , which calculates frequencies of a signal over time. We will use specgram to identify and select dominant frequencies of a signal and next approximate the signal by a linear combinations of sinusoids corresponding to the selected frerqencies. Start by loading the sound of a train whistle and play the sound, load train; % this will load y and Fs sound(y,Fs); You should hear the two sounds on top of each other. Here y is the sequence of samples of the train whistle, and Fs is the sampling frequency. You can see the (discrete) frequencies present in the discrete signal y by executing % [s,f,t]=spectrogram(y,wl,novlp,nfft,Fs); % input: y - discrete-time signal % wl - y is divided into segments of length wl each % novlp - number of samples each segment overlaps with the next % nfft - number of frequency points tested % Fs - sampling rate % output: s - array of frequency responses
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 % f - vector of frequencies % t - vector of time instances at which snapshots of frequencies are taken % [s,f,t]=spectrogram(y,256,128,256,Fs); % figure properties set(0,’DefaultAxesFontSize’,16); set(0,’DefaultTextFontSize’,16); pcolor(t,f,20*log10(abs(s)));shading flat colorbar; title(’Train whistle spectrum’,’FontSize’,18);
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/25/2008 for the course ECE 2200 taught by Professor Johnson during the Spring '05 term at Cornell.

Page1 / 5

lab5_08 - ECE220, Spring 2008 Lab 5: FIR Filters Monday,...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online