DSPRelated.com
Forums

Window functions

Started by Rune Allnor August 31, 2004
On 2 Sep 2004 02:13:18 -0700, allnor@tele.ntnu.no (Rune Allnor) wrote:

>r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message news:<41365058.204625031@news.sf.sbcglobal.net>... >> The DFT of Eq. [1]'s w1(n) is neither real-only nor does >> it's freq-domain samples have the correct amplitudes. >> >> I now think the correct N-point Hamming equation >> should be: >> >> w2(n) = 0.54 - 0.46*cos(2*pi*n/(N)) [2] >> for n = 0,1,2,...,N-1. >> >> If you plot w2(n) in the time domain it does not "look >> symmetric". The w2(n) sequence's first and last samples >> are not equal. But the DFT of Eq. [2]'s w2(n) is real-only >> and it's freq-domain samples do have the correct amplitudes >> (0.23N, 0.54N, and 0.23N). >> >> I want to call w2(n) "DFT symmetric", because if we circularize >> (is that a word) it, by repeating it over and over, making >> it periodic, then it becomes symmetrical. > >It's lunchtime and my head is not quite as foggy as when I made my >first attempt at answering your post this morning:
Hi Rune,
> >Should't you use a N-1 pt DFT and leave one end-point out of it?
Humm, ... interesting. I hadn't thought about making that comparison. If we use Eq. [1] with N = 8, discard the last w1(7) sample, and then take a 7-point DFT we get 7 freq-domain samples that I'll call W1(m). Next if we use Eq. [2] with N = 7, and then take a 7-point DFT we get 7 freq-domain samples that I'll call W2(m). In this case W1(m) does indeed equal W2(m), and they both have the correct freq-domain amplitudes. So Rune, your suggestion appears to give the correct DFT results. So for an N-point DFT, Eq. [2] applies. For an (N-1)-point DFT, Eq.[1] applies so long as we discard w1(n)'s last sample. I'll have to "chew on" all of this to see if I can formulate some "fundamental principle" that I can get straight in my mind.
>If so, the formulas are correct, and the end points of the windows >appear twice in an analysis where they should appear only once.
Oops, sorry Rune. I'm not exactly sure what you mean here.
>Could this account for the apparent error?
Well, your suggestion is surely interesting. Good going. I'm just not sure what it means to say "use Eq. [1] and discard the last w1(n) sample." Rather than doing that, why not just use Eq. [2]? Anyway, thanks Rune. [-Rick-]
Rick Lyons wrote:
> On 2 Sep 2004 02:13:18 -0700, allnor@tele.ntnu.no (Rune Allnor) wrote: > > >>r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message news:<41365058.204625031@news.sf.sbcglobal.net>... >> >>>The DFT of Eq. [1]'s w1(n) is neither real-only nor does >>>it's freq-domain samples have the correct amplitudes. >>> >>>I now think the correct N-point Hamming equation >>>should be: >>> >>>w2(n) = 0.54 - 0.46*cos(2*pi*n/(N)) [2] >>>for n = 0,1,2,...,N-1. >>> >>>If you plot w2(n) in the time domain it does not "look >>>symmetric". The w2(n) sequence's first and last samples >>>are not equal. But the DFT of Eq. [2]'s w2(n) is real-only >>>and it's freq-domain samples do have the correct amplitudes >>>(0.23N, 0.54N, and 0.23N). >>> >>>I want to call w2(n) "DFT symmetric", because if we circularize >>>(is that a word) it, by repeating it over and over, making >>>it periodic, then it becomes symmetrical. >> >>It's lunchtime and my head is not quite as foggy as when I made my >>first attempt at answering your post this morning: > > > Hi Rune, > >>Should't you use a N-1 pt DFT and leave one end-point out of it? > > > Humm, ... interesting. I hadn't thought about > making that comparison. If we use Eq. [1] with N = 8, > discard the last w1(7) sample, and then take a 7-point > DFT we get 7 freq-domain samples that I'll call W1(m). > Next if we use Eq. [2] with N = 7, and then take a 7-point > DFT we get 7 freq-domain samples that I'll call W2(m). > In this case W1(m) does indeed equal W2(m), and they > both have the correct freq-domain amplitudes. > > So Rune, your suggestion appears to give the correct > DFT results. So for an N-point DFT, Eq. [2] applies. > For an (N-1)-point DFT, Eq.[1] applies so long as we > discard w1(n)'s last sample. > > I'll have to "chew on" all of this to see if > I can formulate some "fundamental principle" that I can > get straight in my mind. > > >>If so, the formulas are correct, and the end points of the windows >>appear twice in an analysis where they should appear only once. > > > Oops, sorry Rune. I'm not exactly sure what you mean here. > > >>Could this account for the apparent error? > > > Well, your suggestion is surely interesting. > Good going. > I'm just not sure what it means to say > "use Eq. [1] and discard the last w1(n) sample." > Rather than doing that, why not just use Eq. [2]? > > Anyway, thanks Rune. > > [-Rick-]
I think what Rune is getting at is that the end points of most window functions -- those without a pedestal -- are zero. To window N points with such a window, it makes sense to calculate a window N+2 points wide and then use the N non-zero values. If your window function is, to use your term, "DFT Symmetric", then only one end point will be zero. In that case, to make all data points count, you would calculate a window N+1 points wide, and discard the single zero. I assert without proof or test that the two methods yield the same numbers. They may be conceptually different, but functionally, they are the same. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
allnor@tele.ntnu.no (Rune Allnor) wrote in message news:<f56893ae.0409020113.3692a8c0@posting.google.com>...
 
