DSPRelated.com
Forums

Measuring Peak Value

Started by Wolfgang September 7, 2004
Alexey Lukin wrote:

> Jerry Avins <jya@ieee.org> wrote in message news:<413f08aa$0$6931$61fed72c@news.rcn.com>... > >>Assuming that there is no significant aliasing -- a shaky assumption if >>the sampling frequency is as low as you suggest -- the peak of the >>reconstructed signal will be the same as the peak of the sampled signal. > > > I'm afraid that this is not quite true. "Analog" peak levels can go as > high as +6 dB beyond digital sample values for some (strange) signals. > So this requires that we scan through all the regions in the digital > signal where digital values are within -6...0 dB of the peak digital > value. Still it makes sense to scan only through these regions using > bandlimited interpolation (referenced in some of previous posts). > > Best regards, > Alex
It's evident I wasn't clear. I wrote not of value of a peak sample, but of the peak value of the reconstructed analog. If the reconstruction is accurate, the original and reconstructed analog signals will match. A signal need not be strange for its actual peak to be greater than any of its samples. Consider the sampled signal 0, 1, 1, 0, -1, -1, [repeat] 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;
Jerry Avins wrote:

(snip)

> It's evident I wasn't clear. I wrote not of value of a peak sample, but > of the peak value of the reconstructed analog. If the reconstruction > is accurate, the original and reconstructed analog signals will match.
> A signal need not be strange for its actual peak to be greater than any > of its samples. Consider the sampled signal 0, 1, 1, 0, -1, -1, [repeat]
sin(x) sampled every 60 degrees (pi/3 radians), so the original and reconstructed amplitude should be 2/sqrt(3). I was thinking of 1, 1, -1, -1, repeat, sin(x+pi/4) sampled every pi/2 radians, for amplitude sqrt(2). Sqrt(2) amplitude, 2 in intensity (power), or 3dB. -- glen
glen herrmannsfeldt wrote:

> Jerry Avins wrote: > > (snip) > >> It's evident I wasn't clear. I wrote not of value of a peak sample, but >> of the peak value of the reconstructed analog. If the reconstruction >> is accurate, the original and reconstructed analog signals will match. > > >> A signal need not be strange for its actual peak to be greater than >> any of its samples. Consider the sampled signal 0, 1, 1, 0, -1, -1, >> [repeat] > > > sin(x) sampled every 60 degrees (pi/3 radians), > so the original and reconstructed amplitude should be 2/sqrt(3). > > I was thinking of 1, 1, -1, -1, repeat, sin(x+pi/4) sampled > every pi/2 radians, for amplitude sqrt(2). > > Sqrt(2) amplitude, 2 in intensity (power), or 3dB. > > -- glen
Yes. I eliminated the third harmonic (of the DAC output before filtering) and produced a less extreme case. I couldn't think of a simple 6 dB case, though. Incidentally, 2/sqrt(3) is 1.25 dB. 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;
glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote in message news:<2Wa0d.275611$8_6.140921@attbi_s04>...
> I was thinking of 1, 1, -1, -1, repeat, sin(x+pi/4) sampled > every pi/2 radians, for amplitude sqrt(2). > > Sqrt(2) amplitude, 2 in intensity (power), or 3dB.
Yep! I've seen some signals approaching +7 dB value. I'll paste some here if I get a chance to find them again. Alex
Alexey Lukin wrote:
> > I was thinking of 1, 1, -1, -1, repeat, sin(x+pi/4) sampled > > every pi/2 radians, for amplitude sqrt(2). > > > > Sqrt(2) amplitude, 2 in intensity (power), or 3dB. > > Yep! I've seen some signals approaching +7 dB value. I'll paste some > here if I get a chance to find them again.
The maximum overshoot is not bounded, we've discussed this before: http://groups.google.com/groups?threadm=3D55D545.5FF8C854%40ieee.org Regards, Andor
"Andor" <an2or@mailcircuit.com> wrote in message
news:ce45f9ed.0409120549.6518c797@posting.google.com...
> Alexey Lukin wrote: > > > I was thinking of 1, 1, -1, -1, repeat, sin(x+pi/4) sampled > > > every pi/2 radians, for amplitude sqrt(2). > > > > > > Sqrt(2) amplitude, 2 in intensity (power), or 3dB. > > > > Yep! I've seen some signals approaching +7 dB value. I'll paste some > > here if I get a chance to find them again. > > The maximum overshoot is not bounded, we've discussed this before: > > http://groups.google.com/groups?threadm=3D55D545.5FF8C854%40ieee.org
Andor, It seems that discussion was flawed in that it dealt with sampling at fs=2B which doesn't support reconstruction for an arbitrary signal (like sin(2*pi*B*t). Here the sampling is at fs=4B if I understand the assertion. So then I'd doubt that the maxima are unbounded. Fred
Hello Clay,

