DSPRelated.com
Forums

effects of variable sampling rate on spectrum of a signal

Started by Mitja Nemec April 15, 2011
On Apr 20, 4:43=A0am, Fred Marshall <fmarshallxremove_th...@acm.org>
wrote:
> RE: [On 4/18/2011 11:30 PM, Mitja Nemec wrote:] > > Mitja, > > OK, let me paraphrase back to see if I understand: > > You compare the nth output sample with the nth input sample where the > input samples are exactly periodic so the comparison could be viewed as > delayed one period or not ... it doesn't matter. > > The comparison generates an error which you use to do something.... > > So, it's understandable to me that this looks a bit like a "lock" type > of process even though the output frequency should track the input > frequency anyway, right? > > It's about distortion control it appears. > > Does that about sum it up? > > Was the reference helpful? > > Fred
I think you've sum it up correctly, and thank you for reference. Mitja Nemec
I've not studied this approach but the impression I'm getting is 
something like this:

You have a sine table in memory that never changes.
You have a matching "excitation" table that is used to drive the system.
You compare the sine table with the output and modify the excitation 
table accordingly.
So, the corrections are going to be delayed according to the system 
parameters it seems ..  and other scary thoughts ......

Rune mentions "noise" among other things.  It seems that if noise is 
prominent then, without filtering, using the correction table would 
*add* noise.  I'm sure that's all worked out along with system 
stability, etc.

