??? 12/30/10 17:42 Read: times |
#180351 - Peaks Responding to: ???'s previous message |
So if I understand correctly you want to capture each peak value as shown below and then average those peaks across some number of peaks and finally report that value.
My immediate idea of how to tackle this would be to first evaluate the number of samples between when the signal reaches peak and when you can note the fast fall at some threshold difference. The threshold you need to use should be 2-3 times greater than the noise wigglies in the signal on the slow ramp up time. Use the number of samples noted above to be used for a delay fifo that you will run all samples through. (A sample value shift register if you may want to think of it that way). Next at each sample time, as the delayed values emerge from the delay fifo, apply the values to a rolling average filter. The intent of this filter is to smooth the wigglies out of the values of samples as the ramp goes up. The output of this filter can be your smoothed peak value which you can the apply to a software peak detector. Use the value in the software peak detector whenever the fast negative threshold is detected as described above. The threshold measurement should be the difference between the sample just entering the FIFO and the smoothed value exiting the rolling average filter. As the software peak detector value is consumed then reset the peak detector to start looking for a new peak. For your long term peaks values you can run them through a second rolling average filter to create the average values for you so you have a filtered real time average to work with. How much bandwidth needed for this? I suspect that if you were taking A/D readings at say every 100 microseconds that a 1x clocker processor running at about 20 MHz should be able to do this job in less than 30% CPU load. A lot will depend on how efficiently you can code your delay FIFO and the rolling average filters. If you use even power of two sizes for the FIFO and the filters then index wrap can be handled by a mask as opposed to mathematical comparisons. Michael Karas |
Topic | Author | Date |
Data analysis | 01/01/70 00:00 | |
Mean Peaks | 01/01/70 00:00 | |
Peaks | 01/01/70 00:00 | |
Peaks | 01/01/70 00:00 | |
Many thanks. | 01/01/70 00:00 | |
first principles | 01/01/70 00:00 | |
Or capture end flank | 01/01/70 00:00 | |
Thanks | 01/01/70 00:00 | |
You know what? A lot of guys doing useful work with PC's .. | 01/01/70 00:00 | |
Delphi | 01/01/70 00:00 | |
Delphi compiler | 01/01/70 00:00 | |
Delphi | 01/01/70 00:00 | |
Borland -> CodeGear -> Embarcadero | 01/01/70 00:00 | |
yes...indeed | 01/01/70 00:00 | |
Not entirely | 01/01/70 00:00 | |
only? | 01/01/70 00:00 | |
CodeWright | 01/01/70 00:00 | |
They are just stupid | 01/01/70 00:00 | |
Borland collected | 01/01/70 00:00 | |
Verity Stob | 01/01/70 00:00 | |
Good one | 01/01/70 00:00 | |
Read her "Best of" | 01/01/70 00:00 | |
Codewright | 01/01/70 00:00 | |
RE: what kind Codewright? | 01/01/70 00:00 | |
what a nice programmer | 01/01/70 00:00 | |
HUH? | 01/01/70 00:00 | |
CodeWright - still available? | 01/01/70 00:00 | |
CodeWright available from embarcedero ... | 01/01/70 00:00 | |
How do they justify that??! | 01/01/70 00:00 | |
Corporate decision | 01/01/70 00:00 | |
Version? | 01/01/70 00:00 | |
2010 | 01/01/70 00:00 |