abcde
August 6, 2020, 2:55am
#1
using EmpiricalModeDecomposition
a=convert(Vector{Float64},rand(20))
s=
EMD_heping_1MX_V_35kV1=EmpiricalModeDecomposition.hht(a,s)
This is my code,I don’t know how the keyword S should be defined, this is the code in the Pkg description:
hht(signal::Vector{Float64}, s::EEMDSetting)
And this is Pkg’s website:
https://juliahub.com/docs/EmpiricalModeDecomposition/c9SYr/0.1.1/autodocs/
It doesn’t say what should s be.How do I define s?thanks!
nilshg
August 6, 2020, 7:15am
#2
If a function is not described in the docs it’s often helpful to read the tests of a package. In this case it seems the tests don’t include hht
, but other functions that take an EEMDSetting
as their second input:
using EmpiricalModeDecomposition
using Test
using Random
# write your own tests here
@testset "ismonotonic" begin
@test EmpiricalModeDecomposition.ismonotonic(1:100)
@test EmpiricalModeDecomposition.ismonotonic(100:-1:1)
@test EmpiricalModeDecomposition.ismonotonic([1.0,2.0,3.0,6.0])
@test EmpiricalModeDecomposition.ismonotonic([6.0,5.0,1.0])
@test EmpiricalModeDecomposition.ismonotonic([1.0,3.0,2.0]) == false
@test EmpiricalModeDecomposition.ismonotonic([3.0,1.0,2.0]) == false
end
@testset "emd" begin
x = -1:0.1:2π+1
measurements = sin.(x)
imfs = emd(measurements,x)
@test isapprox(imfs[1], measurements, rtol=0.001)
end
This file has been truncated. show original