Fred
On 04/19/2011 09:56 PM, Rune Allnor wrote:
> On Apr 19, 6:51 pm, Tim Wescott<t...@seemywebsite.com> wrote: >> On 04/18/2011 07:23 PM, Rune Allnor wrote: >> >> >> >> >> >>> On Apr 18, 7:06 pm, Tim Wescott<t...@seemywebsite.com> wrote: >>>> On 04/18/2011 03:23 AM, Rune Allnor wrote: >> >>>>> On Apr 18, 9:39 am, Mitja Nemec<kore...@yahoo.co.uk> wrote: >> >>>>>> ... or more specifically if number of samples per period is 1024, >> >>>>> As I said before, this is where you make the mistake. Despite >>>>> views that are often aired in this forum, one can never design >>>>> a practical system with such criteria in mind: One designe a >>>>> system with *some* sample rate (subject to some degree of jitter), >>>>> and the signal is *quasi* periodic to within *some* accuracy one >>>>> does not know. >> >>>> Rune, you are _not_ being clear, and given that you didn't answer my >>>> previous query for expansion on this it's rather frustrating. >> >>> *Somebody* is not being clear; I suspect it's the OP. >> >>>> What's the matter with 1024 samples, as long as the sampling rate is >>>> sufficient for his lowest frequency of excitation? >> >>> Who was talking about excitation? In the first post there was >>> talk about 'I don't want to use windows and I am worrying about >>> spectral leakage.' None of that has to do with exciatation. >>> It has to do with PSD measurements. >> >> The OP was, later. > > Later, yes. Not in his first post. > >> If you have a signal that's periodic enough, and at >> a known frequency, then you don't need windows. Period. > > Judging from classroom texts, one might get that impression. > >> That has to do >> with PSD measurements, too. The only question becomes "how do I know if >> it's periodic _enough_". > > No. No questions. One never know those thigs outside the > classroom concocted-hypothetical-what-if-excercise setting. > > In real life one needs to deal with imperfections like > > - Noise > - Nonlinearities > - All kinds of deviations from the simple models > > I'd expected that you, of all people (including the comp.dsp > regulars), should know this.
Well, I do. And if you go through my responses you'll see that I explicitly mention noise, and cover the other two with a statement about non-periodic components being known to be small. I made a statement that it depends on whether the signal is "periodic enough", and if I haven't expanded on that in this particular fiber within this branching thread, I certainly have elsewhere. The OP (or someone he pays :-) needs to go through the problem at hand to define if the signal is, indeed, periodic enough, meaning that any noise or other non-periodic components, plus any un-tracked frequency deviations, generate confounding results that are smaller than his desired measurement error. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On 04/20/2011 09:06 AM, Fred Marshall wrote:
> I've not studied this approach but the impression I'm getting is > something like this: > > You have a sine table in memory that never changes. > You have a matching "excitation" table that is used to drive the system. > You compare the sine table with the output and modify the excitation > table accordingly. > So, the corrections are going to be delayed according to the system > parameters it seems .. and other scary thoughts ...... > > Rune mentions "noise" among other things. It seems that if noise is > prominent then, without filtering, using the correction table would > *add* noise. I'm sure that's all worked out along with system stability, > etc.
Using the correction table without filtering would, indeed, add noise. And possibly some really weird instabilities where the oscillation not only moves in time, but also crawls up or down the signal period as it evolves. At the very least you'd need to pick the output sample that is most affected by the PWM adjustment on the input, and run an integrator at that spot. Adjacent spots will interact: running the integrator gain too high would make them interact too much. Ditto, the controllers (all 1024 of them) would respond to noise, so running the integrator gain too high would make the thing too responsive to noise, while running the integrator gain too low would make the thing respond too slowly to real needs for correction. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On Apr 19, 3:33=A0pm, Tim Wescott <t...@seemywebsite.com> wrote:
> On 04/18/2011 11:12 PM, Mitja Nemec wrote:
...
> > What if I want to > > have signal which consist of first and let say 10% of third harmonic. > > Then THD is not really a proper metrics to see how my output signal is > > close to the reference one, or could I expand the definiton of THD in > > this case to be (sum of all harmonics without first and third)/(sum of > > first and third harmonic)? > > You could define it that way, but what if you had some perverse case > where the distortion is substantially from 1st-harmonic to 3rd? =A0Your > proposed method is probably the best that you can do.
THD by definition assumes pure sinusoid exciting signal. what I imagine Mitja wants to measure is fidelity in following another exciting signal. In the particular case he described, a reasonable measure might be the (power) THD of the output less the THD of the exciting signal. (I don't understand how one can monitor but not measure.) Jerry -- Engineering is the art of making what you want from things you can get.
On 4/20/2011 1:03 PM, Jerry Avins wrote:
> THD by definition assumes pure sinusoid exciting signal. what I > imagine Mitja wants to measure is fidelity in following another > exciting signal. In the particular case he described, a reasonable > measure might be the (power) THD of the output less the THD of the > exciting signal. >
Jerry, Well, I am taking this out of context a bit but..... I can imagine THD being measured relative to a sinusoidal fundamental .. but not necessarily the *exciting* signal. For example, what about the output of a PWM switching amplifier meant to be a sinusoid? The excitation is something very different than the desired output. I'm led to this thought because of my notion of how the OP is doing waveform control. I described that in this thread recently. Fred
On 4/20/2011 9:54 AM, Tim Wescott wrote:
> On 04/20/2011 09:06 AM, Fred Marshall wrote: >> I've not studied this approach but the impression I'm getting is >> something like this: >> >> You have a sine table in memory that never changes. >> You have a matching "excitation" table that is used to drive the system. >> You compare the sine table with the output and modify the excitation >> table accordingly. >> So, the corrections are going to be delayed according to the system >> parameters it seems .. and other scary thoughts ...... >> >> Rune mentions "noise" among other things. It seems that if noise is >> prominent then, without filtering, using the correction table would >> *add* noise. I'm sure that's all worked out along with system stability, >> etc. > > Using the correction table without filtering would, indeed, add noise. > And possibly some really weird instabilities where the oscillation not > only moves in time, but also crawls up or down the signal period as it > evolves. > > At the very least you'd need to pick the output sample that is most > affected by the PWM adjustment on the input, and run an integrator at > that spot. Adjacent spots will interact: running the integrator gain too > high would make them interact too much. Ditto, the controllers (all 1024 > of them) would respond to noise, so running the integrator gain too high > would make the thing too responsive to noise, while running the > integrator gain too low would make the thing respond too slowly to real > needs for correction. >
Heh. I knew you'd have it pretty much all down pat and it's great to have your inputs! OT: I listened to a podcast today about stuxnet virus .. pretty interesting. Fred
On Apr 20, 6:45=A0pm, Fred Marshall <fmarshallxremove_th...@acm.org>
wrote:
> On 4/20/2011 1:03 PM, Jerry Avins wrote: > > > THD by definition assumes pure sinusoid exciting signal. what I > > imagine Mitja wants to measure is fidelity in following another > > exciting signal. In the particular case he described, a reasonable > > measure might be the (power) THD of the output less the THD of the > > exciting signal. > > Jerry, > > Well, I am taking this out of context a bit but..... > > I can imagine THD being measured relative to a sinusoidal fundamental .. > but not necessarily the *exciting* signal. =A0For example, what about the > output of a PWM switching amplifier meant to be a sinusoid? =A0The > excitation is something very different than the desired output.
The type of Class D amplifier I had in mind starts with an analog signal and generates the PWM signal intended to reproduce it. There's no real way to nail down just the distortion of the power stage and output filter.
> I'm led to this thought because of my notion of how the OP is doing > waveform control. =A0I described that in this thread recently.
What I got out of that description didn't deflect my preconceptions! Jerry -- Engineering is the art of making what you want from things you can get.
Jerry Avins <jya@ieee.org> wrote:

(snip, someone wrote)
>> I can imagine THD being measured relative to a sinusoidal fundamental .. >> but not necessarily the *exciting* signal. &#4294967295;For example, what about the >> output of a PWM switching amplifier meant to be a sinusoid? &#4294967295;The >> excitation is something very different than the desired output.
> The type of Class D amplifier I had in mind starts with an analog > signal and generates the PWM signal intended to reproduce it. There's > no real way to nail down just the distortion of the power stage and > output filter.
Even if the input was a digitized sine, you should still be able to determine the THD relative to the sine, though there would also be quantization noise. That should be small enough that you can ignore it for any real amplifier. It does seem an interesting idea to go directly from PCM data to a class D amplifier. That is, no ADC followed by a conversion to PWM.
>> I'm led to this thought because of my notion of how the OP is doing >> waveform control. &#4294967295;I described that in this thread recently.
> What I got out of that description didn't deflect my preconceptions!
-- glen

glen herrmannsfeldt wrote:


> It does seem an interesting idea to go directly from PCM data > to a class D amplifier. That is, no ADC followed by a conversion > to PWM.
Direct PCM to PWM is typically done in the low-end amplifier ICs. This method suffers from distortions and imperfections of all kinds. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com