Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

finding local maxima

Options
  • 15-06-2004 12:55pm
    #1
    Registered Users Posts: 1,366 ✭✭✭


    Ok,

    I 've got an array holding integers describing a sin wave. The values range from about +30 to -30.

    The problem is, the signal can be noisy enuf, and peak detection (finding the indexes of local maxima within the signal) can be quite difficult.

    I have two algorithms myself (which arent quite good enuf), but I'd be interested if anyone had any other ideas on how to tackle the problem....

    Thanks,

    King


Comments

  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 90,999 Mod ✭✭✭✭Capt'n Midnight


    you're looking at some sort of moving average,
    using trapeziod or simpsons(SP)
    the number of points to be averaged depends on the noise.


  • Closed Accounts Posts: 47 PhilH


    I may be reading too much into the question, but it sounds more like a curve fitting problem. If you know it is a sin wave, and you know the amplitude (+/-30) then surely all you need to know is the wavelength and the offset from zero (if any).


  • Registered Users Posts: 1,372 ✭✭✭silverside


    If you just want to find the frequency of the signal, use spectral analysis (using FFT) to find the peak frequency.

    If its a strong signal, doing some sort of a linear filter such as a moving average should get you a good idea of the true signal.

    Is the noise random or does it have a pattern, possibly related to the signal? If so you might want to look at Kalman filtering.

    Could you post some sample data? How maths-y are you?


  • Registered Users Posts: 1,366 ✭✭✭king_of_inismac


    Thanks for the replies guys,

    Used an averaging algorithm, and then a DSP algorithm to clean the signal.

    Then I cut off the top off the wave and found the centre point of the arc. This represented the peak position.

    Twas one hell of an algorithm, but it worked :D

    Thanks again,
    King


Advertisement