Reply by glen herrmannsfeldt February 7, 20072007-02-07
Jerry Avins wrote:

> glen herrmannsfeldt wrote:
(snip)
>> Yes, I wasn't too serious about that one. At the time I was wondering >> what half cycle meant when the current and voltage are not in phase. >> You then have to say which (current or voltage) you use to measure >> cycles. The OP explained the problem in more detail today.
> I haven't read today's message yet. A half cycle needn't start and end > at zero crossings. In fact, it can't do both in the presence of second > harmonic. A half cycle can start at arbitrary phase and continue for 180 > degrees.
Some time ago I suggested a PLL locked to 60Hz. That would follow slow changes in frequency, but (hopefully) ignore other changes, such as noise caused zero crossing. That also allows easy production of a multiple of the line frequency for synchronous sampling. Thinking about it in terms of a second harmonic, that may be why you want to measure it on a half cycle. You can then determine the second harmonic content. One might just as well compute all the significant harmonics, though. -- glen
Reply by glen herrmannsfeldt February 7, 20072007-02-07
Jerry Avins wrote:
(snip)

> If electrical garbage bred germs, most of us would be terminally ill. > There's a tremendous amount of garbage on power lines, and I don't mean > just sneakers hanging by their laces. You can hear some of the older > thyristor lamp dimmers on an AM radio. I can hear leaky pole insulators > on the AM radio in my car.
Seattle has an electric bus system (a fraction of the whole system) that seem to run on DC with a converter inside the bus. The converter runs at somewhat higher than 60Hz (or maybe three phase at 60Hz), that you can easily hear on an AM radio while under or near the bus wires when a bus starts up.
> Years ago, I made a lamp dimmer for an inside room that consists of a > two-on, center off switch that closes the circuit directly when up and > through a diode when down. Consider the poor pole transformer. They say > it can't pass DC, but pulsating DC is what the dimmed lamp runs on. So > where does the DC come from?
If there are other (resistive) devices on the line, some of it might goes through them. When the diode turns off, there will be an LdI/dt across other devices on the line. That might make up some of the difference. Otherwise, there would be a DC current through the secondary lost as heat. Presumably in cases where the load is a large fraction of the transformer rated load, this loss must be considered. I presume this is one reason for the popularity of other types of rectifiers. (Though simpler filtering is probably a more important reason.) ---------------------------------- My favorite rectifier circuit is the one used on most computer power supplies that conveniently allows for switchable 120/240 operation. On 240V it is a bridge rectifier into two capacitors in series, resulting in about 300VDC. For 120V close a switch between the capacitor center tap and one side of the AC line, it becomes a voltage doubler again supplying about 300VDC. The 300VDC then gets converted to about 20kHz and into a ferrite core transformer. -- glen
Reply by Jerry Avins February 7, 20072007-02-07
robert bristow-johnson wrote:

   ...