> It's lunchtime and my head is not quite as foggy as when I made my > first attempt at answering your post this morning: > > Should't you use a N-1 pt DFT and leave one end-point out of it? > > If so, the formulas are correct, and the end points of the windows > appear twice in an analysis where they should appear only once. > > Could this account for the apparent error?
Hi Rick, I saw your reply in the other post. To try to clarify, let me recapitulate some facts and assertions: - The length N of the FIR filter is odd - The indexes run from 0 to N-1 - The FIR filter should have linear phase - The FIR filter must be of symmetric impulse response (around (N-1)/2) - The FIR filter is designed by windowing - The window function is based on the cos(n) function So we have a length-N (N odd, mind you!) sequence of numbers that needs to be symmetrical around n=(N-1)/2. Oh why bother, we are talking hypothetically, so why not center the window around n=0. When inspecting the relation between the sinc function and the cosine window, we find that the cos(0)=1 coefficient aligns nicely with sinc(0)=1. OK, let's extend the window function *symmetrically* around n=0. You will find that one adds new coefficients in pairs, first h(-1) and h(1), then h(-2) and h(2) and so on. Note that one in this way wil *never* reach a window function that spans exactly one period of the cosine! Once you reach the ponint where you add h((N-1)/2) = cos(2pi), you also add h(-(N-1)/2) to the window. All this means that the Blackman window spans one period + 1 sample of the cosine term. Check out this matlab script: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% N=9; % Length of window b=blackman(N); bb=b(1:N-1); % Chop off one end-point fft(b)/N % Prints wrong(?) Fourier coefficients fft(bb)/(N-1) % Prints correct(?) Forier coefficients %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I'm happy with that the mismatch between odd N and the period of the cosine term accounts for the problem. The problem should not occur for even N. In that case the length of the window should match one period of the cosine. Rune
"Rune Allnor" <allnor@tele.ntnu.no> wrote in message
news:f56893ae.0409020113.3692a8c0@posting.google.com...
> r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message
news:<41365058.204625031@news.sf.sbcglobal.net>...
> > The DFT of Eq. [1]'s w1(n) is neither real-only nor does > > it's freq-domain samples have the correct amplitudes. > > > > I now think the correct N-point Hamming equation > > should be: > > > > w2(n) = 0.54 - 0.46*cos(2*pi*n/(N)) [2] > > for n = 0,1,2,...,N-1. > > > > If you plot w2(n) in the time domain it does not "look > > symmetric". The w2(n) sequence's first and last samples > > are not equal. But the DFT of Eq. [2]'s w2(n) is real-only > > and it's freq-domain samples do have the correct amplitudes > > (0.23N, 0.54N, and 0.23N). > > > > I want to call w2(n) "DFT symmetric", because if we circularize > > (is that a word) it, by repeating it over and over, making > > it periodic, then it becomes symmetrical. > > It's lunchtime and my head is not quite as foggy as when I made my > first attempt at answering your post this morning: > > Should't you use a N-1 pt DFT and leave one end-point out of it? > > If so, the formulas are correct, and the end points of the windows > appear twice in an analysis where they should appear only once. > > Could this account for the apparent error?
Yes. As you say: In a normal N-point FFT we are assuming that the first input sample is repeated at N+1. The resulting FFT has the same property -> N samples with the N+1th sample assumed to be the same as the first. We would similarly view a window as being periodic with the N+1th point the same as the first. So, for the window to be symmetric it would have N+1 symmetrical points with the N+1th point removed (and assumed). Fred
"Jerry Avins" <jya@ieee.org> wrote in message
news:41373543$0$19715$61fed72c@news.rcn.com...
> Rick Lyons wrote: > > On 2 Sep 2004 02:13:18 -0700, allnor@tele.ntnu.no (Rune Allnor) wrote: > > > > > >>r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message
news:<41365058.204625031@news.sf.sbcglobal.net>...
> >> > >>>The DFT of Eq. [1]'s w1(n) is neither real-only nor does > >>>it's freq-domain samples have the correct amplitudes. > >>> > >>>I now think the correct N-point Hamming equation > >>>should be: > >>> > >>>w2(n) = 0.54 - 0.46*cos(2*pi*n/(N)) [2] > >>>for n = 0,1,2,...,N-1. > >>> > >>>If you plot w2(n) in the time domain it does not "look > >>>symmetric". The w2(n) sequence's first and last samples > >>>are not equal. But the DFT of Eq. [2]'s w2(n) is real-only > >>>and it's freq-domain samples do have the correct amplitudes > >>>(0.23N, 0.54N, and 0.23N). > >>> > >>>I want to call w2(n) "DFT symmetric", because if we circularize > >>>(is that a word) it, by repeating it over and over, making > >>>it periodic, then it becomes symmetrical. > >> > >>It's lunchtime and my head is not quite as foggy as when I made my > >>first attempt at answering your post this morning: > > > > > > Hi Rune, > > > >>Should't you use a N-1 pt DFT and leave one end-point out of it? > > > > > > Humm, ... interesting. I hadn't thought about > > making that comparison. If we use Eq. [1] with N = 8, > > discard the last w1(7) sample, and then take a 7-point > > DFT we get 7 freq-domain samples that I'll call W1(m). > > Next if we use Eq. [2] with N = 7, and then take a 7-point > > DFT we get 7 freq-domain samples that I'll call W2(m). > > In this case W1(m) does indeed equal W2(m), and they > > both have the correct freq-domain amplitudes. > > > > So Rune, your suggestion appears to give the correct > > DFT results. So for an N-point DFT, Eq. [2] applies. > > For an (N-1)-point DFT, Eq.[1] applies so long as we > > discard w1(n)'s last sample. > > > > I'll have to "chew on" all of this to see if > > I can formulate some "fundamental principle" that I can > > get straight in my mind. > > > > > >>If so, the formulas are correct, and the end points of the windows > >>appear twice in an analysis where they should appear only once. > > > > > > Oops, sorry Rune. I'm not exactly sure what you mean here. > > > > > >>Could this account for the apparent error? > > > > > > Well, your suggestion is surely interesting. > > Good going. > > I'm just not sure what it means to say > > "use Eq. [1] and discard the last w1(n) sample." > > Rather than doing that, why not just use Eq. [2]? > > > > Anyway, thanks Rune. > > > > [-Rick-] > > I think what Rune is getting at is that the end points of most window > functions -- those without a pedestal -- are zero. To window N points > with such a window, it makes sense to calculate a window N+2 points wide > and then use the N non-zero values. If your window function is, to use > your term, "DFT Symmetric", then only one end point will be zero. In > that case, to make all data points count, you would calculate a window > N+1 points wide, and discard the single zero. I assert without proof or > test that the two methods yield the same numbers. They may be > conceptually different, but functionally, they are the same.
Jerry, If the end points are zero then you need to use them. And, the results are not the same. That is, if I understand you: a) Calculate an N+2 window with zero end points and throw out both zero end points to get a length N window. b) Calculate an N+1 window with zero end points and throw out one zero (the N+1th) end point to get a length N window. In a, there are no zero end points at all. In b, there is a zero on the first point and an assumed zero on the N+1th point. So, they are different. Fred But, you will drop one of them because it occurs on the N+1th == the first location (repeats).
allnor@tele.ntnu.no (Rune Allnor) wrote in message news:<f56893ae.0409020854.76be30be@posting.google.com>...

