DSPRelated.com
Forums

windowing question

Started by Unknown April 25, 2006
Suppose that I have a continous-time signal that consists of a finite
number of Dirac impulses at integer time points. For example, lets say
the signal starts at t=0 and lasts for 100 seconds, with 100 dirac
impulses, one per second.

It's easy to take the Fourier Transform of this signal, since it is
time-limited.

Now lets apply a rectangular window to this signal, such that only 50
seconds of the signal are passed. There are 2 ways to compute the
resulting spectrum;


1) The rule says that multiplication in the time domain is convolution
in the freq domain, so I should be able to convolve the sinc function
of the windowing function with the original spectrum to get the new
spectrum. If the window function is not symettric about 0 then the sinc
function will be complex, but I think the theory still holds.

2) Or I can just simply take the Fourier Transform of the
time-truncated signal (much easier).

These two methids should give the same result.

Now here is the "twist". The window function can "end" at any time
between 50 seconds and 51 seconds. In other words, it doesn't matter if
the window ends at 50.01 seconds or 50.99 seconds; the input signal is
0 in this time-range anyway.

It's obvious that by using method "2" above, you get the correct
spectrum. But using method "1" above, the Fourier Transform of the sinc
function will change slightly depending on the exact length of the
window. But somehow, you have to get the same answer.

Can anyone explain this using calculation method "1" ??



Bob Adams

<robert.w.adams@verizon.net> wrote in message 
news:1145980027.476608.310590@j33g2000cwa.googlegroups.com...
> Suppose that I have a continous-time signal that consists of a finite > number of Dirac impulses at integer time points. For example, lets say > the signal starts at t=0 and lasts for 100 seconds, with 100 dirac > impulses, one per second. > > It's easy to take the Fourier Transform of this signal, since it is > time-limited. > > Now lets apply a rectangular window to this signal, such that only 50 > seconds of the signal are passed. There are 2 ways to compute the > resulting spectrum; > > > 1) The rule says that multiplication in the time domain is convolution > in the freq domain, so I should be able to convolve the sinc function > of the windowing function with the original spectrum to get the new > spectrum. If the window function is not symettric about 0 then the sinc > function will be complex, but I think the theory still holds. > > 2) Or I can just simply take the Fourier Transform of the > time-truncated signal (much easier). > > These two methids should give the same result. > > Now here is the "twist". The window function can "end" at any time > between 50 seconds and 51 seconds. In other words, it doesn't matter if > the window ends at 50.01 seconds or 50.99 seconds; the input signal is > 0 in this time-range anyway. > > It's obvious that by using method "2" above, you get the correct > spectrum. But using method "1" above, the Fourier Transform of the sinc > function will change slightly depending on the exact length of the > window. But somehow, you have to get the same answer. > > Can anyone explain this using calculation method "1" ??
Bob, Good question! Consider that the DFT or FFT version treats the time function as periodic - otherwise the frequency transform wouldn't be discrete. So, what is the period? It is the same as the number of samples measured in time intervals. N samples, N time intervals - a time interval occurring immediately at and after each sample if you will. So, 50 samples covers 50 intervals and not 49 with samples at the "ends" by definition of how the transform is done. This determines the effective length of the period which determines the effective width/frequency of the sinc in frequency. So, in your example, the signal starts at t=0, and lasts for 100 seconds. 100 seconds will be spanned by either 100 or 101 samples depending on how you define things. If you use the normal FFT definition then 100 samples defines a time span / period of 100 seconds although the last sample occurs at t=99 and the period repeats at t=100. The recurring sample at the beginning/end is not repeated at the end. So, if you want to window the 100 seconds by a factor of 2 then the number of time intervals will be 50, starting at t=0 and there will be 50 samples. Accordingly, method 1 would have you convolve with a sinc, or Dirichlet actually, that is 2x the width of the original - exactly. There is not the wiggle room you assume just because the signal is made up of unit samples on a regular grid of sample points. That is because the FFT assumes a time interval associated with each and every sample. Well .... that's one way to say it. Fred

