Prev: Pulse shaping + interpolation
Next: FFT in OpenCV
From: rajgerman on 20 Feb 2006 10:11 >What Fred and I each have said, is that you may either: > >1) multiply your data on a sample by sample basis by the samples comprising >the Hamming window and then FFT the product. > >or > > >2) convolve your FFTed data with the 3 coefs -0.23, 0.54, -0.23 that are >the frequency domain version of the Hamming window. You will need to know >how your FFT orders its data so the convolution can be applied properly. > > Cheers Clay I think I much better idea now. How would I though convolve the FFTed data with the 3 coefs -0.23, 0.54, -0.23?? My FFTed data is Y = fft(y);
From: Clay S. Turner on 20 Feb 2006 11:36 > > Cheers Clay > > I think I much better idea now. How would I though convolve the FFTed data > with the 3 coefs -0.23, 0.54, -0.23?? > > My FFTed data is Y = fft(y); If your FFT is like most, the output vector is in an order like 0,1,2,3,...,N/2,-N/2+1,-N/2+2,-N/2+3,...-3,-2,-1 where the numbers above are the frequencies. Other FFTs may have the output in an order like -N/2+1,-N/2+2,-N/2+3,...,-3,-2,-1,0,1,2,3,...,N/2 In both of these cases I've assumed the length N is even. You will need to know how yours is done. Now the convolution goes likes this new H(0) equals 0.54*H(0) - 0.26*(H(-1)+H(1)) new H(1) equals 0.54*H(1) - 0.26*(H(0)+H(2)) new H(2) equals 0.54*(H(2) - 0.26*(H(1)+H(3)) and so on. Whenever the index exceeds N/2 just wrap it back around. For example N/2+1 becomes -N/2+1. Be careful to not use the new value as an input in one of the calculations. All of the inputs are the old values. IHTH, Clay
From: Bob Cain on 20 Feb 2006 14:23 Clay S. Turner wrote: >> It's not likely that you want to window the FFTd sequence - as in multiply >> the FFTd sequence. >> It's much more likely that you want(ed) to window the temporal sequence >> (as in multiply) before the FFT. >> Or you could convolve in frequency to get the same affect. >> >> FFT both the temporal data sequence and the temporal window. >> Convolve the two in frequency. >> > > Hello Fred, > > Since the Hamming window is defined in terms of cosines, the Freq domain > version turns out to have only 3 non-zero coefs. This makes for a pretty > easy convolution. The coefs are -0.23, 0.54, -0.23 The three coeficients aren't real are they? The center one is but I seem to remember that the side ones were complex. False memory? Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein
From: Ikaro on 20 Feb 2006 14:47 Hi there, I you plan on analyzing your signal in MATLAB then you can use the function PWELCH to estimate the power spectrum density of your signal. This function automatically implements the hanning window and estimates the PSD for you (as well as plot it): http://www.mathworks.com/access/helpdesk/help/toolbox/signal/pwelch.html This estimate is much better than a simple periodogram. Note that you need the Signal Processing Toobox to use it... You can send me the files if you want me to take a look. -ikaro
From: Ron N. on 20 Feb 2006 14:48
rajgerman wrote: > Could anyone explain the Hamming window in REALLY simple terms and why it > is useful ... Note that an FFT is usually interpreted as the frequency content of a vector of samples as if these samples were repeated. However, if the first and last sample don't line up (as in a content of n and 1/2 sine waves in your sample window) there will be a sharp transition between the last and first sample of the repeat, which after an FFT might look like some sort of high frequency spike or noise. A Hamming window is a smooth way of rounding down the ends of your sample set to smaller values so that the first and last sample look closer to being continuous, and certain portions of the frequency content (the first hump) of any sharp transistion between the first and last sample are minimized. The rounding off of the edges has to be smooth because any shape will introduce frequency artifacts of their own. A Hamming window is one compromise out of many windows which might help with this method of frequency analysis. Triangular and trapeziodal chopping down of the ends of your bunch of samples is another easy but less smooth and thus lower quality method of doing this. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M |