https://github.com/ymtoo/findpeaks1d.jl
Finding peaks in 1-D data
https://github.com/ymtoo/findpeaks1d.jl
find-peaks one-dimensional
Last synced: about 1 year ago
JSON representation
Finding peaks in 1-D data
- Host: GitHub
- URL: https://github.com/ymtoo/findpeaks1d.jl
- Owner: ymtoo
- License: mit
- Created: 2020-05-07T10:15:28.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T03:35:19.000Z (over 3 years ago)
- Last Synced: 2025-02-26T07:48:29.896Z (over 1 year ago)
- Topics: find-peaks, one-dimensional
- Language: Julia
- Homepage:
- Size: 589 KB
- Stars: 9
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FindPeaks1D

[](https://codecov.io/gh/ymtoo/FindPeaks1D.jl)
[](https://ymtoo.github.io/FindPeaks1D.jl/stable)
[](https://ymtoo.github.io/FindPeaks1D.jl/dev)
Finding peaks in a 1-D signal in Julia. The implementation is based on [`find_peaks`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html) in `SciPy`.
## Installation
```julia-repl
julia>]
pkg> add FindPeaks1D
```
## Usage
```julia
using FindPeaks1D, ImageFiltering, Plots
n = 48001
s1 = ImageFiltering.Kernel.gaussian((1000,), (n,))
s2 = ImageFiltering.Kernel.gaussian((500,), (n,))
s = s1.parent/maximum(s1.parent) + 0.5 * circshift(
s2.parent/maximum(s2.parent), (10000,))
```
```julia
pkindices, properties = findpeaks1d(s;
height=0.1,
prominence=0.2,
width=1000.0,
relheight=0.9)
plot(s; color="black", label=false)
scatter!(pkindices, s[pkindices]; color="red", markersize=5, label="peaks")
vline!(properties["leftips"]; color="blue", width=2, label="peak edges")
vline!(properties["rightips"]; color="blue", width=2, label=false)
xlabel!("Sample")
```

```julia
pkindices, properties = findpeaks1d(s;
height=0.1,
distance=12000,
prominence=0.2,
width=1000.0,
relheight=0.9)
plot(s; color="black", label=false)
scatter!(pkindices, s[pkindices]; color="red", markersize=5, label="peaks")
vline!(properties["leftips"]; color="blue", width=2, label="peak edges")
vline!(properties["rightips"]; color="blue", width=2, label=false)
xlabel!("Sample")
```