> Jerry pointed out to me that this assumption is *not* reliable for AC > power signals (which was my previous thought). in that case, zero- > crossing is not legitimate since there are possibly more than two zero > crossings per period (something i did not expect).
If electrical garbage bred germs, most of us would be terminally ill. There's a tremendous amount of garbage on power lines, and I don't mean just sneakers hanging by their laces. You can hear some of the older thyristor lamp dimmers on an AM radio. I can hear leaky pole insulators on the AM radio in my car. Years ago, I made a lamp dimmer for an inside room that consists of a two-on, center off switch that closes the circuit directly when up and through a diode when down. Consider the poor pole transformer. They say it can't pass DC, but pulsating DC is what the dimmed lamp runs on. So where does the DC come from? Discussion on request. :-) Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply by robert bristow-johnson February 7, 20072007-02-07
On Feb 7, 12:59 pm, "fizteh89" <d...@soundmathtech.com> wrote:
> > "legitimate pitch detection" ??? :-) > > With more than 400 issued and pending US patents in 704/207 alone, > related to various minor and obvious improvements of correlation, > AMDF or frequency based pitch-detection techniques, the pitch > detection you are proposing might as well be "illegitimate", without > him actually knowing it :)
i was sorta expecting you to pipe in about this after my Feb 4 post to this thread, Dmitry. glad you're here. i don't consider "auto-correlation", "AMDF", or "frequency-domain" to be completely descriptive terms. there are several ways to do pitch detection using any of these. some of these "various minor and obvious improvements" are in patents, some are not, some of those that are not are published in some old IEEE journal, others are (ostensible) trade secrets. some haven't been thunk of yet. some are not so minor or obvious and are repackaged and obfuscated in so-called "new" techniques. some of those, though neither minor nor obvious, are yet to be demonstrated as improvements for some classes of input signal. some (like zero-crossing) make assumptions about the nature of the input signal that can only be reliable for certain signal classes. Jerry pointed out to me that this assumption is *not* reliable for AC power signals (which was my previous thought). in that case, zero- crossing is not legitimate since there are possibly more than two zero crossings per period (something i did not expect). r b-j
Reply by fizteh89 February 7, 20072007-02-07
On Feb 7, 12:45 pm, "robert bristow-johnson"
<r...@audioimagination.com> wrote:
> On Feb 7, 12:16 pm, Jerry Avins <j...@ieee.org> wrote: > > > > > > > robert bristow-johnson wrote: > > > ... > > > > since you're signal is mostly sinusoidal > > > Don't bet on that! Very substantial third harmonic components can be > > introduced by transformer and motor iron. Power thyristors can make the > > line currents look real funny! > > > > you can still use a zero- > > > crossing detector (detect zero crossing with only positive slope or > > > only negative slope) to get the difference in samples between zero > > > crossings. > > > Provided SCR spikes don't make multiple zero crossings. Light low-pass > > filtering should fix that. > > well, then Pierre will need to do more legitimate pitch detection like > we do for audio waveforms. you know, AMDF or ASDF or > autocorrelation. since he's using a SHArC, he oughta have plenty of > computational muscle to do that. > > r b-j- Hide quoted text - > > - Show quoted text -
"legitimate pitch detection" ??? :-) With more than 400 issued and pending US patents in 704/207 alone, related to various minor and obvious improvementns of correlation, AMDF or frequency based pitch-detection techniques, the pitch detection you are proposing might as well be "illegitimate", without him actually knowing it :)
Reply by robert bristow-johnson February 7, 20072007-02-07
On Feb 7, 12:16 pm, Jerry Avins <j...@ieee.org> wrote:
> robert bristow-johnson wrote: > > ... > > > since you're signal is mostly sinusoidal > > Don't bet on that! Very substantial third harmonic components can be > introduced by transformer and motor iron. Power thyristors can make the > line currents look real funny! > > > you can still use a zero- > > crossing detector (detect zero crossing with only positive slope or > > only negative slope) to get the difference in samples between zero > > crossings. > > Provided SCR spikes don't make multiple zero crossings. Light low-pass > filtering should fix that.
well, then Pierre will need to do more legitimate pitch detection like we do for audio waveforms. you know, AMDF or ASDF or autocorrelation. since he's using a SHArC, he oughta have plenty of computational muscle to do that. r b-j
Reply by Jerry Avins February 7, 20072007-02-07
robert bristow-johnson wrote:

   ...