> The problem should not > occur for even N. In that case the length of the window should match > one period of the cosine.
No, it doesn't. The window still spans one period + one sample. The only difference is that it misses the cos(0)=1 term in the middle. Rune
Fred Marshall wrote:
> "Jerry Avins" <jya@ieee.org> wrote in message > news:41373543$0$19715$61fed72c@news.rcn.com... > >>Rick Lyons wrote: >> >>>On 2 Sep 2004 02:13:18 -0700, allnor@tele.ntnu.no (Rune Allnor) wrote: >>> >>> >>> >>>>r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message > > news:<41365058.204625031@news.sf.sbcglobal.net>... > >>>>>The DFT of Eq. [1]'s w1(n) is neither real-only nor does >>>>>it's freq-domain samples have the correct amplitudes. >>>>> >>>>>I now think the correct N-point Hamming equation >>>>>should be: >>>>> >>>>>w2(n) = 0.54 - 0.46*cos(2*pi*n/(N)) [2] >>>>>for n = 0,1,2,...,N-1. >>>>> >>>>>If you plot w2(n) in the time domain it does not "look >>>>>symmetric". The w2(n) sequence's first and last samples >>>>>are not equal. But the DFT of Eq. [2]'s w2(n) is real-only >>>>>and it's freq-domain samples do have the correct amplitudes >>>>>(0.23N, 0.54N, and 0.23N). >>>>> >>>>>I want to call w2(n) "DFT symmetric", because if we circularize >>>>>(is that a word) it, by repeating it over and over, making >>>>>it periodic, then it becomes symmetrical. >>>> >>>>It's lunchtime and my head is not quite as foggy as when I made my >>>>first attempt at answering your post this morning: >>> >>> >>>Hi Rune, >>> >>> >>>>Should't you use a N-1 pt DFT and leave one end-point out of it? >>> >>> >>>Humm, ... interesting. I hadn't thought about >>>making that comparison. If we use Eq. [1] with N = 8, >>>discard the last w1(7) sample, and then take a 7-point >>>DFT we get 7 freq-domain samples that I'll call W1(m). >>>Next if we use Eq. [2] with N = 7, and then take a 7-point >>>DFT we get 7 freq-domain samples that I'll call W2(m). >>>In this case W1(m) does indeed equal W2(m), and they >>>both have the correct freq-domain amplitudes. >>> >>>So Rune, your suggestion appears to give the correct >>>DFT results. So for an N-point DFT, Eq. [2] applies. >>>For an (N-1)-point DFT, Eq.[1] applies so long as we >>>discard w1(n)'s last sample. >>> >>>I'll have to "chew on" all of this to see if >>>I can formulate some "fundamental principle" that I can >>>get straight in my mind. >>> >>> >>> >>>>If so, the formulas are correct, and the end points of the windows >>>>appear twice in an analysis where they should appear only once. >>> >>> >>>Oops, sorry Rune. I'm not exactly sure what you mean here. >>> >>> >>> >>>>Could this account for the apparent error? >>> >>> >>>Well, your suggestion is surely interesting. >>>Good going. >>>I'm just not sure what it means to say >>>"use Eq. [1] and discard the last w1(n) sample." >>>Rather than doing that, why not just use Eq. [2]? >>> >>>Anyway, thanks Rune. >>> >>>[-Rick-] >> >>I think what Rune is getting at is that the end points of most window >>functions -- those without a pedestal -- are zero. To window N points >>with such a window, it makes sense to calculate a window N+2 points wide >>and then use the N non-zero values. If your window function is, to use >>your term, "DFT Symmetric", then only one end point will be zero. In >>that case, to make all data points count, you would calculate a window >>N+1 points wide, and discard the single zero. I assert without proof or >>test that the two methods yield the same numbers. They may be >>conceptually different, but functionally, they are the same. > > > Jerry, > > If the end points are zero then you need to use them. And, the results are > not the same. > > That is, if I understand you: > > a) Calculate an N+2 window with zero end points and throw out both zero end > points to get a length N window. > > b) Calculate an N+1 window with zero end points and throw out one zero (the > N+1th) end point to get a length N window. > > In a, there are no zero end points at all. > In b, there is a zero on the first point and an assumed zero on the N+1th > point. > So, they are different. > > Fred > But, you will drop one of them because it occurs on the N+1th == the first > location (repeats).
Let's stay with the non-circular symmetric case. I collect N samples and window them to prepare for a DFT with a window of length N. The first and last window coefficients are zero, so the first and last samples that the N-point DFT operates on are zero. Except for the bin spacing, I will get the same results by discarding the end samples and running an (N-2)-point DFT. Why did I bother to collect those samples? Conversely: I use a window of length N+2, discarding the zero end points. After applying the truncated window to the data, I pad the result with a zero at each end, achieving what is indistinguishable from what would be had starting with N+2 samples. Where did those two free samples come from? They ain't no free lunch. Those samples were there all along; this time, I didn't throw them away. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Rune Allnor wrote:

