hello,
I want to measure the peaks and Valleys for wave siganls in different forms
And then save the Values of Peaks and Valleys in the same sequence in the wave
I know how to measure the Peaks but the the problem for me with the Valleys ,, and how to store them in sequence in array
For example for normal sine wave with amplitude 4000 , the result should be :
FR = 4000*sin(tt);
result = [4000 -4000 4000 -4000 4000 .... .... ...]
but the wave function can be also most of time not simple sine Function as this one
I need this to use it in the function of rainflow counting in Matlab, which it seems that this function in Matlab can not find the peaks and Valleys simply automaticilly

6 Kommentare

dpb
dpb am 30 Aug. 2020
To find "valleys", use findpeaks on the negative of the input signal...
What do you want to do about the ringing in the signal above?
khaled elbatawy
khaled elbatawy am 30 Aug. 2020
Thank you for your Answer ! .. I know it is simple with simple sine function but it can be complicated function as the signal above , so that using findpeaks on the negative of the input signal would not work or solve the problem
Image Analyst
Image Analyst am 30 Aug. 2020
What indexes do you want it to find for the peaks and valleys in that ringing square wave? For every single peak or valley on the ring? Or do you want to ignore the ringing? findpeaks() has many options -- have you explored them all?
khaled elbatawy
khaled elbatawy am 30 Aug. 2020
It is better to give the whole picture for what i want exactlz . I need to produce different Loads (stress or forces) in different sine functions and then calculate for it Cycles for every Load amplitude with using of Rainflow counting . so it would be so helpful to find general way to count not specific for only one function wave.
So the x axis would be the time and the y axis would be the load value (in different sine form) what is impoertant for me to know all the turning points to use them in rainflow counting.
dpb
dpb am 30 Aug. 2020
"So the x axis would be the time and the y axis would be the load value (in different sine form) what is impoertant for me to know all the turning points..."
We've no way to have any idea what you mean by the above; we don't have anything to go on but what you post whereas you know your problem space/definition inside and out.
I would guess there isn't any single simple solution if the form of the input function can vary drastically -- data analysis just generally isn't that straightforward. You may find some techniques that are reasonably robust for a given class of inputs but fail miserably on others...and other algorithms for other classes will likely behave the same.
First you have to define what it is that you want definitively-enough that somebody can recognize that request.
Thank you for suggestion !
For now i am working in sine wave + this wave function
tt = 0:0.001:10
for l=1:4002
FR(l) = sum(7000*sin(1*pi*([1:2:71])*tt(l))./([1:2:71]));
end
My problem is always with Rainflow counting in Matlab
If you have Knowledge or Advices how to get the right results of it or the best way to reach that , it would be so helpful for me

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Star Strider
Star Strider am 30 Aug. 2020

0 Stimmen

See if the Signal Processint Toolbox statelevels function will do what you want.

Kategorien

Gefragt:

am 30 Aug. 2020

Kommentiert:

am 30 Aug. 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by