> since you're signal is mostly sinusoidal
Don't bet on that! Very substantial third harmonic components can be introduced by transformer and motor iron. Power thyristors can make the line currents look real funny!
> you can still use a zero- > crossing detector (detect zero crossing with only positive slope or > only negative slope) to get the difference in samples between zero > crossings.
Provided SCR spikes don't make multiple zero crossings. Light low-pass filtering should fix that.
> then that number, which would always be an integer even > though it is unlikely your period will be an integer number of > samples, is input to a LPF with DC gain of 1 (0 dB). that will > average out the integer valued inputs and give you a very accurate > measure of the period (in fractional samples). with that value you > can resample the input accurately to 128 or some fixed number of > samples per period. > > also, for RMS, don't bother with Simpson's rule or anything like > that : square the sample value and input that into a similar LPF (with > DC gain of 1) and square-root the output.
I'm still curious about the requirement for a power number every cycle. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
Reply by Jerry Avins February 7, 20072007-02-07
glen herrmannsfeldt wrote:
> Jerry Avins wrote: > (I wrote) > >>> How about computing separately half cycle current, half cycle voltage, >>> and phase shift. Then multiply current, voltage, and cos(phase shift). > >> Harmonics can create asymmetries that could be a problem for the half >> cycle approach. The current and voltage samples ideally need to be >> simultaneous and must in any case be nearly so. > > Yes, I wasn't too serious about that one. At the time I was wondering > what half cycle meant when the current and voltage are not in phase. > You then have to say which (current or voltage) you use to measure > cycles. The OP explained the problem in more detail today.
I haven't read today's message yet. A half cycle needn't start and end at zero crossings. In fact, it can't do both in the presence of second harmonic. A half cycle can start at arbitrary phase and continue for 180 degrees. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
Reply by glen herrmannsfeldt February 7, 20072007-02-07
> "robert bristow-johnson" <rbj@audioimagination.com> wrote in message
(snip)
>also, for RMS, don't bother with Simpson's rule or anything like >that : square the sample value and input that into a similar LPF (with >DC gain of 1) and square-root the output.
There is an interesting discussion of Simpson's rule, I believe in Numerical Recipes. First they consider integrating with Simpson's rule. Next, the do the same integral with one step of trapezoid, followed by Simpson's rule, and the final step trapezoid. The result is then good to the same order as using Simpson's rule as only 2 out of N steps are done with trapezoid. Next, average the two, which interleaves the alternating 2/3, 4/3 of Simpson, except for the first two and last two integration points. -- glen
Reply by Pierre de Vos February 7, 20072007-02-07
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message 
news:1170727783.164507.118270@k78g2000cwa.googlegroups.com...
> On Feb 5, 1:27 pm, "Pierre de Vos" <pierre.de...@webmail.co.za> wrote: >> >> Back to the problem at hand: I'm doing a new design and would like to >> achieve an accuracy (of power) in the region of 0.005% or better. I'm >> changing to a ADSP-21262 floating point Sharc and redesigning the >> analogue >> circuits. At the same time I want to look at the DSP algorithms to see >> if I >> can't squeeze out a bit more accuracy. Therefore the original question. >> The method I followed previously does introduce some jitter and I'm >> looking >> at going for fixed sampling rate this time (at a higher rate). I had to >> do >> a lot of work to implement points 1 to 6 above and would like to re-use >> some >> of the code if possible. >> >> Knowing little about multirate systems I thought that it might be >> possible >> (on the new more powerfull dsp) to manipulate the incoming samples to >> always >> have the required amount per cycle. I know that for this to work an >> accurate period measurement must still be made, but hoping with the new >> dsp >> I can do this in software instead of with a zero-crossing detector. > > since you're signal is mostly sinusoidal, you can still use a zero- > crossing detector (detect zero crossing with only positive slope or > only negative slope) to get the difference in samples between zero > crossings. then that number, which would always be an integer even > though it is unlikely your period will be an integer number of > samples, is input to a LPF with DC gain of 1 (0 dB). that will > average out the integer valued inputs and give you a very accurate > measure of the period (in fractional samples). with that value you > can resample the input accurately to 128 or some fixed number of > samples per period. > > also, for RMS, don't bother with Simpson's rule or anything like > that : square the sample value and input that into a similar LPF (with > DC gain of 1) and square-root the output. > > rot's o' ruk with this. > > r b-j > >
r-b-j, Good idea, I will try...