> allnor@tele.ntnu.no (Rune Allnor) wrote in message news:<f56893ae.0409020854.76be30be@posting.google.com>... > > >> The problem should not >>occur for even N. In that case the length of the window should match >>one period of the cosine. > > > No, it doesn't. The window still spans one period + one sample. > The only difference is that it misses the cos(0)=1 term in the middle. > > Rune
Absolutely. A related question: if it is known that the data span a period, why use a window? When the data represent an arbitrary interval, don't we want to "let it down easy" on both ends? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Fred Marshall wrote:

> "Rune Allnor" <allnor@tele.ntnu.no> wrote in message > news:f56893ae.0409020113.3692a8c0@posting.google.com... > >>r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message > > news:<41365058.204625031@news.sf.sbcglobal.net>... > >>>The DFT of Eq. [1]'s w1(n) is neither real-only nor does >>>it's freq-domain samples have the correct amplitudes. >>> >>>I now think the correct N-point Hamming equation >>>should be: >>> >>>w2(n) = 0.54 - 0.46*cos(2*pi*n/(N)) [2] >>>for n = 0,1,2,...,N-1. >>> >>>If you plot w2(n) in the time domain it does not "look >>>symmetric". The w2(n) sequence's first and last samples >>>are not equal. But the DFT of Eq. [2]'s w2(n) is real-only >>>and it's freq-domain samples do have the correct amplitudes >>>(0.23N, 0.54N, and 0.23N). >>> >>>I want to call w2(n) "DFT symmetric", because if we circularize >>>(is that a word) it, by repeating it over and over, making >>>it periodic, then it becomes symmetrical. >> >>It's lunchtime and my head is not quite as foggy as when I made my >>first attempt at answering your post this morning: >> >>Should't you use a N-1 pt DFT and leave one end-point out of it? >> >>If so, the formulas are correct, and the end points of the windows >>appear twice in an analysis where they should appear only once. >> >>Could this account for the apparent error? > > > Yes. As you say: In a normal N-point FFT we are assuming that the first > input sample is repeated at N+1. The resulting FFT has the same property -> > N samples with the N+1th sample assumed to be the same as the first. > > We would similarly view a window as being periodic with the N+1th point the > same as the first. So, for the window to be symmetric it would have N+1 > symmetrical points with the N+1th point removed (and assumed). > > Fred
Early in my exploration of DSP, I did a paper design of a windowed Hilbert Transformer with an odd number of taps (so there would be a middle tap for matching pure delay). The ripple increases toward the band edges. To get symmetric ripple, I needed the window's end values to be the same. Are you saying that filter coefficients and measured data need to be windowed differently? I'm asking, not maintaining a position. The argument about the (N+1)st sample repeating the first (I would have written the Nth repeating the zeroeth) is persuasive, but what happens with zero padding? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"Jerry Avins" <jya@ieee.org> wrote in message
news:4138592b$0$19725$61fed72c@news.rcn.com...
> Fred Marshall wrote: > > > > > > Jerry, > > > > If the end points are zero then you need to use them. And, the results
are
> > not the same. > > > > That is, if I understand you: > > > > a) Calculate an N+2 window with zero end points and throw out both zero
end
> > points to get a length N window. > > > > b) Calculate an N+1 window with zero end points and throw out one zero
(the
> > N+1th) end point to get a length N window. > > > > In a, there are no zero end points at all. > > In b, there is a zero on the first point and an assumed zero on the
N+1th
> > point. > > So, they are different. > > > > Fred > > But, you will drop one of them because it occurs on the N+1th == the
first
> > location (repeats). > > Let's stay with the non-circular symmetric case. I collect N samples and > window them to prepare for a DFT with a window of length N. The first > and last window coefficients are zero, so the first and last samples > that the N-point DFT operates on are zero. Except for the bin spacing, I > will get the same results by discarding the end samples and running an > (N-2)-point DFT. Why did I bother to collect those samples?
Jerry, I think we're talking about two different things. And, the second sentence above isn't really proper - which is what we *are* talking about I think. I suppose we've all done what you describe, but it isn't really proper I believe - Rick's point. What's (I think) proper is to prepare for a DFT with a window of length N+1 and drop the last sample in the window to apply it to a sequence of length N and do a DFT of length N. (I have said nothing about zeros at the ends one way or another). And, this has nothing to do with efficiency or collecting samples, just plain proper math. Now, if you want to say that a particular window is going to have zeros at the ends, then you could collect one fewer sample - the first one - and pad a single zero at the beginning of the array before doing the DFT. Whichever is best for your situation is fine.
> > Conversely: I use a window of length N+2, discarding the zero end > points. After applying the truncated window to the data, I pad the > result with a zero at each end, achieving what is indistinguishable from > what would be had starting with N+2 samples. Where did those two free > samples come from? They ain't no free lunch. Those samples were there > all along; this time, I didn't throw them away.
You start with the idea that there will be an N+2 point DFT, right? I prefer to keep the DFT at N points just to keep apples to apples. So, then is this what you're saying:
> Conversely: I use a window of length N [that has zero end points), >discarding the zero end points. >After applying the truncated window to the data, I pad the > result with a zero at each end, achieving what is indistinguishable from > what would be had starting with N samples. Where did those two free > samples come from? They ain't no free lunch. Those samples were there > all along; this time, I didn't throw them away.
It's the same deal. You would compute a window of length *N+1* [that has zero end points] discarding one end point for an apparently asymmetrical window (Rick's point). Now you have a window of length N, that has a starting point of zero, to be applied to a data sequence of length N . If you would like to not capture the first sample or multiply by zero, either one, and pad the sequence with a zero at the beginning - that's fine. It doesn't change the fact that you need to compute the window to be one sample longer than the data and truncate the window by one sample before applying it. Fred