DSPRelated.com
Forums

90 degrees phase shift

Started by Giuseppe Sbarra July 1, 2005
Jerry Avins <jya@ieee.org> wrote in news:1a2dnaLjOeptYljfRVn-gg@rcn.net:

> .TheGhost wrote: >> Jerry Avins <jya@ieee.org> wrote in >> news:lMWdnZN04tN6e1jfRVn-2Q@rcn.net: > > ... > >>>There are better ways to design a digital all-pass filter pair to >>>achieve relative quadrature. The best you can do analog over a >>>decade is about half a degree. With a digital pair you do better than >>>that over a wider band. >> >> >> >> Then, perhaps you should provide the original poster with some >> references that will help him get started. > > I'm hazy on the details. I think Randy Yates can provide them > succinctly. Although I don't always succeed, I try very hard not to > misinform, keeping mum when I know that I don't know. > > Jerry
Perhaps in the future you should refrain from making claims that you can't back up.
".TheGhost" <theghost@google.com> wrote in
news:rBmxe.28618$1C7.21284@fe12.news.easynews.com: 

> Jerry Avins <jya@ieee.org> wrote in > news:lMWdnZN04tN6e1jfRVn-2Q@rcn.net: > >> TheGhost. wrote: >>> "Giuseppe Sbarra" <giuseppe_sbarra@tin.it> wrote in >>> news:q9exe.101452$75.4536009@news4.tin.it: >>> >>> >>>>Hi, >>>>I'm an hold analog engineer , actually developing a DSP based >>>>application and I need to change of 90 degrees the phase of a signal >>>>on the range of 50 - 250 Hz aving the system a 200uSec sampling >>>>rate. I have considered the Hilbert FIR filter but for the moment I >>>>cannot get it to work not even reducing the sampling rate. >>>>In particular I nedd to phase shift by 90 degrees a signal (voltage) >>>>respect to another (current) in order to calculate the instantaneous >>>>REACTIVE power by a simple multiplication. >>>> >>>>Any suggestion would be very appreciated. >>>>Thanks everybody >>>> >>> >>> >>> Wideband 90-degree phase shift networks are used in the phasing >>> method of single sideband generation. The network consists of two >>> sets of cascaded second-order all-pass sections which maintain a 90 >>> degree phase difference to within a specified accuracy over a >>> specified bandwidth. An introduction to the design of analog >>> 90-degree phase shift networks can be found at: >>> http://home.att.net/~wa1sov/technical/allpass/allpass.html Once you >>> have the pole-zero locations, you should be able to implement the >>> filter digitally. >> >> There are better ways to design a digital all-pass filter pair to >> achieve relative quadrature. The best you can do analog over a >> decade is about half a degree. With a digital pair you do better than >> that over a wider band. >> >> Jerry > > > Then, perhaps you should provide the original poster with some > references that will help him get started. > > >
A very good discussion on hilbert transforms is in Rick Lyons' book: Understanding Digital Signal Processing (Second Edition). It is often available at the local Barnes & Noble or Borders as well as Amazon. -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
Al Clark <dsp@danvillesignal.com> wrote in 
news:Xns9686E7F923399aclarkdanvillesignal@66.133.129.71:

