Thursday, November 18, 2010

Lab 4 Questions

I have a few questions about lab 4.  I'm not sure exactly what is meant by all of the inputs and outputs of step 5.  Specifically:


INPUTS:
 - a window
 - an overlap factor


OUTPUTS:
 - the spectrogram in a 2D array
 - a time array
 - a frequency array


Would you mind elaborating on these?


Is the "window" meant to be some sort of windowing filter to be applied to the time-domain signal?

Yes.  One of the inputs is the FFT size.  Let's call this N.  The window is a length N array/vector of samples of the window that should be applied to the samples of the time-domain signal before the FFT is computed.  If no window is to be applied, then the array/vector will be filled with N ones.  We have talked about various types of windows in class including Kaiser, Hamming, etc.  There are many more in the textbook.

Is the "overlap factor" meant to imply that as we take the FFT of the signal in chunks, the chunks will have some samples overlapping?

Yes, this is exactly as you describe.  You split the signal into overlapping chunks of length N samples.  The overlap is specified by one of the inputs.  The window is applied to each chunk and the FFT computed.

Does "the spectrogram in a 2D array"  mean that we should attempt to make a graphical representation of the spectrum using a 2D array and some arbitrary ASCII character?  If so, should we plot the magnitude squared of the FFT output?

Each time you compute an FFT of a chunk of windowed data, you will get a spectrum array/vector out of the FFT.  Stack these side by side in a 2D array.

I'm not sure what the "time array" would be unless you just want us to output the time domain samples as an array of doubles.

The time array is an array/vector of times in seconds (this is why you need to know the sample rate) of the firsts sample in each of the signal chunks.  Given the sample rate, the FFT size N, and the number of samples of overlap, you should be able to compute the elements of the time array.

Is the "frequency array" just an array representing the outputs of the FFT?  Since we will be performing multiple FFTs on the signal in segments, should we average the results of all of the FFTs? It wouldn't seem to make much sense to concatenate them.  Also, since the FFT will yield a complex signal, should this array be an array of complex numbers, or should it be the real plus imaginary parts, or the magnitude, or the magnitude squared?

The frequency array/vector contains the FFT bin center frequencies multiplied by the sample rate.  This gives an array of frequencies in Hertz.  Remember that the FFT bin center frequencies are:
k/N for k=0, 1, 2, ..., N-1.

No comments:

Post a Comment