Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/TimeDomain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This function calculates the differences between the NN intervals
function nn_diff(n)
diff=[]
for i in 1:length(n)-1
push!(diff,abs(n[i+1]-n[i]))
push!(diff,n[i+1]-n[i])
end
return diff
end #nn_diff
Expand Down Expand Up @@ -63,7 +63,7 @@ with an interval smaller than x ms
function nn(diff,x)
count=0
for d in diff
if d>x
if abs(d)>x
count+=1
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ g=HeartRateVariability.geometric(n)
@test td.mean≈917.24 atol=0.1
@test td.sdnn≈137.19 atol=0.1
@test td.rmssd≈27.85 atol=0.1
@test td.sdsd≈20.35 atol=0.1
@test td.sdsd≈27.85 atol=0.1
@test td.nn50≈342 atol=1
@test td.pnn50≈4.41 atol=0.1
@test td.nn20≈2831 atol=1
Expand Down