> ".TheGhost" <theghost@google.com> wrote in > news:rBmxe.28618$1C7.21284@fe12.news.easynews.com: > >> Jerry Avins <jya@ieee.org> wrote in >> news:lMWdnZN04tN6e1jfRVn-2Q@rcn.net: >> >>> TheGhost. wrote: >>>> "Giuseppe Sbarra" <giuseppe_sbarra@tin.it> wrote in >>>> news:q9exe.101452$75.4536009@news4.tin.it: >>>> >>>> >>>>>Hi, >>>>>I'm an hold analog engineer , actually developing a DSP based >>>>>application and I need to change of 90 degrees the phase of a signal >>>>>on the range of 50 - 250 Hz aving the system a 200uSec sampling >>>>>rate. I have considered the Hilbert FIR filter but for the moment I >>>>>cannot get it to work not even reducing the sampling rate. >>>>>In particular I nedd to phase shift by 90 degrees a signal (voltage) >>>>>respect to another (current) in order to calculate the instantaneous >>>>>REACTIVE power by a simple multiplication. >>>>> >>>>>Any suggestion would be very appreciated. >>>>>Thanks everybody >>>>> >>>> >>>> >>>> Wideband 90-degree phase shift networks are used in the phasing >>>> method of single sideband generation. The network consists of two >>>> sets of cascaded second-order all-pass sections which maintain a 90 >>>> degree phase difference to within a specified accuracy over a >>>> specified bandwidth. An introduction to the design of analog >>>> 90-degree phase shift networks can be found at: >>>> http://home.att.net/~wa1sov/technical/allpass/allpass.html Once you >>>> have the pole-zero locations, you should be able to implement the >>>> filter digitally. >>> >>> There are better ways to design a digital all-pass filter pair to >>> achieve relative quadrature. The best you can do analog over a >>> decade is about half a degree. With a digital pair you do better than >>> that over a wider band. >>> >>> Jerry >> >> >> Then, perhaps you should provide the original poster with some >> references that will help him get started. >> >> >> > > A very good discussion on hilbert transforms is in Rick Lyons' book: > Understanding Digital Signal Processing (Second Edition). It is often > available at the local Barnes & Noble or Borders as well as Amazon.
Doesn't the implementation of a Hilbert transform typically involve an FFT and require a time-domain window? If so, it does not provide an accurate real-time output such as that obtained by direct digital and/or analog real-time filtering?
TheGhost. wrote:
> Tim Wescott <tim@seemywebsite.com> wrote in > news:11cbep3v3id1d9@corp.supernews.com: > > >>Pierre de Vos wrote: >> >> >>>"Tim Wescott" <tim@seemywebsite.com> wrote in message >>>news:11cath1cpvl3i29@corp.supernews.com... >>> >>> >>>>Giuseppe Sbarra wrote: >>>> >>>> >>>> >>>>>Hi, >>>>>I'm an hold analog engineer , actually developing a DSP based >>>>>application and I need to change of 90 degrees the phase of a signal >>>>>on the range of 50 - 250 Hz aving the system a 200uSec sampling >>>>>rate. I have considered the Hilbert FIR filter but for the moment I >>>>>cannot get it >>>>>to work not even reducing the sampling rate. >>>>>In particular I nedd to phase shift by 90 degrees a signal (voltage) >>>>>respect >>>>>to another (current) in order to calculate the instantaneous >>>>>REACTIVE power >>>>>by a simple multiplication. >>>>> >>>>>Any suggestion would be very appreciated. >>>>>Thanks everybody >>>>> >>>>> >>>> >>>>I'm not sure why your hilbert transform wouldn't be working so I >>>>can't comment on it. >>>> >>>>On the other hand, if you were to compute the RMS value of the >>>>voltage and current and compute the mean power then the reactive >>>>"power" should be >>>> >>>>Vrms * Irms - real power. >>>> >>>>That's how I'd do it. >>>> >>> >>>Surely that is'nt true >>> >>>V*I=S=sqrt(P^2 +Q^2) >>>so >>>reactive power = Q = sqrt(S^2 - P^2) >>> >> >>Well, I'll be dipped in shaving cream. Thank you for finding my >>error. >> >>It's still an easier calculation than the Hilbert Transform, though. >> >>------------------------------------------- >>Tim Wescott >>Wescott Design Services >>http://www.wescottdesign.com > > > > You also missed the stipulation that a calculation of instantaneous power > was required. >
Reactive power cannot be truely instantaneous since it involves current flowing when voltage is zero and visa-versa, AND a hilbert transform does a healthy amount of time-domain smearing. For the measurement to have any meaning, whether done by Hilbert transform or my suggested method, there will have to be either real or implicit averaging done. But you are correct, and the OP needs to think about what he really meant. ------------------------------------------- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Mr. Negative wrote:

> Al Clark <dsp@danvillesignal.com> wrote in > news:Xns9686E7F923399aclarkdanvillesignal@66.133.129.71: >
snip
>> >>A very good discussion on hilbert transforms is in Rick Lyons' book: >>Understanding Digital Signal Processing (Second Edition). It is often >>available at the local Barnes & Noble or Borders as well as Amazon. > > > Doesn't the implementation of a Hilbert transform typically involve an FFT > and require a time-domain window? If so, it does not provide an accurate > real-time output such as that obtained by direct digital and/or analog > real-time filtering? >
No, it does not require an FFT. I'm not sure what you mean by "time-domain window" but if you mean the data must be windowed prior to being run through a Hilbert transform -- no. Your suggestion of following the old SSB practice of matched filters does have merit in that an IIR filter will have slightly less delay which would be important if the OP seeks the illusion of "instantanious reactive power", but I suspect that the amount of averaging needed to get a good reading on the reactive power measurement will be significantly higher than the amount of delay that you'd add using a FIR Hilbert transform. -- ------------------------------------------- Tim Wescott Wescott Design Services http://www.wescottdesign.com
".TheGhost" <theghost@sbcglobal.net> wrote in
news:qeoxe.26918$4g1.25678@fe11.news.easynews.com: 

> Al Clark <dsp@danvillesignal.com> wrote in > news:Xns9686E7F923399aclarkdanvillesignal@66.133.129.71: > >> ".TheGhost" <theghost@google.com> wrote in >> news:rBmxe.28618$1C7.21284@fe12.news.easynews.com: >> >>> Jerry Avins <jya@ieee.org> wrote in >>> news:lMWdnZN04tN6e1jfRVn-2Q@rcn.net: >>> >>>> TheGhost. wrote: >>>>> "Giuseppe Sbarra" <giuseppe_sbarra@tin.it> wrote in >>>>> news:q9exe.101452$75.4536009@news4.tin.it: >>>>> >>>>> >>>>>>Hi, >>>>>>I'm an hold analog engineer , actually developing a DSP based >>>>>>application and I need to change of 90 degrees the phase of a >>>>>>signal on the range of 50 - 250 Hz aving the system a 200uSec >>>>>>sampling rate. I have considered the Hilbert FIR filter but for >>>>>>the moment I cannot get it to work not even reducing the sampling >>>>>>rate. In particular I nedd to phase shift by 90 degrees a signal >>>>>>(voltage) respect to another (current) in order to calculate the >>>>>>instantaneous REACTIVE power by a simple multiplication. >>>>>> >>>>>>Any suggestion would be very appreciated. >>>>>>Thanks everybody >>>>>> >>>>> >>>>> >>>>> Wideband 90-degree phase shift networks are used in the phasing >>>>> method of single sideband generation. The network consists of two >>>>> sets of cascaded second-order all-pass sections which maintain a >>>>> 90 degree phase difference to within a specified accuracy over a >>>>> specified bandwidth. An introduction to the design of analog >>>>> 90-degree phase shift networks can be found at: >>>>> http://home.att.net/~wa1sov/technical/allpass/allpass.html Once >>>>> you have the pole-zero locations, you should be able to implement >>>>> the filter digitally. >>>> >>>> There are better ways to design a digital all-pass filter pair to >>>> achieve relative quadrature. The best you can do analog over a >>>> decade is about half a degree. With a digital pair you do better >>>> than that over a wider band. >>>> >>>> Jerry >>> >>> >>> Then, perhaps you should provide the original poster with some >>> references that will help him get started. >>> >>> >>> >> >> A very good discussion on hilbert transforms is in Rick Lyons' book: >> Understanding Digital Signal Processing (Second Edition). It is often >> available at the local Barnes & Noble or Borders as well as Amazon. > > Doesn't the implementation of a Hilbert transform typically involve an > FFT and require a time-domain window? If so, it does not provide an > accurate real-time output such as that obtained by direct digital > and/or analog real-time filtering? > > >
No, it is usually done with an antisymetric FIR. It is convenient to use an odd length FIR for this purpose so that the real part can be obtained by a grabbing the middle tap of the FIR delay line. You are certainly correct in that an FFT can be used for this purpose. It just is usually way more complicated than necessary. The catch to the FIR method is that the imaginary part is constructed by a bandpass filter. You want the signal of interest to be in the passband. This means that the length needs to be long if the desired signal is either near DC or near f/2. This makes intuitive sense if you consider the required length of a filter to delay DC by 90 degrees. If I remember the details of the orginal post, the length of the FIR filter for this application should be fairly small provided that fs is not too high. -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
Tim Wescott wrote:
> TheGhost. wrote: > >> Tim Wescott <tim@seemywebsite.com> wrote in >> news:11cbep3v3id1d9@corp.supernews.com: >> >>> Pierre de Vos wrote: >>> >>> >>>> "Tim Wescott" <tim@seemywebsite.com> wrote in message >>>> news:11cath1cpvl3i29@corp.supernews.com... >>>> >>>> >>>>> Giuseppe Sbarra wrote: >>>>> >>>>> >>>>> >>>>>> Hi, >>>>>> I'm an hold analog engineer , actually developing a DSP based >>>>>> application and I need to change of 90 degrees the phase of a signal >>>>>> on the range of 50 - 250 Hz aving the system a 200uSec sampling >>>>>> rate. I have considered the Hilbert FIR filter but for the moment I >>>>>> cannot get it >>>>>> to work not even reducing the sampling rate. >>>>>> In particular I nedd to phase shift by 90 degrees a signal (voltage) >>>>>> respect >>>>>> to another (current) in order to calculate the instantaneous >>>>>> REACTIVE power >>>>>> by a simple multiplication. >>>>>> >>>>>> Any suggestion would be very appreciated. >>>>>> Thanks everybody >>>>>> >>>>>> >>>>> >>>>> I'm not sure why your hilbert transform wouldn't be working so I >>>>> can't comment on it. >>>>> >>>>> On the other hand, if you were to compute the RMS value of the >>>>> voltage and current and compute the mean power then the reactive >>>>> "power" should be >>>>> Vrms * Irms - real power. >>>>> >>>>> That's how I'd do it. >>>>> >>>> >>>> Surely that is'nt true >>>> >>>> V*I=S=sqrt(P^2 +Q^2) >>>> so >>>> reactive power = Q = sqrt(S^2 - P^2) >>>> >>> >>> Well, I'll be dipped in shaving cream. Thank you for finding my >>> error. >>> It's still an easier calculation than the Hilbert Transform, though. >>> >>> ------------------------------------------- >>> Tim Wescott >>> Wescott Design Services >>> http://www.wescottdesign.com >> >> >> >> >> You also missed the stipulation that a calculation of instantaneous >> power was required. >> > Reactive power cannot be truely instantaneous since it involves current > flowing when voltage is zero and visa-versa, AND a hilbert transform > does a healthy amount of time-domain smearing. > > For the measurement to have any meaning, whether done by Hilbert > transform or my suggested method, there will have to be either real or > implicit averaging done. > > But you are correct, and the OP needs to think about what he really meant.
Instantaneous power can be positive or negative, but it is always real. It is the product of instantaneous voltage and instantaneous current; both real. "Instantaneous reactive power" is not defined, nor is RMS power. Real and reactive power are quantities obtained by averaging over complete cycles of the fundamental. Neither instantaneous voltages nor currents are associated with a phase. Consider: i_C (current through a capacitor) = C*dv/dt Let v = sin(wt); then i = C*cos(wt) By definition, Z = v/i For a capacitor, Z = sin(wt)/c*cos(wt) = tan(wt)/C Ignore the distinction between RMS and instantaneous quantities only at peril. Z doesn't equal v/i. It equals V/I. I should have picked this up sooner. Sorry! 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;
.TheGhost wrote:
> Al Clark <dsp@danvillesignal.com> wrote in > news:Xns9686E7F923399aclarkdanvillesignal@66.133.129.71: > > >>".TheGhost" <theghost@google.com> wrote in >>news:rBmxe.28618$1C7.21284@fe12.news.easynews.com: >> >> >>>Jerry Avins <jya@ieee.org> wrote in >>>news:lMWdnZN04tN6e1jfRVn-2Q@rcn.net: >>> >>> >>>>TheGhost. wrote: >>>> >>>>>"Giuseppe Sbarra" <giuseppe_sbarra@tin.it> wrote in >>>>>news:q9exe.101452$75.4536009@news4.tin.it: >>>>> >>>>> >>>>> >>>>>>Hi, >>>>>>I'm an hold analog engineer , actually developing a DSP based >>>>>>application and I need to change of 90 degrees the phase of a signal >>>>>>on the range of 50 - 250 Hz aving the system a 200uSec sampling >>>>>>rate. I have considered the Hilbert FIR filter but for the moment I >>>>>>cannot get it to work not even reducing the sampling rate. >>>>>>In particular I nedd to phase shift by 90 degrees a signal (voltage) >>>>>>respect to another (current) in order to calculate the instantaneous >>>>>>REACTIVE power by a simple multiplication. >>>>>> >>>>>>Any suggestion would be very appreciated. >>>>>>Thanks everybody >>>>>> >>>>> >>>>> >>>>>Wideband 90-degree phase shift networks are used in the phasing >>>>>method of single sideband generation. The network consists of two >>>>>sets of cascaded second-order all-pass sections which maintain a 90 >>>>>degree phase difference to within a specified accuracy over a >>>>>specified bandwidth. An introduction to the design of analog >>>>>90-degree phase shift networks can be found at: >>>>>http://home.att.net/~wa1sov/technical/allpass/allpass.html Once you >>>>>have the pole-zero locations, you should be able to implement the >>>>>filter digitally. >>>> >>>>There are better ways to design a digital all-pass filter pair to >>>>achieve relative quadrature. The best you can do analog over a >>>>decade is about half a degree. With a digital pair you do better than >>>>that over a wider band. >>>> >>>>Jerry >>> >>> >>>Then, perhaps you should provide the original poster with some >>>references that will help him get started. >>> >>> >>> >> >>A very good discussion on hilbert transforms is in Rick Lyons' book: >>Understanding Digital Signal Processing (Second Edition). It is often >>available at the local Barnes & Noble or Borders as well as Amazon. > > > Doesn't the implementation of a Hilbert transform typically involve an FFT > and require a time-domain window? If so, it does not provide an accurate > real-time output such as that obtained by direct digital and/or analog > real-time filtering?
There is no possibility of a real-time RMS reading. 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;
"Erik de Castro Lopo" <nospam@mega-nerd.com> ha scritto nel messaggio
news:42C5BF76.D080A3E2@mega-nerd.com...
> Giuseppe Sbarra wrote: > > > > Hi, > > I'm an hold analog engineer , actually developing a DSP based
application
> > and I need to change of 90 degrees the phase of a signal on the range of > > 50 - 250 Hz aving the system a 200uSec sampling rate. > > I have considered the Hilbert FIR filter but for the moment I cannot get
it
> > to work not even reducing the sampling rate. > > In particular I nedd to phase shift by 90 degrees a signal (voltage)
respect
> > to another (current) in order to calculate the instantaneous REACTIVE
power
> > by a simple multiplication. > > If you are using an FIR hilbert transform, you need to remember that > there is a transport delay in the FIR filter and you need to delay > the unfiltered version as well. > > Erik > --
Hi Erik, I already tried this with a number of delay equal to half the order of the filter, is this right? Thank you Giuseppe
Giuseppe Sbarra wrote:
> "Erik de Castro Lopo" <nospam@mega-nerd.com> ha scritto nel messaggio > news:42C5BF76.D080A3E2@mega-nerd.com... > >>Giuseppe Sbarra wrote: >> >>>Hi, >>>I'm an hold analog engineer , actually developing a DSP based > > application > >>>and I need to change of 90 degrees the phase of a signal on the range of >>>50 - 250 Hz aving the system a 200uSec sampling rate. >>>I have considered the Hilbert FIR filter but for the moment I cannot get > > it > >>>to work not even reducing the sampling rate. >>>In particular I nedd to phase shift by 90 degrees a signal (voltage) > > respect > >>>to another (current) in order to calculate the instantaneous REACTIVE > > power > >>>by a simple multiplication. >> >>If you are using an FIR hilbert transform, you need to remember that >>there is a transport delay in the FIR filter and you need to delay >>the unfiltered version as well. >> >>Erik >>-- > > Hi Erik, > I already tried this with a number of delay equal to half the order of the > filter, > is this right?
With a Hilbert transformer of an odd number of taps, the delay needed for alignment is available at the middle tap. But I have to remind you again: there is no such thing as instantaneous reactive power. Instantaneous quantities don't have phase. You can maintain a running sum of products accumulated for the past period; they will be watts ans VARs. The instantaneous numbers are meaningless until integrated. 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;