robert.w.adams@verizon.net wrote:
> > Suppose that I have a continous-time signal that consists of a finite > number of Dirac impulses at integer time points. For example, lets say > the signal starts at t=0 and lasts for 100 seconds, with 100 dirac > impulses, one per second. > > It's easy to take the Fourier Transform of this signal, since it is > time-limited. > > Now lets apply a rectangular window to this signal, such that only 50 > seconds of the signal are passed. There are 2 ways to compute the > resulting spectrum; > > 1) The rule says that multiplication in the time domain is convolution > in the freq domain, so I should be able to convolve the sinc function > of the windowing function with the original spectrum to get the new > spectrum. If the window function is not symettric about 0 then the sinc > function will be complex, but I think the theory still holds. > > 2) Or I can just simply take the Fourier Transform of the > time-truncated signal (much easier). > > These two methids should give the same result.
No they won't. The DFT of the original signal where half the samples are multiplied by zero is not the same as the DFT of original series where half the samples are discarded. Consider the second time series which you are calling a "window" in the same manner. The DFT of 100 values half 1 and half zero is not the same as the DFT of a series of 50 all ones.
> > Now here is the "twist". The window function can "end" at any time > between 50 seconds and 51 seconds. In other words, it doesn't matter if > the window ends at 50.01 seconds or 50.99 seconds; the input signal is > 0 in this time-range anyway.
Are you using non-integer indexing? How do you arrive at your window series have non-integer length? -jim
> > It's obvious that by using method "2" above, you get the correct > spectrum. But using method "1" above, the Fourier Transform of the sinc > function will change slightly depending on the exact length of the > window. But somehow, you have to get the same answer. > > Can anyone explain this using calculation method "1" ?? > > Bob Adams
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
in article 1145984759_36827@sp6iad.superfeed.net, jim at
"sjedgingN0sp"@m@mwt.net wrote on 04/25/2006 13:10:

> > > robert.w.adams@verizon.net wrote: >> >> Suppose that I have a continous-time signal that consists of a finite >> number of Dirac impulses at integer time points. For example, lets say >> the signal starts at t=0 and lasts for 100 seconds, with 100 dirac >> impulses, one per second. >> >> It's easy to take the Fourier Transform of this signal, since it is >> time-limited. >> >> Now lets apply a rectangular window to this signal, such that only 50 >> seconds of the signal are passed. There are 2 ways to compute the >> resulting spectrum; >> >> 1) The rule says that multiplication in the time domain is convolution >> in the freq domain, so I should be able to convolve the sinc function >> of the windowing function with the original spectrum to get the new >> spectrum. If the window function is not symettric about 0 then the sinc >> function will be complex, but I think the theory still holds. >> >> 2) Or I can just simply take the Fourier Transform of the >> time-truncated signal (much easier). >> >> These two methids should give the same result. > > No they won't.
but the continuous-time function is the same in both cases and the Fourier Transform is well-defined. so the FT of two identical continuous-time functions must be the same.
> The DFT of the original signal where half the samples are > multiplied by zero is not the same as the DFT of original series where > half the samples are discarded.
there is no DFT. just FT. an FT arrived at by two different (and equally valid) means.
>> >> Now here is the "twist". The window function can "end" at any time >> between 50 seconds and 51 seconds. In other words, it doesn't matter if >> the window ends at 50.01 seconds or 50.99 seconds; the input signal is >> 0 in this time-range anyway. >> >> It's obvious that by using method "2" above, you get the correct >> spectrum. But using method "1" above, the Fourier Transform of the sinc >> function will change slightly depending on the exact length of the >> window. But somehow, you have to get the same answer. >> >> Can anyone explain this using calculation method "1" ??
this is indirect, but it is the same issue as reconstruction of a sampled bandlimited signal that is bandlimited to even *lower* than Nyquist. we know that if x(t) is bandlimited to Fs/2 = 1/(2*T), that &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;+inf &#4294967295; &#4294967295; &#4294967295; &#4294967295; s(t) = T * SUM{ x(k*T) * delta(t - k*T) } &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; k=-inf can be ideally filtered (that's windowing in the frequency domain) with this filter. X(f) = H(f) * S(f) where &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;{ &#4294967295;1 &#4294967295; &#4294967295;|f| < &#4294967295;Fs/2 &#4294967295; &#4294967295; H(f) = rect(f/Fs) = { &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;{ &#4294967295;0 &#4294967295; &#4294967295;|f| > Fs/2 to recover x(t) from the sampled s(t). this is because for |f| < Fs/2, the spectrum of s(t) known as S(f) is identical to X(f), the spectrum of x(t). the result of such filtering is: &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;+inf &#4294967295; &#4294967295; x(t) = Fs*T * SUM{ x(k*T) * sinc(Fs*(t - k*T)) } &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; k=-inf where sinc(u) = sin(pi*u)/(pi*u) . note that Fs*T = 1 and it is obvious that there is equality when t = n*T, for integer n. "Now here is the twist": what if x(t) is bandlimited to even *lower* than Fs/2, call that bandlimit "B". so X(f) = 0 for all |f| >= B and B < Fs/2. then there is zero spectrum between B and (Fs - B) and other like locations in the spectrum. now there is no reason that we can't filter the ideally sampled s(t) with a tighter ideal low-pass filter (with B < Fs/2 as the cut-off) to recover the spectrum of x(t). X(f) = H1(f) * S(f) where &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;{ &#4294967295;1 &#4294967295; &#4294967295;|f| < &#4294967295;B &#4294967295; &#4294967295; H1(f) = rect(f/(2*B)) = { &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;{ &#4294967295;0 &#4294967295; &#4294967295;|f| > B we are still left with X(f) and thus x(t). but now the output of the reconstruction filter is: &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;+inf &#4294967295; &#4294967295; x(t) = 2*B*T * SUM{ x(k*T) * sinc(2*B*(t - k*T)) } &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; k=-inf now it's not so obvious that equality holds when t = n*T . now 2*B*T < 1 and there is overlap of neighboring sinc() functions. but, because of the indirect proof (that equality holds in the frequency domain), it is true. but i am not proving the equality of the above directly. i think this is an equivalent problem to your "windowing question", Bob. say, how're you doing anyway? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Fred Marshall skrev:
> <robert.w.adams@verizon.net> wrote in message > news:1145980027.476608.310590@j33g2000cwa.googlegroups.com... > > Suppose that I have a continous-time signal that consists of a finite > > number of Dirac impulses at integer time points. For example, lets say > > the signal starts at t=0 and lasts for 100 seconds, with 100 dirac > > impulses, one per second. > > > > It's easy to take the Fourier Transform of this signal, since it is > > time-limited. > > > > Now lets apply a rectangular window to this signal, such that only 50 > > seconds of the signal are passed. There are 2 ways to compute the > > resulting spectrum; > > > > > > 1) The rule says that multiplication in the time domain is convolution > > in the freq domain, so I should be able to convolve the sinc function > > of the windowing function with the original spectrum to get the new > > spectrum. If the window function is not symettric about 0 then the sinc > > function will be complex, but I think the theory still holds. > > > > 2) Or I can just simply take the Fourier Transform of the > > time-truncated signal (much easier). > > > > These two methids should give the same result. > > > > Now here is the "twist". The window function can "end" at any time > > between 50 seconds and 51 seconds. In other words, it doesn't matter if > > the window ends at 50.01 seconds or 50.99 seconds; the input signal is > > 0 in this time-range anyway. > > > > It's obvious that by using method "2" above, you get the correct > > spectrum. But using method "1" above, the Fourier Transform of the sinc > > function will change slightly depending on the exact length of the > > window. But somehow, you have to get the same answer. > > > > Can anyone explain this using calculation method "1" ?? > > Bob, > > Good question! > > Consider that the DFT or FFT version treats the time function as periodic - > otherwise the frequency transform wouldn't be discrete.
Wrong version. The way I read the first post, we are talking about a continuous-time signal that by coincidence happens to contain a periodic train of pulses. Substitude the Diracs wuth a square pulse train, and the example is still good, as long as the two different window limits are kept inside one "0 section" of the train. But then, the question is a tough one. I'm with RBJ in that the FT/IFT pair is 1-to-1, so we are faced with one out of two objectives. 1) Show that the two integrals come up with different FTs 2) Show that the different limits are insignificant as long as they vary inside a "0 section" of the signal to be transformed. I believe the 2nd approach is the one to pursue. If we select some real numbers such that 0 < a <= b < c <= d where 0 is the start of the signal a is the end of the non-zero part of the signal b is the first FT integration limit c is the second integration limit d is the duration of the signal and x(t) == 0 for t >a. We don't care what the signal looks like between t == 0 and t == a, only that it is continuous. My argument is that no matter how we play with the intergration limits, we end up with an integral that looks like integral_0^d x(t) dt = integral_0^a x(t) dt + integral_a^d 0 dt == integral_0^a x(t) dt I think this is the key: No matter how you play with the limits inside the section where x(t) == 0, the non-vanishing contribution from the integral stays the same. For What It's Worth, Rune

robert bristow-johnson wrote:

> >> > >> These two methids should give the same result. > > > > No they won't. > > but the continuous-time function is the same in both cases and the Fourier > Transform is well-defined. so the FT of two identical continuous-time > functions must be the same.
> > The DFT of the original signal where half the samples are > > multiplied by zero is not the same as the DFT of original series where > > half the samples are discarded. > > there is no DFT. just FT. an FT arrived at by two different (and equally > valid) means.
OK looked to me like there was no FT only DFT. Thought he was talking about something a person could actually do. -jim
> > >> > >> Now here is the "twist". The window function can "end" at any time > >> between 50 seconds and 51 seconds. In other words, it doesn't matter if > >> the window ends at 50.01 seconds or 50.99 seconds; the input signal is > >> 0 in this time-range anyway. > >> > >> It's obvious that by using method "2" above, you get the correct > >> spectrum. But using method "1" above, the Fourier Transform of the sinc > >> function will change slightly depending on the exact length of the > >> window. But somehow, you have to get the same answer. > >> > >> Can anyone explain this using calculation method "1" ?? > > this is indirect, but it is the same issue as reconstruction of a sampled > bandlimited signal that is bandlimited to even *lower* than Nyquist. > > we know that if x(t) is bandlimited to Fs/2 = 1/(2*T), that > > +inf > s(t) = T * SUM{ x(k*T) * delta(t - k*T) } > k=-inf > > can be ideally filtered (that's windowing in the frequency domain) with this > filter. > > X(f) = H(f) * S(f) > > where > > { 1 |f| < Fs/2 > H(f) = rect(f/Fs) = { > { 0 |f| > Fs/2 > > to recover x(t) from the sampled s(t). this is because for |f| < Fs/2, the > spectrum of s(t) known as S(f) is identical to X(f), the spectrum of x(t). > > the result of such filtering is: > > +inf > x(t) = Fs*T * SUM{ x(k*T) * sinc(Fs*(t - k*T)) } > k=-inf > > where sinc(u) = sin(pi*u)/(pi*u) . note that Fs*T = 1 and it is obvious > that there is equality when t = n*T, for integer n. > > "Now here is the twist": what if x(t) is bandlimited to even *lower* than > Fs/2, call that bandlimit "B". > > so X(f) = 0 for all |f| >= B and B < Fs/2. > > then there is zero spectrum between B and (Fs - B) and other like locations > in the spectrum. now there is no reason that we can't filter the ideally > sampled s(t) with a tighter ideal low-pass filter (with B < Fs/2 as the > cut-off) to recover the spectrum of x(t). > > X(f) = H1(f) * S(f) > > where > > { 1 |f| < B > H1(f) = rect(f/(2*B)) = { > { 0 |f| > B > > we are still left with X(f) and thus x(t). but now the output of the > reconstruction filter is: > > +inf > x(t) = 2*B*T * SUM{ x(k*T) * sinc(2*B*(t - k*T)) } > k=-inf > > now it's not so obvious that equality holds when t = n*T . now 2*B*T < 1 > and there is overlap of neighboring sinc() functions. but, because of the > indirect proof (that equality holds in the frequency domain), it is true. > but i am not proving the equality of the above directly. > > i think this is an equivalent problem to your "windowing question", Bob. > > say, how're you doing anyway? > > -- > > r b-j rbj@audioimagination.com > > "Imagination is more important than knowledge."
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
jim wrote:

   ...

> Are you using non-integer indexing? How do you arrive at your window > series have non-integer length?
There is no indexing. His signal is continuous time with impulses that happen to fall on an integer grid. The signal can't be sampled; it isn't bandlimited. 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;
jim wrote:

   ...

> Are you using non-integer indexing? How do you arrive at your window > series have non-integer length?
There is no indexing. His signal is continuous time with sincs that happen to fall on an integer grid. The signal can't be sampled; it isn't bandlimited. 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 wrote:
> > jim wrote: > > ... > > > Are you using non-integer indexing? How do you arrive at your window > > series have non-integer length? > > There is no indexing. His signal is continuous time with sincs that > happen to fall on an integer grid. The signal can't be sampled; it isn't > bandlimited.
Yes I get that, now. This the part I don't get - If this is just a cerebral exercise and no actual physical time or energy is expended in performing methods 1 or 2 - Why or How is method 2 "much easier"? -jim ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
in article 1145991664_37517@sp6iad.superfeed.net, jim at
"sjedgingN0sp"@m@mwt.net wrote on 04/25/2006 15:05:

> > > Jerry Avins wrote: >> >> jim wrote: >> >> ... >> >>> Are you using non-integer indexing? How do you arrive at your window >>> series have non-integer length? >> >> There is no indexing. His signal is continuous time with sincs that >> happen to fall on an integer grid. The signal can't be sampled; it isn't >> bandlimited. > > Yes I get that, now. This the part I don't get - If this is just a > cerebral exercise and no actual physical time or energy is expended in > performing methods 1 or 2 - Why or How is method 2 "much easier"? >
Bob said:
>>> 2) Or I can just simply take the Fourier Transform of the >>> time-truncated signal (much easier).
the FT of a delayed impulse is pretty easy. the FT of a finite sum of differently delayed impulses is the finite sum of the FTs of the delayed impulses which is the finite sum of easy. method 1 requires convolution in the frequency domain with the FT of the window function (which is a sinc() function). doesn't appear easy at first blush to me. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."