Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIR with duration #89

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

FIR with duration #89

wants to merge 3 commits into from

Conversation

behinger
Copy link
Member

@behinger behinger commented Jul 20, 2022

Allows to specify duration for each FIR event.

Warning: predict + LMM is not really supported right now and we don't throw a warning. I documented it in FIRbasis and firkernel, but it is not easy to throw a warning.

Not sure how to proceed. It is not easy to fix, because the basis function will have variable duration, depending on the duration provided in the kernel. We could "cut" the kernel...

Why does HRF not have this issue?

Good question! Because we specify the max length for the HRF :)

This is how it looks like
grafik

@behinger
Copy link
Member Author

behinger commented Aug 9, 2023

please check, unclear if compatible with the new fastpath
time_expand_allBasesSameCols
in designmatrix.jl

Comment on lines +27 to +34
# defining a firkernel with a duration = 1 sample, should be equal to the non-duration one
f_dur = Unfold.firkernel([103.3;1],range(-0.1,step=0.01,stop=0.31))
f_fir = Unfold.firkernel(103.3,range(-0.1,step=0.01,stop=0.31))
@test f_dur == f_fir

# test duration for samples = 4
f_dur = Unfold.kernel(firbase)([1,4])
@test all(sum(f_dur,dims=1) .== 4)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
# defining a firkernel with a duration = 1 sample, should be equal to the non-duration one
f_dur = Unfold.firkernel([103.3;1],range(-0.1,step=0.01,stop=0.31))
f_fir = Unfold.firkernel(103.3,range(-0.1,step=0.01,stop=0.31))
@test f_dur == f_fir
# test duration for samples = 4
f_dur = Unfold.kernel(firbase)([1,4])
@test all(sum(f_dur,dims=1) .== 4)
# defining a firkernel with a duration = 1 sample, should be equal to the non-duration one
f_dur = Unfold.firkernel([103.3; 1], range(-0.1, step = 0.01, stop = 0.31))
f_fir = Unfold.firkernel(103.3, range(-0.1, step = 0.01, stop = 0.31))
@test f_dur == f_fir
# test duration for samples = 4
f_dur = Unfold.kernel(firbase)([1, 4])
@test all(sum(f_dur, dims = 1) .== 4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant