Reply by Cedron March 21, 20172017-03-21
>On Tuesday, March 14, 2017 at 12:58:44 AM UTC-4, Cedron wrote: >> >> The whole transition between the continuous and discrete cases are of >> course of great importance in the study of DACs and ADC, and I
recognize
>> that although it really not an interest area for me. > >no, the sinc() stuff isn't about the DACs or ADCs. it's about >interpolation. >
I wasn't talking about the sinc. What I am saying is the only time it is necessary (need, not want) to consider the continuous case in relation to the discrete case is during the conversion from one to the other. The discrete case can be fully understood on its own without any reliance (or baggage) from the continuous case.
>> Once a signal is in >> digital form it does not matter if it from an analog source or
produced
>> computationally, the tools for processing it are in the discrete
domain.
> >they're just numbers. > >r b-j
I have put the math I posted in this thread into two new blog articles. For those who consider ASCII math too hard to follow the equations are rendered in nice typeface with a lot more explanation than I provided here. The articles are titled "DFT Bin Value Formulas for Pure Complex Tones" and "A Two Bin Exact Frequency Formula for a Pure Complex Tone in a DFT". You can find them here: https://www.dsprelated.com/blogs.php You will see my derivation of an exact frequency formula without any interpolation function in sight. Ced --------------------------------------- Posted through http://www.DSPRelated.com
Reply by robert bristow-johnson March 14, 20172017-03-14
On Tuesday, March 14, 2017 at 12:58:44 AM UTC-4, Cedron wrote:
> > The whole transition between the continuous and discrete cases are of > course of great importance in the study of DACs and ADC, and I recognize > that although it really not an interest area for me.
no, the sinc() stuff isn't about the DACs or ADCs. it's about interpolation.
> Once a signal is in > digital form it does not matter if it from an analog source or produced > computationally, the tools for processing it are in the discrete domain.
they're just numbers. r b-j
Reply by robert bristow-johnson March 14, 20172017-03-14
On Monday, March 13, 2017 at 11:51:37 PM UTC-4, Cedron wrote:
> [...snip...] > > > >if that's what you want. what i was illustrating in the post that Dale > >and someone else referred to is what happens when the N samples of x[n] > that > >are passed to you are understood as comprising one period of a periodic > >function, how does the periodic continuous function look like. > > > [...snip...] > > > >it depends on what the definition of the original function is. if the N > >samples were sampled from a bandlimited continuous-time periodic > function, > >representing exactly one period of the discrete-time periodic function, > >those N samples describe the bandlimited continuous-time function exactly > and > >at every single point within the frame or outside it, at integer sample > >times or in between the sample times. > > > >if the N samples were yanked from a stream of samples where no such > >assumption is made, *then* you have to consider windowing effects because > yanking > >out those N samples from the stream is, at least, applying the > rectangular > >window because you are using x[n]=0 to represent the samples outside of > >the frame. > > > >r b-j > > I'm sorry (keeping in the spirit of the title of this thread), my argument > ignored the periodic constraint.
the periodic "constraint" is sorta inherent to the DFT itself. r b-j
Reply by Cedron March 14, 20172017-03-14
>On Saturday, March 11, 2017 at 9:36:39 AM UTC-5, Cedron wrote: >> >Cedron <103185@DSPRelated> wrote: >> > >> >>Here it is again: The sinc function is not the correct description
for
>> >>side lobe drop off in a DFT. Not for complex tones, and not for
real
>> >>tones.
[...snip...]
>> > >but with the DFT, there is this inherent periodicity. that's why you
get
>this Dirichlet sinc() with a periodic denominator rather than the
regular
>continuous-time sinc(). >
I don't disagree at all. You are in essence repeating my point. I really did like your reversal of summation derivation to strike this point home for those of you (which seems to be most of you) that think of the DFT as a dirac delta train of a rectangular window in the continuous domain. I prefer to think of it in terms of discrete vectors and matrices in which case the dirac deltas and window are implicit. I do like the term "Dirichlet sinc", as well as "digital sinc" or "discrete sinc". I don't think that "Dirichlet kernel" or "alias sinc" are nearly as good. [...snip...]
>
>i dunno what this is all about. >
The derivation or the sarcastic part? I'll assume the derivation. I will frame this from your perspective, i.e. the continuous case. You will obviously agree that Dirichlet sinc is the proper function to use with a DFT (which implies sampled and a rectangular window). Now if I have a constant signal across the frame, the DFT will have a value in the DC bin and zero in all the other bins. These bin values are the sampled values of the Dirichlet sinc function and not those of the normalized sinc funtion, with the function centered at the DC bin (zero frequency). Therefore I can think of the constant signal as being a tone with zero frequency (obvious). Now if I multiply this constant signal with a complex tone in the time domain (continuously) it will have the effect of shifting the Dirichlet sinc function by the frequency. If the complex tone has an integer frequency with respect to my frame, then the corresponding bin number will be the only non-zero one. However, if the frequency is non-integer then all the bins will be non-zero and their magnitudes will be described by the Dirichlet sinc function (not the normalized sinc function) at its non-zero values as it is no longer centered on an integer. So far so good, and nothing new. Now switch to the perspective I prefer. The situation I described is the equivalent of taking the DFT of the complex tone above. The tone is described by a vector where each element is described by the exponential function S_n = M * e^[i( 2Pi/N * f * n + p )] The DFT also has a standalone definition which can be defined in terms of a matrix multiplication, rather than a sampled version of the continuous case. Z_k = sum_{n=0}^{N-1} S_n * e^[-i * 2Pi/N * k * n ] What I did in the derivation was plug the first equation into the second equation, crunched, and ended up with a formula for each Z_k which depends only on M, f, p, and k. I call this the Bin Value Formula for a Pure Complex Tone in a DFT. The magnitude of this formula is exactly the Dirichlet sinc function (setting M=1). No need for the continuous case whatsoever to fully understand why there is "leakage" and how large it is. The Bin Value Formula for a Pure Real Tone in a DFT is a bit more complicated, and I have not been able to find it any text in any form. Being a trigonometric expression, it can take many forms, and I have derived several useful ones. Martin Vicanek derived a different form than the ones I have in his exact two bin frequency formula paper based on a centered DFT. Michael Plet derived is own version, different than any of mine in order to derive his exact formulas. In my opinion, this is a better way to understand the functionality of the DFT and which is why I am writing my blog articles.
>Ced, there are two issues, really. only two: > >effect of sampling and the effect of windowing. and since both involve >multiplication of the same original continuous-time signal, windowing
and
>sampling may be interchanged in order. you can window first and sample >second, or you can swap the order. but if you are yanking out N samples
from a
>stream of much larger length, then you are windowing. it's at least the >rectangular window if you apply no other window. > >r b-j
Both these issues are implicitly addressed by a strictly discrete interpretation of the DFT (the "no window" view). When you are analyzing a signal and looking at a single frame of N points what the DFT "thinks" is outside the frame (i.e. a repeat of the frame contents) is inconsequential. It is the various frequency components within the frame that are of interest. The whole transition between the continuous and discrete cases are of course of great importance in the study of DACs and ADC, and I recognize that although it really not an interest area for me. Once a signal is in digital form it does not matter if it from an analog source or produced computationally, the tools for processing it are in the discrete domain. Ced --------------------------------------- Posted through http://www.DSPRelated.com
Reply by Cedron March 14, 20172017-03-14
[...snip...]
> >if that's what you want. what i was illustrating in the post that Dale >and someone else referred to is what happens when the N samples of x[n]
that
>are passed to you are understood as comprising one period of a periodic >function, how does the periodic continuous function look like. >
[...snip...]
> >it depends on what the definition of the original function is. if the N >samples were sampled from a bandlimited continuous-time periodic
function,
>representing exactly one period of the discrete-time periodic function, >those N samples describe the bandlimited continuous-time function exactly
and
>at every single point within the frame or outside it, at integer sample >times or in between the sample times. > >if the N samples were yanked from a stream of samples where no such >assumption is made, *then* you have to consider windowing effects because
yanking
>out those N samples from the stream is, at least, applying the
rectangular
>window because you are using x[n]=0 to represent the samples outside of >the frame. > >r b-j
I'm sorry (keeping in the spirit of the title of this thread), my argument ignored the periodic constraint. Ced --------------------------------------- Posted through http://www.DSPRelated.com
Reply by robert bristow-johnson March 13, 20172017-03-13
On Saturday, March 11, 2017 at 9:36:39 AM UTC-5, Cedron wrote:
> >Cedron <103185@DSPRelated> wrote: > > > >>Here it is again: The sinc function is not the correct description for > >>side lobe drop off in a DFT. Not for complex tones, and not for real > >>tones. > > > >It's the correct description of the side lobe drop of for a rectangular > >window. > > Straight from Wikipedia: "The normalized sinc function is the Fourier > transform of the rectangular function with no scaling." > > They are talking about the continuous FT with an infinite domain, not the > DFT. Multiplying the rectangular function with a complex pure tone has > the effect of shifting and rotating the sinc function in the frequency > domain. >
but with the DFT, there is this inherent periodicity. that's why you get this Dirichlet sinc() with a periodic denominator rather than the regular continuous-time sinc().
> > > >An N-point DFT preserves energy so if you're simply trying to measure > >energy vs. frequency, a rectangular window followed by an N-point DFT > >allows you to measure a sinc function at the output of the DFT > >relative to input frequency, by taking the total energy. > > > >For N small, as opposed to N approaching infinity, you do not as > >much information that is interesting to a spectral analysis > >of a chunk of input, but you still get a sinc curve when you sweep > >the input with a single frequency. > > > > > Things are slightly different in the discrete case. But if I am > understanding you correctly by what you mean by sweep, you do not get a > sinc function. > > let a = f * 2Pi / N > > let b_k = k * 2Pi / N > > I use alpha, beta, and phi in my blog articles for the same terms, but > "a", "b", and "p" are clearer in text. > > let S[n] = M * e^( i * ( a * n + p ) ) be a complex pure tone > > M > 0 > > Plugging this into the definition of a 1/N normalized DFT and doing a > geometric summation yields: > > Z[k] = (M/N) * e^( i * p ) * ( 1 - e^( i * ( a - b_k ) * N ) ) / ( 1 - e^( > i * ( a - b_k ) ) ) > > This is then a bin value formula for the DFT of a pure tone. There a two > directions you can take this formula. > > The first leads to the Dirichlet kernel definition. > > let d = k - f > > let x = a - b_k = 2Pi * ( f - k ) = -2Pi * d > > Factor out e^( i * x * N / 2 ) out of the numerator and e^( i * x / 2 ) > out of the denominator. Apply Euler's equation to all the terms in the > fraction and simplify. > > Z[k] = (M/N) * e^( i * ( x * ( N - 1 ) / 2 + p ) ) * sin( N * x / 2 ) / > sin( x / 2 ) > > Substitute in d: > > Z[k] = M * e^( -i * ( Pi * d * ( N - 1 ) + p ) ) * sin( N * Pi * d ) / ( N > * sin( Pi * d ) ) > > So as you sweep f, the result at any given bin is the Dirichlet function. > Equivalently, as you sweep f you are shifting and rotating the Dirichlet > kernel through the bin set. > > Taking the magnitude removes the rotation term completely. > > | Z[k] | = M * | sin( N * Pi * d ) / ( N * sin( Pi * d ) ) | > > The second direction abandons the notion of a function between the bins > and considers the bin values only. Consider that b_k * N is a multiple of > 2Pi. > > Z[k] = (M/N) * e^( i * p ) * ( 1 - e^( i * a * N ) ) / ( 1 - e^( i * ( a - > b_k ) ) ) > > To me, this form makes it easier to understand the behavior of the bins. > If f is an integer then a * N is a multiple of 2Pi and the numerator value > is alway zero. Only when f = k does the denominator equal zero so you get > an indeterminate form. For all other bins the bin value is zero. When f > is close to an integer then the numerator is small and all the bin values > are small except when f is close to k then the denominator becomes small > too. When f is away from an integer the numerator is larger and the > denominator never reaches as small a value so the bin values are much more > spread out. > > In addition this form of the bin value equations make solving for exact > frequency formulas relatively simple. > > ( 1 - e^( i * ( a - b_k ) ) ) * Z[k] = ( 1 - e^( i * ( a - b_{k+1} ) ) ) * > Z[k+1] > > Solving for e^( -i * a ) is fairly straightforward leaving an expression > of known values. Take the log and convert scale and you get your > frequency. > > >Or am I smoking something here? > > > >Steve > > If you are, you forgot to add your [smoking] and [/smoking] tags. Whether > you are smoking is even tougher to tell than if you are > using sarcasm. Some things don't translate well into Usenet.
i dunno what this is all about. Ced, there are two issues, really. only two: effect of sampling and the effect of windowing. and since both involve multiplication of the same original continuous-time signal, windowing and sampling may be interchanged in order. you can window first and sample second, or you can swap the order. but if you are yanking out N samples from a stream of much larger length, then you are windowing. it's at least the rectangular window if you apply no other window. r b-j
Reply by robert bristow-johnson March 13, 20172017-03-13
On Monday, March 13, 2017 at 10:10:17 AM UTC-4, Cedron wrote:
> [...snip...] > >if we reconstruct the continuous-time x(t) from the discrete x[n] and > >we're willing to add up an infinite number of samples, i don't think > anyone > >will disagree that: > > > > x(t) = sum_{n=-infty}^{infty} x[n] sinc(t-n) > > > >where sinc(u) = sin(pi u)/(pi u) . > > > [...snip...] > > > > Thank you for this explanation, I found it very helpful. > > I think I have to disagree a little bit. I think you wording should be > something like: "if we reconstruct *a* continuous-time *y(t)* from the > discrete x[n]" > > Your reconstructed function will match your original function at the > discrete points, but doesn't necessarily have to equal in between. > > Consider the function which is a reconstruction using only one frame. > > y(t) = sum_{n=0}^{N-1} x[n] sinc(t-n)
this is what you get *only* if all of x[n] outside the frame 0 <= n < N is zero. if the N samples of x[n] represent a single period of a periodic function, the above is not correct.
> On the integer points of the domain it will match the sequence inside the > frame
but that's always the case with the sinc() function...
> and equal zero outside the frame.
... whether it's zero outside the frame or not.
> In between the integer points it > will do a good job of "connecting the dots" smoothly.
but that's always the case, whether it's zero outside the frame or not.
> Outside the frame, > the sections between the integer points will be non-zero, diminishing in > size as you move away from the frame with a limit of zero as you approach > infinity.
if that's what you want. what i was illustrating in the post that Dale and someone else referred to is what happens when the N samples of x[n] that are passed to you are understood as comprising one period of a periodic function, how does the periodic continuous function look like.
> > Consider a function produced by adding up two frames of sinc functions. > > yy(t) = y(t) + y(t-N) > > Within the frame, y(t) and yy(t) will be equal all the sampled x[n] at the > integer points, but will not be equal to each other in between. You now > have two functions that will produce the same x[n] sequence if they were > your original function. Therefore it is impossible to guarantee that a > reconstruction will match the original function.
it depends on what the definition of the original function is. if the N samples were sampled from a bandlimited continuous-time periodic function, representing exactly one period of the discrete-time periodic function, those N samples describe the bandlimited continuous-time function exactly and at every single point within the frame or outside it, at integer sample times or in between the sample times. if the N samples were yanked from a stream of samples where no such assumption is made, *then* you have to consider windowing effects because yanking out those N samples from the stream is, at least, applying the rectangular window because you are using x[n]=0 to represent the samples outside of the frame. r b-j
Reply by Cedron March 13, 20172017-03-13
[...snip...]
>if we reconstruct the continuous-time x(t) from the discrete x[n] and >we're willing to add up an infinite number of samples, i don't think
anyone
>will disagree that: > > x(t) = sum_{n=-infty}^{infty} x[n] sinc(t-n) > >where sinc(u) = sin(pi u)/(pi u) . >
[...snip...]
> > >r b-j
Thank you for this explanation, I found it very helpful. I think I have to disagree a little bit. I think you wording should be something like: "if we reconstruct *a* continuous-time *f(t)* from the discrete x[n]" Your reconstructed function will match your original function at the discrete points, but doesn't necessarily have to equal in between. Consider the function which is a reconstruction using only one frame. y(t) = sum_{n=0}^{N-1} x[n] sinc(t-n) On the integer points of the domain it will match the sequence inside the frame and equal zero outside the frame. In between the integer points it will do a good job of "connecting the dots" smoothly. Outside the frame, the sections between the integer points will be non-zero, diminishing in size as you move away from the frame with a limit of zero as you approach infinity. Consider a function produced by adding up two frames of sinc functions. yy(t) = y(t) + y(t-N) Within the frame, y(t) and yy(t) will be equal all the sampled x[n] at the integer points, but will not be equal to each other in between. You now have two functions that will produce the same x[n] sequence if they were your original function. Therefore it is impossible to guarantee that a reconstruction will match the original function. Ced --------------------------------------- Posted through http://www.DSPRelated.com
Reply by Cedron March 11, 20172017-03-11
[...snip...]