This was exactly what I was looking for as a starting point.
I was shure that someone investigated this in a more profound way.
But I was impressed to get so many responses.

                                                Thanks, Wolfgang

"Clay Turner" <physics@bellsouth.net> schrieb im Newsbeitrag news:p5F%c.111118$_h.47@bignews3.bellsouth.net...
> > "Wolfgang" <never@nowhere.com> wrote in message > news:chkoiv$6kl$05$1@news.t-online.com... > > Dear all, > > > > I've a stream of sampled values which were filtered and downsampled. > > I'm interested in the (exact) maximum value of an incomming peak. > > Is there a simpler way of finding that peak value instead of upsampling > > and searching the greatest value ? > > (The frequency content of the peak reaches half of the sampling rate, > > hence i've not a lot values around the maximum without resampling with a > higher frequency.) > > > > All suggestions are wellcome. > > > Wolfgang > > > > > > > > Hello Wolfgang, > > This is not the simplest method in terms of computation, but it will yield a > very precise result. > > http://personal.atl.bellsouth.net/p/h/physics/dspintrp.pdf > > > IHTH, > Clay S. Turner > > > >
Many thanks for so many hints and suggestions !
Now I can think about my implementation more thoroughly.

My signal was former analog and to measure the peak came from the analog times.
It's well sampled and to reduce computational effort it's filtered digitally and downsampled.
Hence the hint with the DAC+Filter and comparator is not what is wanted
(as this is what is exchanged).
The peak is only neaded to be comparable with the former solution to prove the algorithm and
hardware in comparison with the existing solution.
As I know that the signal is bandlimited I thought that there must be a simpler
way than upsampling and seeking the maximum.

                                Thanks for the - surprisingly - lots of hints and suggestions.

                                                    Wolfgang

P.S.: I'll try to figure out how great differences between "analog" and "digital" (sampled) signal
can be ... I was also thinking about sin sampled every 60&#4294967295; ... And this error is definitly unacceptable.





Wolfgang wrote:

> Many thanks for so many hints and suggestions ! > Now I can think about my implementation more thoroughly. > > My signal was former analog and to measure the peak came from the analog times. > It's well sampled and to reduce computational effort it's filtered digitally and downsampled. > Hence the hint with the DAC+Filter and comparator is not what is wanted > (as this is what is exchanged). > The peak is only neaded to be comparable with the former solution to prove the algorithm and > hardware in comparison with the existing solution. > As I know that the signal is bandlimited I thought that there must be a simpler > way than upsampling and seeking the maximum. > > Thanks for the - surprisingly - lots of hints and suggestions. > > Wolfgang > > P.S.: I'll try to figure out how great differences between "analog" and "digital" (sampled) signal > can be ... I was also thinking about sin sampled every 60&#4294967295; ... And this error is definitly unacceptable.
Can you pick out the peaks before the initial downsampling? It would be nice to use the information before you thin it and then have to fill it in again. 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;
Hello Jerry,

> Can you pick out the peaks before the initial downsampling? It would be > nice to use the information before you thin it and then have to fill it > in again.
Yes your're right. Only things against it: 1.) I filter to cut out higher frequency content as it is noise. 2.) The filtering and downsampling is done in another DSP and the stream of data is constantly transmitted (don't want to implement a special max-data transfer). 3.) Hopefully this value is only required for comparison. And later through'n out. But I'll have a try with the formulas for precise reconstruction given by Clay Turner and see if this can be implemented using just some points around the peak. Many thanks, Wolfgang
> -- > 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;
But why do Managers don't understand that ? ;-)