11-18-2009 04:39 AM
Hello,
I would like to compare the values of a signal (1-D array) with each other and always display the maximum value then. But only if it is desired.
It should be in principle, a peak hold function, which I always displays the maximum value.
In the "FFT Power Spectrum.vi" there is such a "peak hold function". However, I do not know how I can integrate it without the "FFT Power Spectrum.vi" in my vi.
Maybe someone can help me here.
An image of the vi said maybe more (the picture shows a first attempt, which unfortunately does not work as expected).
Thank you and best regards
Alesis
Solved! Go to Solution.
11-18-2009 07:18 AM
See the attached vi.
Your approach was very close but since you dont initialize the SR you will see peaks from previous executions of the application.
The attached sub vi can be make reentrant if you need it in multiple places where the signals have seperate peaks. It also will reinintialize on first call or can be reset at any point of execution with a boolean input.
11-18-2009 07:20 AM
Forgot the attachment.
Note since it uses the Max function it will keep the first peak (you could insert a reverse array or replace this logic to find the last peak)
11-18-2009 07:53 AM - edited 11-18-2009 07:56 AM
Thank you for the example.
However, I would, if the Case Structure to "true" goes, let me always see the "maximal" graphs.
There is a fine example:
Simple Spectrum Analyzer (sim). Vi
There you can adjust the "averaging mode" mode "peak hold".
I'd prefer it exactly that way. But without the FFT Power Spectrum.vi!
And unfortunately, I do not understand what going on in the FFT Power Spectrum.vi if you click into it (especially in the area of the "peak hold" function).This is probably the problem...
Hope you can help me with my problem again.
Thanks, Alesis
11-18-2009 11:19 AM
Has no one an idea how to make a "peak hold" function without this "FFT Power Spectrum.vi "?
(Or maybe someone has another suggestion how to display only the maximum on the graph?)
The best way to see what I mean is in the example where I have mentioned above!--> Simple Spectrum Analyzer (sim).vi
(It is not easy to describe the problem exactly)
However, I need it without the 'FFT Power Spectrum.vi.
If
the "peak hold" function is selected in this example, the signal
travels slowly upward in the graph -> it will demonstrate that only
the maximum value is displayed!
And that's exactly what I need!
I hope someone knows what I mean and can still help me, because unfortunately the example of "falkpl" did not work as i need it...
In my picture above you can see that I have tried something.
But unfortunately it does not work like I need it...
Best regards Alesis
11-18-2009 11:42 AM
All you need is a little help from the Max & Min Function. (At least for how I remember Max Hold)
11-18-2009 01:19 PM
That looks really good!
I think that's exactly what I need.
Tomorrow I will try to incorporate it into my vi.
I live in Germany and there is a bit later. (so until tomorrow)
And this may explain my somewhat "worse" English
11-24-2009 12:42 AM
Hello Darin.K
with a little delay, I would like to express my thanks to you!
The "peak hold" function works fine now.
It was in principle exactly what I needed. Although I had to rebuild a few things so that it works for me but the main thing is it works now!
Thanks again and best regards!!!
Alesis
11-25-2009 10:36 PM
Alesis wrote:Hello Darin.K
with a little delay, I would like to express my thanks to you!
Then please mark Darin's reply as the solution to your problem rather than your own thank you message. You can unmark your message as the solution by going to the Options menu to the upper right hand corner of your reply.
11-25-2009 11:49 PM
Sorry, I thought I can mark the solution anywhere.
But I have corrected the error and sets the mark for Darin.
Alesis