> >And if you can't recognize sarcasm and mark the location of significant >snips from the posts that you quote I think you should: >1) redo your equations with ascii graphics for all summation operations >2) illustrate the multidimensional extension of the sync with ascii
graphics
>and >3) provide an early edition O&S citation for the use of the technical
term
>"thingie" > >Get it? > >Dale B. Dalrymple
Dale, I'm worried for you. "Verbal bullying is a means of using words in a negative way such as insults, teasing, put downs, etc., to gain power over someone else's life." (from a search on "bullying") In addition, bullying is often defined by somebody trying to control somebody else. Here you are dictating to r b-j on how he has to frame his response. You have repeatedly tried to dictate to me what is and what is not appropriate for this group, arrogantly assuming the role of group spokesman. You rarely contribute any actual subject matter and dodge answering any questions put to you. Earlier in this thread I gave you the definition of a window type that is not in the literature yet has special mathematical properties. You dismissed investigating it because of the source, not the content. This indicates a remarkable lack of intellectual curiosity on your part. I sincerely recommend that you do some serious introspection and modify your behavior accordingly. Ced --------------------------------------- Posted through http://www.DSPRelated.com
Reply by Cedron March 11, 20172017-03-11
>Cedron <103185@DSPRelated> wrote: > >>Here it is again: The sinc function is not the correct description for >>side lobe drop off in a DFT. Not for complex tones, and not for real >>tones. > >It's the correct description of the side lobe drop of for a rectangular >window.
Straight from Wikipedia: "The normalized sinc function is the Fourier transform of the rectangular function with no scaling." They are talking about the continuous FT with an infinite domain, not the DFT. Multiplying the rectangular function with a complex pure tone has the effect of shifting and rotating the sinc function in the frequency domain.
> >An N-point DFT preserves energy so if you're simply trying to measure >energy vs. frequency, a rectangular window followed by an N-point DFT >allows you to measure a sinc function at the output of the DFT >relative to input frequency, by taking the total energy. > >For N small, as opposed to N approaching infinity, you do not as >much information that is interesting to a spectral analysis >of a chunk of input, but you still get a sinc curve when you sweep >the input with a single frequency. >
Things are slightly different in the discrete case. But if I am understanding you correctly by what you mean by sweep, you do not get a sinc function. let a = f * 2Pi / N let b_k = k * 2Pi / N I use alpha, beta, and phi in my blog articles for the same terms, but "a", "b", and "p" are clearer in text. let S[n] = M * e^( i * ( a * n + p ) ) be a complex pure tone M > 0 Plugging this into the definition of a 1/N normalized DFT and doing a geometric summation yields: Z[k] = (M/N) * e^( i * p ) * ( 1 - e^( i * ( a - b_k ) * N ) ) / ( 1 - e^( i * ( a - b_k ) ) ) This is then a bin value formula for the DFT of a pure tone. There a two directions you can take this formula. The first leads to the Dirichlet kernel definition. let d = k - f let x = a - b_k = 2Pi * ( f - k ) = -2Pi * d Factor out e^( i * x * N / 2 ) out of the numerator and e^( i * x / 2 ) out of the denominator. Apply Euler's equation to all the terms in the fraction and simplify. Z[k] = (M/N) * e^( i * ( x * ( N - 1 ) / 2 + p ) ) * sin( N * x / 2 ) / sin( x / 2 ) Substitute in d: Z[k] = M * e^( -i * ( Pi * d * ( N - 1 ) + p ) ) * sin( N * Pi * d ) / ( N * sin( Pi * d ) ) So as you sweep f, the result at any given bin is the Dirichlet function. Equivalently, as you sweep f you are shifting and rotating the Dirichlet kernel through the bin set. Taking the magnitude removes the rotation term completely. | Z[k] | = M * | sin( N * Pi * d ) / ( N * sin( Pi * d ) ) | The second direction abandons the notion of a function between the bins and considers the bin values only. Consider that b_k * N is a multiple of 2Pi. Z[k] = (M/N) * e^( i * p ) * ( 1 - e^( i * a * N ) ) / ( 1 - e^( i * ( a - b_k ) ) ) To me, this form makes it easier to understand the behavior of the bins. If f is an integer then a * N is a multiple of 2Pi and the numerator value is alway zero. Only when f = k does the denominator equal zero so you get an indeterminate form. For all other bins the bin value is zero. When f is close to an integer then the numerator is small and all the bin values are small except when f is close to k then the denominator becomes small too. When f is away from an integer the numerator is larger and the denominator never reaches as small a value so the bin values are much more spread out. In addition this form of the bin value equations make solving for exact frequency formulas relatively simple. ( 1 - e^( i * ( a - b_k ) ) ) * Z[k] = ( 1 - e^( i * ( a - b_{k+1} ) ) ) * Z[k+1] Solving for e^( -i * a ) is fairly straightforward leaving an expression of known values. Take the log and convert scale and you get your frequency.
>Or am I smoking something here? > >Steve
If you are, you forgot to add your [smoking] and [/smoking] tags. Whether you are smoking is even tougher to tell than if you are using sarcasm. Some things don't translate well into Usenet. Like this: [sarc] Take this entire post with a large grain of salt since it has been written by a purportedly incompetent stick puppet pendant hobbyist. [/sarc] [locale specific humor] Dale must be a Yooper because they are the only ones who can legitimately call me a troll. [/locale specific humor] Hope this helps, Ced --------------------------------------- Posted through http://www.DSPRelated.com