On 2012/02/05 09:27, Eric Jacobsen wrote:>> In either case, I'm talking about pure >> cosine wave data feeding the DAC with full scale samples (which is why I >> use cosine, not sine, so as to guarantee that frequencies at or near >> Nyquist actually have a non-zero amplitude) and no following filter stage. > > This statement suggests you need to back up a bit and start with some > more fundamental math. The difference between continuous sin and cos > waves is only the relative phase, and the response doesn't care about > that at all, i.e., a cosine will be treated exactly the same as a sine > wave, because the "filter" can't tell the difference.Sorry, I gave too much information and too little information at the same time. When pulling a discrete time sinusoid from a lookup table, cosine has amplitude at Nyquist while sine does not. sin(0) == 0, so you get absolutely nothing from the lookup. All I'm really saying is that I picked the peak of the waveform as my t=0 so that all frequencies would have amplitude. Now that I think about it, I'm not really using cosine, either, because I altered the phase of my sinusoid table generation to use the negative peak instead of the positive peak, because that is one sample value greater in twos-complement binary. But I still think you jumped a little too quickly in pointing out that continuous time sin and cos are identical except for phase, because it should have been clear from this entire thread that I was discussing discrete time sin and cos. Brian Willoughby
Spectrum compensation for zero-order hold DAC
Started by ●February 3, 2012
Reply by ●February 6, 20122012-02-06
Reply by ●February 6, 20122012-02-06
On 2012/02/05 14:27, Jerry Avins wrote:> On 2/5/2012 3:14 PM, Eric Jacobsen wrote: >> On Sun, 05 Feb 2012 14:01:34 -0500, Jerry Avins<jya@ieee.org> wrote: >>> On 2/5/2012 12:27 PM, Eric Jacobsen wrote: >>> >>> ... >>> >>>> It's approximately a 4dB drop in power, or a 2dB drop in amplitude. >>>> Just calculate the value of sinx/x at pi/2. >>> >>> ... >>> >>>> The amplitude drop will be half the power drop (in dB). Again, >>>> sinx/x at pi/2. >>> >>> When is a dB not a dB? 20*log(V1/V2) = 10*(P1/P2). >> >> Right. But the OP keeps mentioning amplitude rather than power, and >> 10*log(V1/V2) = 1/2 * 20*log(V1/V2). The power ratio is ~4 dB, and >> the OP says he's not seeing a 4dB drop. He'll see a 2dB drop if he's >> just taking the amplitude ratios, which might explain why he's not >> seeing 4dB. > > I think it's better to teach him how to calculate dBs than to keep him > happy by fudging the numbers. He'll see a 4 dB drop if he calculates > 20*log(amplitude_ratio)Thanks, guys. I may not have been looking at my analog scope closely enough to see a 10% drop from 5 Vpp. All the same, I do calculate 20*log(a) by habit. Also, thanks to Tim Wescott for pointing out the aliased energy. Ideally, there shouldn't be any aliased energy in a 'pure' sinusoid, but data is typically less than ideal. Brian Willoughby
Reply by ●February 6, 20122012-02-06
On 2/6/2012 8:37 AM, Brian Willoughby wrote: ...> Thanks, guys. I may not have been looking at my analog scope closely > enough to see a 10% drop from 5 Vpp. All the same, I do calculate > 20*log(a) by habit. > > > Also, thanks to Tim Wescott for pointing out the aliased energy. > Ideally, there shouldn't be any aliased energy in a 'pure' sinusoid, but > data is typically less than ideal.There might not be any 10% droop. The staircase adds harmonics (not aliases!) so we don't know what the peak will be without calculation. The 4 dB applies to the fundamental only, not the overall waveform after the S&H. Put differently, it's what to expect after the reconstruction filter that you don't have. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●February 6, 20122012-02-06
On Mon, 06 Feb 2012 05:37:39 -0800, Brian Willoughby <Sound_Consulting-RM-@Sounds-dot-wa.com> wrote:>On 2012/02/05 14:27, Jerry Avins wrote: >> On 2/5/2012 3:14 PM, Eric Jacobsen wrote: >>> On Sun, 05 Feb 2012 14:01:34 -0500, Jerry Avins<jya@ieee.org> wrote: >>>> On 2/5/2012 12:27 PM, Eric Jacobsen wrote: >>>> >>>> ... >>>> >>>>> It's approximately a 4dB drop in power, or a 2dB drop in amplitude. >>>>> Just calculate the value of sinx/x at pi/2. >>>> >>>> ... >>>> >>>>> The amplitude drop will be half the power drop (in dB). Again, >>>>> sinx/x at pi/2. >>>> >>>> When is a dB not a dB? 20*log(V1/V2) = 10*(P1/P2). >>> >>> Right. But the OP keeps mentioning amplitude rather than power, and >>> 10*log(V1/V2) = 1/2 * 20*log(V1/V2). The power ratio is ~4 dB, and >>> the OP says he's not seeing a 4dB drop. He'll see a 2dB drop if he's >>> just taking the amplitude ratios, which might explain why he's not >>> seeing 4dB. >> >> I think it's better to teach him how to calculate dBs than to keep him >> happy by fudging the numbers. He'll see a 4 dB drop if he calculates >> 20*log(amplitude_ratio) > >Thanks, guys. I may not have been looking at my analog scope closely >enough to see a 10% drop from 5 Vpp. All the same, I do calculate >20*log(a) by habit.Again, compute sinx/x at pi/2. The expected amplitude near fs/2 will be ~0.64 that what it is near DC. That's a lot more than 10%.>Also, thanks to Tim Wescott for pointing out the aliased energy. >Ideally, there shouldn't be any aliased energy in a 'pure' sinusoid, but >data is typically less than ideal.Without a reconstruction filter, as you've described, there most certainly should be aliases of the tone above fs/2. You can use the aliases to see the sinx/x sidelobe responses and nulls at integer multiples of the sample rate. Eric Jacobsen Anchor Hill Communications www.anchorhill.com
Reply by ●February 6, 20122012-02-06
On Sun, 05 Feb 2012 17:27:41 -0500, Jerry Avins <jya@ieee.org> wrote:>On 2/5/2012 3:14 PM, Eric Jacobsen wrote: >> On Sun, 05 Feb 2012 14:01:34 -0500, Jerry Avins<jya@ieee.org> wrote: >> >>> On 2/5/2012 12:27 PM, Eric Jacobsen wrote: >>> >>> ... >>> >>>> It's approximately a 4dB drop in power, or a 2dB drop in amplitude. >>>> Just calculate the value of sinx/x at pi/2. >>> >>> ... >>> >>>> The amplitude drop will be half the power drop (in dB). Again, >>>> sinx/x at pi/2. >>> >>> When is a dB not a dB? 20*log(V1/V2) = 10*(P1/P2). >> >> Right. But the OP keeps mentioning amplitude rather than power, and >> 10*log(V1/V2) = 1/2 * 20*log(V1/V2). The power ratio is ~4 dB, and >> the OP says he's not seeing a 4dB drop. He'll see a 2dB drop if he's >> just taking the amplitude ratios, which might explain why he's not >> seeing 4dB. > >I think it's better to teach him how to calculate dBs than to keep him >happy by fudging the numbers. He'll see a 4 dB drop if he calculates >20*log(amplitude_ratio)I wasn't trying to keep him happy, I was offering a possible explanation of how he may have come to the wrong, or at least confusing, answer. Eric Jacobsen Anchor Hill Communications www.anchorhill.com
Reply by ●February 6, 20122012-02-06
On 2/6/2012 12:07 PM, Eric Jacobsen wrote: ...> Without a reconstruction filter, as you've described, there most > certainly should be aliases of the tone above fs/2. You can use the > aliases to see the sinx/x sidelobe responses and nulls at integer > multiples of the sample rate.Eric, they're no more aliases than are the sidebands of an AM signal. Aliases can't be filtered out. These can be. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●February 6, 20122012-02-06
On Mon, 06 Feb 2012 13:12:32 -0500, Jerry Avins <jya@ieee.org> wrote:>On 2/6/2012 12:07 PM, Eric Jacobsen wrote: > > ... > >> Without a reconstruction filter, as you've described, there most >> certainly should be aliases of the tone above fs/2. You can use the >> aliases to see the sinx/x sidelobe responses and nulls at integer >> multiples of the sample rate. > >Eric, they're no more aliases than are the sidebands of an AM signal. >Aliases can't be filtered out. These can be. >I get modulators and demodulators mixed up all the time, too. Yeah, "image" is probably the more appropriate term. To me "alias" isn't completely inappropriate since the images are masquerading as the desired energy, just like a real alias does. Eric Jacobsen Anchor Hill Communications www.anchorhill.com
Reply by ●February 6, 20122012-02-06
On Mon, 06 Feb 2012 05:32:44 -0800, Brian Willoughby wrote:> On 2012/02/05 09:27, Eric Jacobsen wrote: >>> In either case, I'm talking about pure cosine wave data feeding the >>> DAC with full scale samples (which is why I use cosine, not sine, so >>> as to guarantee that frequencies at or near Nyquist actually have a >>> non-zero amplitude) and no following filter stage. >> >> This statement suggests you need to back up a bit and start with some >> more fundamental math. The difference between continuous sin and cos >> waves is only the relative phase, and the response doesn't care about >> that at all, i.e., a cosine will be treated exactly the same as a sine >> wave, because the "filter" can't tell the difference. > > Sorry, I gave too much information and too little information at the > same time. > > When pulling a discrete time sinusoid from a lookup table, cosine has > amplitude at Nyquist while sine does not. sin(0) == 0, so you get > absolutely nothing from the lookup. All I'm really saying is that I > picked the peak of the waveform as my t=0 so that all frequencies would > have amplitude. > > Now that I think about it, I'm not really using cosine, either, because > I altered the phase of my sinusoid table generation to use the negative > peak instead of the positive peak, because that is one sample value > greater in twos-complement binary. > > But I still think you jumped a little too quickly in pointing out that > continuous time sin and cos are identical except for phase, because it > should have been clear from this entire thread that I was discussing > discrete time sin and cos.There's really a singularity right at Nyquist. In the limit, as the sampling rate goes toward Nyquist and the observation time goes to infinity, the spectral component of the 'boxcar filtered' sine wave will, indeed, be about 4dB down. But _right at_ Nyquist reason breaks down a bit: you either have to claim that the _expected_ value of the wave, taken over a phase whose probability distribution is uniform from -pi to +pi, is 4dB down, or you have to say "ooh, Nyquist, bad juju" and refuse to do the calculation _right there_. If you get away from Nyquist the least bit, and average your results over at least one cycle of the beat frequency between signal frequency - Nyquist and Nyquist - signal frequency, then you'll find that you do, indeed, approach the 4dB down for the signal _at_ the signal frequency. -- My liberal friends think I'm a conservative kook. My conservative friends think I'm a liberal kook. Why am I not happy that they have found common ground? Tim Wescott, Communications, Control, Circuits & Software http://www.wescottdesign.com
Reply by ●February 6, 20122012-02-06
Tim Wescott <tim@seemywebsite.com> wrote: (snip)> There's really a singularity right at Nyquist. In the limit, as the > sampling rate goes toward Nyquist and the observation time goes to > infinity, the spectral component of the 'boxcar filtered' sine wave will, > indeed, be about 4dB down.> But _right at_ Nyquist reason breaks down a bit: you either have to claim > that the _expected_ value of the wave, taken over a phase whose > probability distribution is uniform from -pi to +pi, is 4dB down, or you > have to say "ooh, Nyquist, bad juju" and refuse to do the calculation > _right there_.If you get that close, you should consider that Nyquist only works for signals defined for all time (infinite time) or periodic. Most of the time, it is "close enough".> If you get away from Nyquist the least bit, and average your results over > at least one cycle of the beat frequency between signal frequency - > Nyquist and Nyquist - signal frequency, then you'll find that you do, > indeed, approach the 4dB down for the signal _at_ the signal frequency.-- glen
Reply by ●February 6, 20122012-02-06
On Mon, 06 Feb 2012 21:09:21 +0000, glen herrmannsfeldt wrote:> Tim Wescott <tim@seemywebsite.com> wrote: > > (snip) >> There's really a singularity right at Nyquist. In the limit, as the >> sampling rate goes toward Nyquist and the observation time goes to >> infinity, the spectral component of the 'boxcar filtered' sine wave >> will, indeed, be about 4dB down. > >> But _right at_ Nyquist reason breaks down a bit: you either have to >> claim that the _expected_ value of the wave, taken over a phase whose >> probability distribution is uniform from -pi to +pi, is 4dB down, or >> you have to say "ooh, Nyquist, bad juju" and refuse to do the >> calculation _right there_. > > If you get that close, you should consider that Nyquist only works for > signals defined for all time (infinite time) or periodic. > > Most of the time, it is "close enough".Well, that's the point I'm trying to make. To figure out what's going on when aliasing is happening you have to have an observation interval that's long enough to cleanly discriminate between all the frequencies involved. When you're close to Nyquist your first alias is close, too -- which means that your observation interval must increase. The closer you get, the longer you have to look, until you reach the limit where you're _at_ Nyquist and you have to look for an infinitely long period of time. Those infinite observation intervals can get tedious, though -- I've never been willing to wait that long. -- My liberal friends think I'm a conservative kook. My conservative friends think I'm a liberal kook. Why am I not happy that they have found common ground? Tim Wescott, Communications, Control, Circuits & Software http://www.wescottdesign.com






